akhauriyash/Code-Regression huggingface dataset:
/*
मनस्वी म्रियते कामं कार्पण्यं न तु गच्छति ।
अपि निर्वाणमायाति नानलो याति शीतताम् ॥
*/

#include <bits/stdc++.h>
// #include <ext/pb_ds/assoc_container.hpp> 
// #include <ext/pb_ds/tree_policy.hpp> 
// using namespace __gnu_pbds;
using namespace std;
#define mod 1000000007
#define pb push_back
#define mp make_pair
#define ll long long int
#define ld long double
#define vi vector<int>
#define vl vector<ll>
#define v2i vector<vector<int>>
#define v2l vector<vector<ll>>
#define ppi pair<int,int>
#define ppl pair<ll,ll>
#define vpi vector<ppi>
#define vpl vector<ppl>
#define all(x) x.begin(),x.end()
#define ii int,int 
#define ff first    
#define ss second
#define forn(i,a,b) for(int i=a;i<b;i++)
#define forr(i,a,b) for(int i=a;i>=b;i--)
#define forv(i,m) for(auto i : m)
#define p2d(v) for(auto a:v){for(auto b:a)cout<<b<<" ";cout<<endl;}
#define p1d(v) for(auto a:v)cout<<a<<" ";cout<<endl;
#define ppd(v) for(auto a:v)cout<<a.ff<<" "<<a.ss<<endl;
#define imx INT_MAX
#define imn INT_MIN
#define inf 9000000000000000000
#define minf -inf
#define endl "\n"
#define fast ios_base::sync_with_stdio(false);cin.tie(NULL);
#define sze size()
#define rvs reverse 
#define itr iterator 
#define pre cout<<fixed<<setprecision(10);
#define umap unordered_map
#define uset unordered_set
#define pi 3.141592653589793
#define MAXN 100005
#define test1(x) cout << #x " = " << x << endl;
#define test2(x,y) cout << #x " = " << x << " " << #y " = " << y << endl;
#define test3(x,y,z) cout << #x " = " << x << " " << #y " = " << y << " " << #z " = " << z << endl;
#define test4(w,x,y,z) cout << #w " = " << w << " " << #x " = " << x << " " << #y " = " << y << " " << #z " = " << z << endl;
const ll infinity = 9e18;

/*
#define oset tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update>
#define MODM(a,b,md) ((a%md)*(b%md))%md
#define MODA(a,b,md) ((a%md)+(b%md))%md
#define ull unsigned long long int
*/

/*
bool compare(int a,int b) {return a > b;}
bool compare1(ppi a,ppi b) {return a.ff > b.ff;}
bool compare2(ppi a,ppi b) {return a.ss < b.ss;}
ll Npower(ll a,ll b) {ll product = 1; while(b){if(b&1){product = product*a;}a = a*a;b = b>>1;} return product;}
ll power(ll a,ll b,ll md) {ll product = 1; while(b){if(b&1){product = MODM(product,a,md);}a = MODM(a,a,md);b = b>>1;} return product%md;}
bool isprime(ll n){if(n < 2) return 0; ll i = 2; while(i*i <= n){if(n%i == 0) return 0; i++;} return 1;}
ll GCD(ll a,ll b) {return b==0 ? a:GCD(b,a%b);}
ll LCM(ll a,ll b) {return (a/GCD(a,b))*b; }
*/


int main()
{
    fast

/*
    #ifndef ONLINE_JUDGE
        freopen("input.txt",  "r",  stdin);
        freopen("output.txt", "w", stdout);
    #endif
//*/

        
    ll a,b,n;
    cin>>a>>b>>n;


    ll k = n/b;

    ll maxi = ((a*n)/b) - a*(k);

    maxi = max(maxi,((a*(max(0LL,b*k-1)))/b) - a*(max(0LL,k-1)));


    for(ll i = k; i >= max(k-100000000LL,0LL); i--)
    {
        maxi = max(maxi,((a*(max(0LL,b*i-1)))/b) - a*(max(0LL,i-1)));
    }

    for(ll i = 0; i <= min(100000000LL,k); i++)
    {
        maxi = max(maxi,((a*(max(0LL,b*i-1)))/b) - a*(max(0LL,i-1)));
    }




    cout<<maxi;


    return 0;
}

Measured memory_bytes: 3648
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <cmath>
#include <iomanip>
using namespace std;

#define len length()
#define sz size()
#define rep(i, n) for(int i = 0; i < n; i++)
#define srt(v) sort(v.begin(), v.end())
#define rev(s) reverse(s.begin(), s.end())
#define veci(a, n) vector<int> a(n)
#define vecs(a, n) vector<string> a(n)
#define psb(a) push_back(a)
#define ppb pop_back()
#define sp(n) cout << setprecision(n) << fixed
#define fst(s) s.at(0)
#define lst(s) s.at(s.len - 1)

int main(){
    int A, B, C, X;
    cin >> A >> B >> C >> X;
    int ans=0;
    for(int i=0; i <= min(X/500, A); i++){
        for(int j=0; j<=min((X-500*i)/100, B); j++){
            int las=X-500*i-100*j;
            if((las%50==0)&&(las<=50*C)) ans++;
        }
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 256
//@author :  |< U $ |-|
#include<cmath>
#include<iostream>
#include<vector>
#include<set>
#include<map>
#include<stack>
#include<deque>
#include<algorithm>
#include<list>
#include<cstring>
#define ll long long
#define vi vector<long long>
#define pb push_back
#define pop pop_back
#define pi pair<long long ,long long>
#define vp vector<pair<long long,long long> >
#define mkp make_pair
#define in(i,n) for(i=0;i<n;i++)
#define fon(i,n,m) for(i=n;i<m;i++)
#define rfon(i,n,m) for(i=n;i>=m;i--)
#define F first
#define S second
#define all(v) v.begin(),v.end()
#define jaldi ios_base::sync_with_stdio(false);cin.tie(NULL);
#define map map<long long,long long>
#define inm1(b)  memset(b,-1,sizeof(b))
#define in0(b) memset(b,0,sizeof(b))
#define ininf(b) memset(b,1000000001,sizeof(b))
#define MOD         1000000007
#define I 10000000001
#define TakeInput freopen("input.txt", "r", stdin);freopen("output.txt", "w", stdout); 
using namespace std;
int gcd(int a, int b) {  if (a == 0)  return b; return gcd(b % a, a); }  
int main()
{
    jaldi
    #ifndef ONLINE_JUDGE 
    //TakeInput
    #endif
    ll i,j,k;
    string a;
    cin>>a;
    ll f=1;
    in(i,a.length()){
        if(i%2 ==0 && !(a[i]=='R' || a[i]=='U'||a[i]=='D')){
            f=0;
            //cout<<i;
            break;
        }
        else if(i%2==1 && !(a[i]=='L' || a[i]=='U'||a[i]=='D'))
        {
           // cout<<i;
            f=0;
            break;
        }
    }
    if(f){
        cout<<"Yes";
    }
    else
    {
        cout<<"No";
    }
    
}
 
 








 

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main()
{
    int matrix[4][4]={0},a,b;
    for(int i=0;i<3;i++)
    {
        cin>>a;
        cin>>b;
        matrix[a-1][b-1]=1;
        matrix[b-1][a-1]=1;
    }
    int cnt=0,cnt1=0;
    for(int i=0;i<4;i++)
    {
        cnt=0;
        for(int j=0;j<4;j++)
        {
            if(matrix[i][j]==1)
                cnt++;
        }
        if(cnt>=2)
            cnt1++;
    }
    if(cnt1>=2)
        cout<<"YES"<<endl;
    else
        cout<<"NO"<<endl;
}


Measured memory_bytes: 256
#include <stdio.h>

int main (void)
{
    long long N, a;
    int i, odd = 0;

    scanf("%lld", &N);

    for (i = 0; i < N; i++) {
        scanf("%lld", &a);
        if (a % 2 != 0) odd++;
    }

    if (odd == 0) {
        puts("second");
    } else {
        puts("first");
    }
}


Measured memory_bytes: 256
import java.util.Scanner;

public class Main {

    public static final int MOD = (int) (Math.pow(10, 9) + 7);

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = Integer.parseInt(sc.next());
        int odd = 0;
        int two = 0;
        int four = 0;
        for (int i = 0; i < n; i++) {
            int a = Integer.parseInt(sc.next());
            if (a % 2 != 0) {
                odd++;
            } else if (a % 4 == 0) {
                four++;
            } else {
                two++;
            }
        }
        if (two == 0) {
            if (four - odd >= -1) {
                System.out.println("Yes");
            } else {
                System.out.println("No");
            }
        } else {
            if (four - odd >= 0) {
                System.out.println("Yes");
            } else {
                System.out.println("No");
            }
        }
    }
}

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

int main(void){
    int n;
    string s;
    cin >> n >> s;
    int cnt = 0;
    rep(i,n-2){
        if (s.substr(i,3) == "ABC") {
            cnt++;
        }
    }
    cout << cnt << endl;
    return 0;
}


Measured memory_bytes: 256
import java.util.*;
import java.io.*;
import java.lang.reflect.Array;
import java.lang.reflect.Constructor;
import java.util.function.*;
// import lib.util.*;
// import lib.graph.*;
// import lib.io.*;
// import lib.math.*;

public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int K = sc.nextInt();
        int Q = sc.nextInt();
        int[] A = new int[N];
        Arrays.fill(A, K - Q);
        StringBuilder res = new StringBuilder();
        for (int i = 0; i < Q; i++) {
            A[sc.nextInt() - 1]++;
        }
        for (int i = 0; i < N; i++) {
            if (A[i] <= 0) {
                res.append("No\n");
            } else {
                res.append("Yes\n");
            }
        }
        System.out.println(res);
    }
}

Measured memory_bytes: 58832
#include<bits/stdc++.h>
//#include<atcoder/all>
using namespace std;
using ll = long long;

int main()
{
	int n;
	cin >> n;
	vector<int> a(n+1),b(n);
	for(auto &i:a)cin >> i;
	for(auto &i:b)cin >> i;
	ll ans =0;
	for(int i  =0;i<n;i++)
	{
		int now = min(a[i],b[i]);
		a[i] -= now;
		b[i] -= now;
		ans += now;

		now = min(a[i+1],b[i]);
		a[i+1] -= now;
		ans += now;
	}
	cout<<ans<<endl;
}


Measured memory_bytes: 4052
#include <iostream>
#include <stdio.h>
#include <string>
#include <cstdlib>
#include <cmath>
#include <cstring>
#include <math.h>
#include <vector>
#include <algorithm>
#include <queue>
#include <stack>

using namespace std;

typedef unsigned long long ull;
typedef long long ll;

#define mod ((ull)1e9+7)
#define MAX ((ull)1e9)

int main(){
	int n, k;
	cin >> n >> k;
	int d[n+1], h[n+1];
	d[0]=0, d[1]=0;
	for(int i=1; i<=n; i++){
		cin >> h[i];
	}
	h[0]=h[1];

	for(int i=2; i<=n; i++){
		d[i]=d[i-1]+abs(h[i-1]-h[i]);
		for(int j=1; j<=k && j<=i; j++){
			d[i]=min(d[i], d[i-j]+abs(h[i-j]-h[i]));
		}
	}
	cout << d[n] << endl;
	return 0;
}

Measured memory_bytes: 1024
fun main(args: Array<String>) = abc163c()

fun abc163c() {
    val n = readLine()!!.toInt()
    val aList = readLine()!!.split(' ').map { it.toInt() }

    val count = IntArray(n)
    aList.forEach { count[it - 1]++ }

    val answer = count.joinToString(System.lineSeparator())

    println(answer)
}


Measured memory_bytes: 69252
#include <iostream>
#include <iomanip>
#include <math.h>
#include <string>
#include <algorithm>
#include <ctype.h>
#include <vector>
#include <numeric>
using namespace std;

#define ll long long int
#define rep(i, a, n) for (int i = a; i < n; i++)
#define INF 1e9
#define LINF 1e17
#define MOD (int)(1e9 + 7)
#define pi 3.141592653589
#define pii pair<int, int>
#define pll pair<ll, ll>
#define vi vector<int>
#define vll vector<ll>
#define ALL(a) (a).begin(), (a).end()
#define sort_v(a) sort(a.begin(), a.end())
#define fi first
#define se second

void print(bool a)
{
    if (a == true)
        cout << "Yes" << endl;
    else
        cout << "No" << endl;
}

ll gcdll(ll a, ll b)
{
    while (1)
    {
        if (a < b)
            swap(a, b);
        if (b == 0)
            break;
        a %= b;
    }
    return a;
}

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

int main()
{

    double w, h, x, y;
    cin >> w >> h >> x >> y;
    cout << setprecision(10);
    cout << fixed << w * h / 2 << endl;
    cout << (((x == w / 2) && (y == h / 2)) ? 1 : 0) << endl;
}


Measured memory_bytes: 256
#include <iostream>

using namespace std;

int main(){
  string num;
  int p,n[10000];
  while(cin >> num){
    p = (int)num.size() - 1;
    for(int i = 0; i < (int)num.size() ; i++){
      n[i] = num[i]-'0';
    }
    int k;
    while(1){

      for( k = 0 ; k < p ; k++){
	n[k] = (n[k] + n[k+1])%10; 
      }

      p--;
      if(p == 0)break;
      n[k] = 0;
    }
    cout << n[0] << endl;
  }
}

Measured memory_bytes: 1184
#! env/bin/local python3
# -*- coding: utf-8 -*-

import numpy as np

inputs = []

while True:
    try:
        inputs.append([int(i) for i in input().split()])
    except EOFError:
        break

h, w = inputs[0]
c = inputs[1: 11]
a = inputs[11:]

number_of_edge = 10
number_of_node = 10

for k in range(number_of_node):
    for i in range(number_of_node):
        for j in range(number_of_node):
            c[i][j] = min(c[i][j], c[i][k] + c[k][j])

target = []
for ca in a:
    target += ca

target = [ta for ta in target if np.abs(ta) != 1]
results = 0
for t in target:
    results += c[t][1]

print(results)



Measured memory_bytes: 13292
base_txt = input()
base_txt_to_P = base_txt.replace("?","P")
base_txt_to_D = base_txt.replace("?","D")
index_count_base_txt_to_P = base_txt_to_P.count("D") + base_txt_to_P.count("PD")
index_count_base_txt_to_D = base_txt_to_D.count("D") + base_txt_to_D.count("PD")
if index_count_base_txt_to_P >index_count_base_txt_to_D:
    print(base_txt_to_P)
else:
    print(base_txt_to_D)

Measured memory_bytes: 9452
#include<bits/stdc++.h>
using namespace std;
#define int long long
signed main() {
    #ifdef HOME
    freopen("input.txt", "r", stdin);
    #else
    ios_base::sync_with_stdio(0); cin.tie(0);
    #endif

    map <int, int> d;
    int n;
    cin >>n;
    for (int i = 0; i < n; ++i) {
        int x;
        cin >> x;
        ++d[x];
    }   
    int ans = 0;
    for (auto e : d) {
        if (e.second < e.first) ans += e.second;
        else ans += e.second - e.first;
    }   
    cout << ans << '\n';
}   

Measured memory_bytes: 6272
#define _CRT_SECURE_NO_WARNINGS
#define _USE_MATH_DEFINES
#pragma warning(disable:4996)
#include <stdio.h>
#include <string>
#include <stdlib.h>
#include <math.h>
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <functional>
#include <stack>
#include <queue>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <list>
#include <set>
#include <map>
#include <iomanip> 
#include <ctime>
#include <numeric>
#include <cassert>
#define rep(i,n) for (int i = 0; i < (n); ++i)
using namespace std;
typedef long long ll;
typedef pair<string, int> P;
typedef vector<vector<int>> Graph;

const double PI = 3.14159265358979323846;

const int mod = 1000000007;

int main(int argc, char *args[]) {
	ll a, b, c;
	cin >> a >> b >> c;
	if (a + b >= c) {
		cout << "No" << endl;
		return 0;
	}
	ll left = 4 * a* b;
	ll right = (a + b - c)*(a + b - c);
	if (left < right) cout << "Yes" << endl;
	else cout << "No" << endl;
	return 0;
}

Measured memory_bytes: 256
# -*- coding: utf-8 -*-

n,x = map(int,input().split())
a = list(map(int,input().split()))

ans = 0
for i in range(n-1):
    diff = max(0,(a[i+1] + a[i]) - x)
    ans += diff
    if a[i+1] >= diff:
        a[i+1] = a[i+1] - diff
    else:
        a[i] -= diff - a[i+1]
        a[i+1] = 0

print(ans)

Measured memory_bytes: 14588
/*
title:

url:
*/

#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <algorithm>
#include <functional>
#include <queue>
#include <limits>
#include <string>
#include <utility>
#include <cstring>
#include <map>
#include <cmath>
#include <iterator>

using namespace std;

#define rep(i, n) for (int i = 0; i < (n); i++)
#define INF 1000000007
#define int long long

typedef pair<int, int> pint;
typedef long long ll;

vector<int> f;

void set_f(int W)
{
    f.push_back(1);
    f.push_back(2);
    f.push_back(3);
    while (f.size() - 1 <= W)
    {
        f.push_back((f[f.size() - 1] + f[f.size() - 2]) % INF);
    }
}

int get_f(int index)
{
    if (index < 0)
        return 1;
    return f[index];
}

signed main()
{
    int H, W, K;
    cin >> H >> W >> K;
    int data[W + 2][H + 1];
    set_f(W);
    memset(data, 0, sizeof(data));
    data[1][0] = 1;
    for (int i = 0; i < H; i++)
    {
        for (int j = 1; j <= W; j++)
        {
            data[j][i] %= INF;
            data[j - 1][i + 1] += (data[j][i] * get_f(j - 3) % INF) * get_f(W - j - 1) % INF;
            data[j][i + 1] += data[j][i] * get_f(j - 2) * get_f(W - j - 1) % INF;
            data[j + 1][i + 1] += data[j][i] * get_f(j - 2) * get_f(W - j - 2) % INF;
            data[j - 1][i + 1] %= INF;
            data[j][i + 1] %= INF;
            data[j + 1][i + 1] %= INF;
        }
    }
    cout << data[K][H] % INF << endl;
}

Measured memory_bytes: 256
#define _USE_MATH_DEFINES

#include <iostream>
#include <cstdio>
#include <string>
#include <cstdlib>
#include <set>
#include <utility>
#include <vector>
#include <list>
#include <algorithm>
#include <regex>
#include <cmath>
#include <map>
#include <iterator>
#include <climits>
#include <numeric>
#include <bitset>
#include <unordered_map>
#include <unordered_set>
#include <iomanip>
#include <queue>
#include <deque>
#include <stack>
#include <array>
#include <valarray>
#include <complex>
#include <random>
#include <functional>
#include <cassert>
#include <chrono>
#include <memory>

using namespace std;

#define int long long
//region TEMPLATE
////@formatter:off
#define double long double
typedef long long ll;
typedef unsigned long long ull;
template<typename T>void __read(T &a) { cin >> a; }
template<typename T, typename ... Args> void __read(T &a, Args &... args) { cin >> a;__read(args...);}
#define make(t, ...) t __VA_ARGS__; __read(__VA_ARGS__)
#define makev(a, n) VI a(n); FOR(n) cin >> a[i];
#define ALL(x) (x).begin(), (x).end()
#define RALL(x) (x).rbegin(), (x).rend()
#define FORIT(p) for(auto it = p.begin(); it != p.end(); it++)
#define FOR(b) for(signed i = 0; i <(b); i++)
#define FORE(i, l, r) for(int i = (l); i < (r); i++)
#define NFOR(i, n) for(int i = (((int) n)-1); i >= 0; i--)
typedef vector<int> VI;
typedef vector<vector<int>> VVI;
typedef pair<int, int> PII;
typedef pair<pair<int, int>, int> PPII;
constexpr ll M7 = 1000000007ll;
constexpr ll M9 = 1000000009ll;
constexpr ll MFFT = 998244353ll;
template<class T> void outv(T &a) { for (auto &x : a) cout << x << ' '; }
static mt19937 rnd(static_cast<unsigned>(chrono::steady_clock::now().time_since_epoch().count())); // NOLINT(cert-err58-cpp)
////@formatter:on
//endregion


int32_t main() {
    ios_base::sync_with_stdio(false), cin.tie(nullptr);
    make(int, n, m);
    cout << (n + m - 1) / m;
    return 0;
}

Measured memory_bytes: 256
#![allow(non_snake_case, unused)]
use std::cmp::*;
use std::collections::*;
use std::f64::consts::*;

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

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

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

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

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

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

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

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

    ($next:expr, bytes) => {
        read_value!($next, String).into_bytes()
    };

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

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

fn main() {
    input! {
        n: usize,
        d: [usize; n],
        m: usize,
        t: [usize; m],
    }

    let mut d_cnt = HashMap::new();
    for i in 0..n {
        *d_cnt.entry(d[i]).or_insert(0) += 1;
    }

    let mut t_cnt = HashMap::new();
    for i in 0..m {
        *t_cnt.entry(t[i]).or_insert(0) += 1;
    }

    let mut ans = "YES";
    for (k, v_t) in &t_cnt {
        match d_cnt.get(k) {
            Some(v_d) => {
                if v_d < v_t {
                    ans = "NO";
                }
            }
            None => ans = "NO",
        }
    }
    println!("{}", ans);
}


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

#include <iostream>
#include <fstream>

#include <bits/stdc++.h>

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

using namespace std;

typedef pair<int, int> P;

class ACirclePond {
public:
    void solve(std::istream& cin, std::ostream& cout) {
        double r;
        cin >> r;
        fcout << 2 * r * 3.14159 << endl;
    }
};


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

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


Measured memory_bytes: 3820
class UnionFind():
    def __init__(self, n):
        self.n = n
        self.parents = [-1] * n

    def find(self, x):
        if self.parents[x] < 0:
            return x
        else:
            self.parents[x] = self.find(self.parents[x])
            return self.parents[x]

    def union(self, x, y):
        x = self.find(x)
        y = self.find(y)

        if x == y:
            return

        if self.parents[x] > self.parents[y]:
            x, y = y, x

        self.parents[x] += self.parents[y]
        self.parents[y] = x

    def size(self, x):
        return -self.parents[self.find(x)]

    def same(self, x, y):
        return self.find(x) == self.find(y)

    def members(self, x):
        root = self.find(x)
        return [i for i in range(self.n) if self.find(i) == root]

    def roots(self):
        return [i for i, x in enumerate(self.parents) if x < 0]

    def group_count(self):
        return len(self.roots())

    def all_group_members(self):
        return {r: self.members(r) for r in self.roots()}

    def __str__(self):
        return '\n'.join('{}: {}'.format(r, self.members(r)) for r in self.roots())

N,K,L = list(map(int,input().split()))
Network1 = UnionFind(N)  #道路
Network2 = UnionFind(N)  #鉄道

for i in range(K):
    p,q = list(map(int,input().split()))
    Network1.union(p-1,q-1)  #道路のペアを結合
for i in range(L):
    r,s = list(map(int,input().split()))
    Network2.union(r-1,s-1)  #鉄道のペアを結合

dam=[0]*N  #道路でのグループ_鉄道でのグループ
D = {}
for i in range(N):   #都市0~N-1がNetwork1,2で共に同じグループにいる都市の数見ていくよ
    X = Network1.find(i)  #道路グループでのiの所属
    Y = Network2.find(i)  #道路グループでのiの所属
    dam[i] = str(X) + "_" + str(Y)  #damに保存
    D[str(X) + "_" + str(Y)] = D.get(str(X) + "_" + str(Y), 0) + 1 #DにX_Yがあったらvalueに1足してD[X_Y]の辞書に追加     なかったら0をたす(何もしない)
    #都市  道路でのグループ  鉄道でのグループを調べていき、同じX_Yの個数をDに保存

out=[]
for i in range(N):
    out.append(D[dam[i]])  #都市iはX_Yであり、そのような歳が全部でいくつあるか

print(*out)

Measured memory_bytes: 153076
import sys,math
from collections import deque,defaultdict
import operator as op
from functools import reduce

sys.setrecursionlimit(10**6) 

I=sys.stdin.readline

 #s="abcdefghijklmnopqrstuvwxyz"

"""
x_move=[-1,0,1,0,-1,1,1,-1]
y_move=[0,1,0,-1,1,1,-1,-1]
"""
def ii():
	return int(I().strip())
def li():
	return list(map(int,I().strip().split()))
def mi():
	return map(int,I().strip().split())

def ncr(n, r):
    r = min(r, n-r)
    numer = reduce(op.mul, range(n, n-r, -1), 1)
    denom = reduce(op.mul, range(1, r+1), 1)
    return numer // denom

def gcd(x, y):
    while y:
        x, y = y, x % y
    return x

def find(a,par):
	while par[a]>0:
		a=par[a]
	return a




def union(u,v,par,size):
	a=find(u,par)
	b=find(v,par)
	if a!=b:
		if size[a]>=size[b]:
			size[a]+=size[b]
			par[b]=a
		else:
			size[b]+=size[a]
			par[a]=b




	
def main():
	n,m=mi()
	ans=0
	d=defaultdict(int)
	size=[1]*(n+1)
	par=[-1]*(n+1)
	for i in range(m):
		a,b=mi()
		union(a,b,par,size)
		
	#print(grp)
	print(max(size))




			


	

























	
	
	





if __name__ == '__main__':
	main()

Measured memory_bytes: 16344
#include<iostream>
#include<cstdio>
#include<cstring>
#include<cmath>
#include<algorithm>
#include<map>
#include<set>
#include<vector>
#include<queue>
#include<list>
#include<stack>
#include<ctime>
#include<bitset>
//#include<unordered_map>
using namespace std;
#define ll long long
#define dd cout<<endl
const long long int inf = 1e18+7;
const int mod = 1e9+7;

inline ll max(ll a,ll b) { return a>b?a:b; }
inline ll min(ll a,ll b) { return a<b?a:b; }
inline ll abs1(ll a) { return a>0?a:-a; }

//const int maxn=
ll dp[2005];

int main()
{
	ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);
	
	dp[0]=1;
	dp[1]=1;
	dp[2]=1;
	for(int i=3;i<=2000;i++)
		dp[i]=(dp[i-1]+dp[i-3])%mod;
	
	int s;
	while(cin>>s)
	{
		if(s<3)
			cout<<0<<endl;
		else
			cout<<dp[s-3]<<endl;
	}
	
	return 0;
}

Measured memory_bytes: 3676
#!/usr/bin/ruby
# encoding: utf-8

S = gets.chomp
n = S.size

bin0 = Array.new(n) # 0 start 
bin1 = Array.new(n) # 1 start

# 0101...と1010... を作る。
(0..n-1).each do |i|
  if i%2 == 0 then 
    bin0[i] = 0
    bin1[i] = 1
  else
    bin0[i] = 1
    bin1[i] = 0
  end
end

ans0 = 0
ans1 = 0

(0..n-1).each do |i|
  if S[i].to_i != bin0[i] then # to_i を入れること！！！
    ans0 += 1
  end
  if S[i].to_i != bin1[i] then
    ans1 += 1
  end 
end 

puts [ans0,ans1].min



Measured memory_bytes: 5628
#include <bits/stdc++.h>
 
#define forn(i, n) for (llong i = 0ll; i < (llong) n; ++i)
#define fornn(i, l, r) for (llong i = (llong) l; i < (llong) r; ++i)
#define size(x) ((int) (x.size()))
 
using namespace std;
 
typedef long long llong;
const llong inf = (llong) 1e+9 + 7ll;
const llong linf = (llong) 1e+18 + 7ll;
const long double eps = (long double) 1e-9;
const long double pi = acosl((long double) -1.0);
const int alph = 26;

mt19937 mrand(random_device{} ()); 

template<typename T, typename U> inline llong umin(const T& a, const U& b) { return a < b ? a : b; }
template<typename T, typename U> inline llong umax(const T& a, const U& b) { return a > b ? a : b; }
 
static char buff[(int) 2e6 + 17]; // reads std::string
const int maxn = (int) 2e3 + 17;

int n, a, b, c, d;
llong R[maxn];
llong binomial[maxn][maxn], dp[maxn][maxn];

bool read()
{
	if (scanf("%d", &n) != 1)
		return false;

	scanf("%d %d %d %d", &a, &b, &c, &d);

	return true;
}

llong binpow(llong a, int b)
{
	llong res = 1ll;

	for (; b > 0; b >>= 1, a = a * a % inf)
		if (b & 1) res = res * a % inf;

	return res;
}

void solve()
{
	binomial[0][0] = 1;

	for (int i = 1; i <= n; ++i)
	{
		binomial[i][0] = 1;

		for (int j = 1; j <= i; ++j)
		{
			binomial[i][j] = binomial[i - 1][j - 1] + binomial[i - 1][j];
			
			if (binomial[i][j] >= inf)
				binomial[i][j] -= inf;
		}
	}

	llong f = 1;
	R[0] = binpow(f, inf - 2);

	forn (i, n)
	{
		f *= i + 1;
		f %= inf;
		R[i + 1] = binpow(f, inf - 2);
	}

	forn (i, n + 1)
		dp[0][i] = 1ll;

	for (int i = 1; i <= n; ++i)
	{
		for (int len = a; len <= b; ++len)
		{
			int nn = n - i;
			llong cur = 1ll;

			for (int cnt = 1; cnt < c && nn + len <= n; ++cnt, nn += len)
			{
				cur *= binomial[nn + len][len];
				cur %= inf;
			}

			for (int cnt = c; cnt <= d && i - len * cnt >= 0; ++cnt, nn += len)
			{
				cur *= binomial[nn + len][len];
				cur %= inf;
				dp[i][len] += (cur * dp[i - len * cnt][len - 1] % inf) * R[cnt];
				dp[i][len] %= inf;
			}
		}

		for (int j = 1; j <= n; ++j)
		{
			dp[i][j] += dp[i][j - 1];

			if (dp[i][j] >= inf)
				dp[i][j] -= inf;
		}
	}

	printf("%lld\n", dp[n][n]);
}

int main()
{
#if SEREZHKA
	freopen("file.in", "r", stdin);
#endif

	while (read())
		solve();

	return 0;
}


Measured memory_bytes: 34560
#include<bits/stdc++.h>
using namespace std;
#ifdef LOCAL_DEBUG
  #include "LOCAL_DEBUG.hpp"
#endif
#define int long long
const int INF = 1LL << 60;

struct UF{
  vector<int> par; //親
  vector<int> size; //集合の大きさ

  void init(int n){
    par.resize(n);
    size.resize(n);
    for(int i = 0; i < n; i++){
      par[i] = i;
      size[i] = 1;
    }
  }

  //木の根を求める
  int root(int x){
    if(par[x] == x){
      return x;
    }
    else {
      return par[x] = root(par[x]);
    }
  }

  //xとyの属する集合を併合
  void unite(int x,int y){
    x = root(x);
    y = root(y);
    if(x == y) return;

    if(size[x] < size[y]) swap(x,y);
    par[y] = x;
    size[x] += size[y];
  }

}uf;

struct edge{ int u,v,cost; };
vector<edge> es;
int kruskal(){
  sort(es.begin(),es.end(),[&](edge e1, edge e2){
    return e1.cost < e2.cost;
  });
  uf.init(es.size());
  int total = 0;
  for(int i = 0; i < es.size(); i++){
    edge e = es[i];
    if(uf.root(e.u) != uf.root(e.v)){
      total += e.cost;
      uf.unite(e.u,e.v);
    }
  }
  return total;
}

signed main(){

  int n; cin >> n;
  vector<int> x(n), y(n);
  for(int i = 0; i < n; i++){
    cin >> x[i] >> y[i];
  }

  vector<int> order(n);
  iota(order.begin(),order.end(),0);
  sort(order.begin(),order.end(),[&](int i, int j){
    return x[i] < x[j];
  });
  for(int i = 0; i < n-1; i++){
    int u = order[i], v = order[i+1];
    es.push_back({u, v, x[v] - x[u]});
  }

  sort(order.begin(),order.end(),[&](int i, int j){
    return y[i] < y[j];
  });
  for(int i = 0; i < n-1; i++){
    int u = order[i], v = order[i+1];
    es.push_back({u, v, y[v] - y[u]});
  }

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

  return 0;
}


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

#define INF 1.1e9
#define LINF 1.1e18
#define FOR(i,a,b) for (int i=(a);i<(b);++i)
#define REP(i,n) FOR(i,0,n)
#define ALL(v) (v).begin(),(v).end()
#define pb push_back
#define pf push_front
#define fi first
#define se second
#define BIT(x,n) bitset<n>(x)
#define PI 3.14159265358979323846

typedef long long ll;
typedef pair<int,int> P;
typedef pair<int,P> PP;

struct edge {
	int to, cost;
	edge(int t,int c):to(t),cost(c) {}
};
int dx[]={1,-1,0,0},dy[]={0,0,1,-1};

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

int X,A[100000],R[100000],T[100000];
int K,Q;
int dir=-1,l,u,m;
int t,dif,j;

void calc(int tmp) {
	t+=abs(tmp),dif+=tmp;
	l=max(0,min(X,l+tmp));
	u=max(0,min(X,u+tmp));
}

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

	cin>>X>>K;
	REP(i,K) cin>>R[i];
	cin>>Q;
	REP(i,Q) cin>>T[i]>>A[i];

	u=X;
	REP(i,Q) {
		while(j<K&&R[j]<T[i]) calc((R[j++]-t)*dir),dir=-dir;
		calc((T[i]-t)*dir);
		cout<<max(l,min(u,A[i]+dif))<<endl;
	}

	return 0;
}


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

int main(){
  long long int n,a,b;
  cin>>n>>a>>b;
  if(b<a){
    cout<<0<<endl;
    return 0;
  }
  if(n==1){
    cout<<(a==b)<<endl;
    return 0;
  }
  if(n==2){
    cout<<1<<endl;
    return 0;
  }
  long long int sup=(n-1)*b+a;
  long long int inf=(n-1)*a+b;
  cout<<sup-inf+1<<endl;
  return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
  
#define ll long long
#define all(aaa) aaa.begin(), aaa.end()

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);

    double l;
    cin >> l;

    l /= 3;

    cout << fixed << setprecision(10) << l * l * l;

    return 0;   
}   

Measured memory_bytes: 256
#include<iostream> 
#include<string>
#include<queue>
#include<algorithm> 
#include<cstdio>              
#include<vector>
#include<stack>
#include<map>
#include<iterator>
#include<cstdlib>
#include<cmath>
using namespace std; 
#define MAX 100000
#define SENTINEL 2000000000

int A[MAX],n;

int partition(int p,int r)
{
	int x,i,j,t;
	x = A[r];
	i = p-1;
	for(j=p;j<r;j++)
	{
		if(A[j]<=x)
		{
			i++;
			t = A[i];A[i] = A[j];A[j] = t;
		}
	}
	t = A[i+1];A[i+1] = A[r];A[r] = t;
	return i+1;
}

int main()
{
	int i,q;
	scanf("%d",&n);
	for(i=0;i<n;i++) scanf("%d",&A[i]);
	
	q = partition(0,n-1);
	for(i=0;i<n;i++)
	{
		if(i) printf(" ");
		if(i==q)printf("[");
		printf("%d",A[i]);
		if(i==q)printf("]");
	}
	printf("\n");
	
	return 0;
}

Measured memory_bytes: 1580
#include <stdio.h>

int main(void)
{
	int a, b, n, s, i;
	
	while (scanf("%d %d %d", &a, &b, &n) != EOF){
		s = 0;
		
		for (i = 0; i < n; i++){
			a *= 10;
			s += (a / b) % 10;
			a %= b;
		}
		
		printf("%d\n", s);
	}
	
	return (0);
}

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

const long INF = 1L << 60;

int a[200010];

int main(){
	int n;
	scanf("%d", &n);
	long sum = 0;
	for(int i = 0; i < n; i++) {
		scanf("%d", a + i);
		sum += a[i];
	}
	long ans = INF, temp = 0;
	for(int i = 0; i < n - 1; i++) {
		temp += a[i];
		ans = min(ans, abs(2 * temp - sum));
	}
	printf("%ld\n", ans);
}


Measured memory_bytes: 1024
N = int(input())
S = input()

count = 0
count_list = [0]
for i in S:
    if i == 'I':
        count += 1
        count_list.append(count)
    elif i == 'D':
        count -= 1
    else:
        print('Error')
    
print(max(count_list))


Measured memory_bytes: 2940
#include <iostream>
#include <stack>
#include <string>
#include <cstring>
#include <cstdlib>
  
using namespace std;
stack<long> s;
int main(){
    string str;
    while (cin >> str){
        if (str[0] == '+' || str[0] == '-' || str[0] == '*'){
            char ch; ch = str[0];
            long b = s.top(); s.pop();
            long a = s.top(); s.pop();
            if (ch == '+') s.push(a + b);
            else if (ch == '-') s.push(a - b);
            else if (ch == '*') s.push(a*b);
        }
        else {
            long tmp = atoi(str.c_str());
            s.push(tmp);
        }
    }
    cout << s.top() << '\n';
}

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

using namespace std;

void solve(void)
{
	int m, k;
	cin >> m >> k;
	if (k == 0)
	{
		for (int i = 0; i < 1 << m; i++)
		{
			cout << i << ' ' << i << ' ';
		}
		cout << endl;
		return;
	}
	if (m == 1)
	{
		cout << -1 << endl;
		return;
	}
	vector<int> a, b;
	int maska = 0, maskb = 0;
	for (int i = 0; i < 1 << m; i++)
	{
		if (__builtin_popcount(i) == 1 && k & i)
		{
			a.push_back(i);
			maska ^= i;
		}
		else
		{
			b.push_back(i);
			maskb ^= i;
		}
	}
	//cout << maska << ' ' << maskb << endl;
	if (maska != maskb || maska != k)
	{
		cout << -1 << endl;
		return;
	}
	for (int x : a)
	{
		cout << x << ' ';
	}
	for (int x : b)
	{
		cout << x << ' ';
	}
	reverse(a.begin(), a.end());
	reverse(b.begin(), b.end());
	for (int x : a)
	{
		cout << x << ' ';
	}
	for (int x : b)
	{
		cout << x << ' ';
	}
}

int main()
{
	solve();
	//cout << "yui(*-v・)yui" << endl;
	return 0;
}


Measured memory_bytes: 2424
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0; i<n; i++)
#define PI 3.14159265359
#define INF 1000100100000000000
#define MOD 1000000007
#define all(x) (x).begin(),(x).end()
typedef long long ll;
#define P pair<int, int>
#define PP pair<P,P>
#define T tuple<int,int,int> 
using namespace std;

int main(){
   string s; cin >> s;
   int ans=0; int tmp=0;
   rep(i,3){
       if(s[i]=='R') tmp++;
       else{
        ans=max(ans,tmp);
        tmp=0;
       }
   }
   ans=max(ans,tmp);
   cout << ans << endl;
return 0;
}

Measured memory_bytes: 3564
#pragma comment(linker, "/STACK:102400000,102400000")
#include <map>
#include <set>
#include <stack>
#include <queue>
#include <cmath>
#include <string>
#include <vector>
#include <cstdio>
#include <cctype>
#include <cstring>
#include <sstream>
#include <cstdlib>
#include <iostream>
#include <algorithm>
#define lson root<<1,l,mid
#define rson root<<1|1,mid+1,r
#define Key_Value ch[ch[root][1]][0]
#define DBN1(a)           cerr<<#a<<"="<<(a)<<"\n"
#define DBN2(a,b)         cerr<<#a<<"="<<(a)<<", "<<#b<<"="<<(b)<<"\n"
#define DBN3(a,b,c)       cerr<<#a<<"="<<(a)<<", "<<#b<<"="<<(b)<<", "<<#c<<"="<<(c)<<"\n"
#define DBN4(a,b,c,d)     cerr<<#a<<"="<<(a)<<", "<<#b<<"="<<(b)<<", "<<#c<<"="<<(c)<<", "<<#d<<"="<<(d)<<"\n"
#define DBN5(a,b,c,d,e)   cerr<<#a<<"="<<(a)<<", "<<#b<<"="<<(b)<<", "<<#c<<"="<<(c)<<", "<<#d<<"="<<(d)<<", "<<#e<<"="<<(e)<<"\n"
#define DBN6(a,b,c,d,e,f) cerr<<#a<<"="<<(a)<<", "<<#b<<"="<<(b)<<", "<<#c<<"="<<(c)<<", "<<#d<<"="<<(d)<<", "<<#e<<"="<<(e)<<", "<<#f<<"="<<(f)<<"\n"
#define clr(a,x) memset(a,x,sizeof(a))
using namespace std;
typedef long long ll;
const int maxn=500000+5;
const int INF=0x3f3f3f3f;
const int P=1000000007;
const double PI=acos(-1.0);
template<typename T>
inline T read(T&x){
    x=0;int _f=0;char ch=getchar();
    while(ch<'0'||ch>'9')_f|=(ch=='-'),ch=getchar();
    while(ch>='0'&&ch<='9')x=x*10+ch-'0',ch=getchar();
    return x=_f?-x:x;
}
string s,t,ans="";
int main(){
    cin>>s>>t;
    int pos=-1;
    for (int i=0;i<(int)s.length();i++){
        if (i+t.length()>s.length()) break;
        bool flag=true;
        int x=i;
        for (int j=0;j<(int)t.length();j++,x++){
            if (s[x]!=t[j] && s[x]!='?'){
                flag=false;
                break;
            }
        }
        string xx="";
        if (flag){
            for (int j=0;j<i;j++){
                if (s[j]=='?') xx=xx+'a';
                else xx=xx+s[j];
            }
            xx=xx+t;
            for (int j=i+t.length();j<(int)s.length();j++){
                if (s[j]=='?') xx=xx+'a';
                else xx=xx+s[j];
            }
            if (pos==-1){
                pos=1;
                ans=xx;
            }
            else{
                if (ans>xx) ans=xx;
            }
        }
    }
    if (pos==-1) puts("UNRESTORABLE");
    else cout<<ans<<endl;
    return 0;
}


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

int a[3][3];
bool ans[3][3];

int main()
{
    rep(i, 3) rep(j, 3) cin >> a[i][j];
    int n;
    cin >> n;
    rep(i, n)
    {
        int x;
        cin >> x;
        rep(j, 3)
        {
            rep(k, 3)
            {
                if (a[j][k] == x)
                {
                    ans[j][k] = true;
                }
            }
        }
    }

    bool ok = false;
    rep(i, 3)
    {
        int count = 0;
        rep(j, 3)
        {
            if (ans[i][j])
            {
                count++;
            }
        }
        if (count == 3)
        {
            ok = true;
            break;
        }
    }

    rep(i, 3)
    {
        int count = 0;
        rep(j, 3)
        {
            if (ans[j][i])
            {
                count++;
            }
        }
        if (count == 3)
        {
            ok = true;
            break;
        }
    }

    if (ans[0][0] && ans[1][1] && ans[2][2])
    {
        ok = true;
    }
    if (ans[0][2] && ans[1][1] && ans[2][0])
    {
        ok = true;
    }
    if (ok)
    {
        cout << "Yes" << endl;
    }
    else
    {
        cout << "No" << endl;
    }

    return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main()
{
  int n,a,b,c,d,i,j,k;
  int cnt =0 ;
  cin>>n>>a>>b>>c>>d;
  string s;
  cin>>s;
  
  if(c<d)
  {
      for(i=a;i<c-1;i++)
      {
          if(s[i]=='#' && s[i+1]=='#')
          {
              cout<<"No";
              return 0;
          }
      }
      for(i=b;i<d-1;i++)
      {
       if(s[i]=='#' && s[i+1]=='#')
          {
              cout<<"No";
              return 0;
          }   
      }
  }

  else
  {
      for(i=a;i<c-1;i++)
      {
         if(s[i]=='#' && s[i+1]=='#')
          {
              cout<<"No";
              return 0;
          }
      }
      int f=0;
      for(i=b-2;i<d-1;i++)
      {
          if(s[i]=='.' && s[i+1]=='.' && s[i+2]=='.')
          {
              f=1;
              break;
          }
      }
      if(f==0)
      {
         cout<<"No";
         return 0; 
      }
  }
  cout<<"Yes";
  
  return 0;
}

Measured memory_bytes: 640
# -*- coding: utf-8 -*-
def main():
    N = int(input())
    A = list(map(int, input().split()))
    cnt = 0
    for i in range(1, N+1, 2):
        if A[i-1] % 2 == 1:
            cnt += 1
    print(cnt)

    return
if __name__ == '__main__':
    main()

Measured memory_bytes: 9056
#include<bits/stdc++.h>
using namespace std;
int n,m;
vector<vector<int> > G(100005);
vector<int> vis(100005);
vector<int> good(100005, 1);

vector<int> h(100005);

void bfs(int x){

    queue<int> q;
    q.push(x);
    vis[x] = 1;

    while(!q.empty()){
        int u = q.front();
        q.pop();
        for(int i=0; i<G[u].size(); i++){
            int v = G[u][i];
            if(h[v] >= h[u]){
                good[u] = 0;
            }
            if(!vis[v]){
                vis[v] = 1;
                q.push(v);
            }
        }
    }
}

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

    for(int i=1; i<=n; i++){
        cin>>h[i];
    }

    for(int i=1; i<=m; i++){
        int x,y;
        cin>>x>>y;
        G[x].push_back(y);
        G[y].push_back(x);
    }

    for(int i=1; i<=n; i++){
        if(!vis[i]){
            bfs(i);
        }
    }

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

}


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

int main(){
  string s;
  cin>>s;
  
  if (s=="abc" or s=="acb" or s=="bac" or s=="bca" or s=="cab" or s=="cba"){
    cout<<"Yes"<<endl;
  }
  
  else {
    cout<<"No"<<endl;
  }
  
  
}

  













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

int main()
{
	while (true)
	{
		int n, x;
		cin >> n >> x;
		if (n == x && x == 0)
		{
			return 0;
		}
		int ans = 0;
		for (int i = 1; i < n + 1; i++)
		{
			for (int j = i + 1; j < n + 1; j++)
			{
				for (int k = j + 1; k < n + 1; k++)
				{
					if (i + j + k == x)
					{
						ans++;
					}
				}
			}
		}
		cout << ans << endl;
	}

	return 0;
}

Measured memory_bytes: 3072
#include <stdio.h>
#include <string.h>

#define M 1046257
#define NIL (-1)
#define L 14

char H[M][L];

int getChar(char ch) {
  if ( ch == 'A' ) return 1;
  else if ( ch == 'C' ) return 2;
  else if ( ch == 'G' ) return 3;
  else if ( ch == 'T' ) return 4;
  return 0;
}

long long getKey(char str[]) {
  long long sum =0, p = 1, i;
  for(i=0;i<strlen(str);i++) {
    sum += p*(getChar(str[i]));
    p*= 5;
  }
  return sum;
}

int h1(int key){ return key % M; }
int h2(int key){ return 1 + (key % (M-1)); }

int find(char str[]) {
  long long key, i, h;
  key = getKey(str); 
  for(i=0; ;i++) {
    h = (h1(key) + i*h2(key)) %M;
    if( strcmp(H[h],str) == 0) return 1;
    else if ( strlen(H[h]) == 0 ) return 0;
  }
  return 0;
}

int insert(char str[]) {
  long long key, i, h;
  key = getKey(str); 
  for(i=0; ; i++) {
    h = (h1(key) + i * h2(key)) %M;
    if(strcmp(H[h],str) == 0) return 1;
    else if(strlen(H[h]) == 0) {
      strcpy(H[h],str);
      return 0;
    }
  }
  return 0;
}

int main(void) {
  int i, n;
  char str[L], com[9];
  for(i=0;i<M;i++) H[i][0] = '\0';
  scanf("%d",&n);
  for(i=0;i<n;i++) {
    scanf("%s %s",com,str); 
    if(com[0] == 'i') {
      insert(str);
    } else {
      if(find(str)){
        printf("yes\n");
      } else {
        printf("no\n");
      }
    }
  }
  return 0;
}


Measured memory_bytes: 16096
import java.io.PrintStream;
import java.util.Scanner;

public class Main {
	public static void main(String[] args) throws Exception{
		new Main(new Scanner(System.in), System.out, System.err).exec();
	}
	private final Scanner sc;
	private final PrintStream out, err;
	public Main(final Scanner sc, final PrintStream out, final PrintStream err) {
		this.sc = sc;
		this.out = out;
		this.err = err;
	}

	public void exec() throws Exception{
		final int N = sc.nextInt();
		String S = sc.next();

		int sum = 0;
		char last = S.charAt(0);
		for(int i=1;i<N;i++) {
			char next = S.charAt(i);
			if(last != next) {
				last = next;
				sum++;
			}
		}
		sum++;
		out.println(sum);
	}
}


Measured memory_bytes: 26412
#include <stdio.h>


int comp(int x,int y){
  if(x>y){
    return y;
  }else{
    return x;
  }
  return 0;
}
int main(){
  int n;
  int sum=0;
  scanf("%d",&n);
  int a[n+1];
  int b[n];
  b[0]=0;
  int i;
  for(i=1;i<n;i++){
    scanf("%d",&b[i]);
  }
  a[1]=b[1];
  a[n]=b[n-1];
  sum=sum+a[1]+a[n];
  for(i=1;i<n-1;i++){
    a[i+1]=comp(b[i+1],b[i]);
    sum+=a[i+1];
  }
  printf("%d",sum);
}


Measured memory_bytes: 128
import java.util.*;

class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int N = sc.nextInt();
    int H[] = new int[N];
    for(int i=0; i < N; i++) H[i] = sc.nextInt();
    int ans = H[0] + H[N-1];
    for(int i=1; i<N; i++)
      ans += Math.abs(H[i-1]-H[i]);
    System.out.println(ans/2);
  }
}

Measured memory_bytes: 21844
import java.util.Scanner;

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

		String s = sc.next();
		s = s.replaceAll("eraser", "").replaceAll("erase", "").replaceAll("dreamer", "").replaceAll("dream", "");
		System.out.println(s.length() == 0 ? "YES" : "NO");
	}
}


Measured memory_bytes: 33260
import java.util.*;

public class Main {

	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int N = scan.nextInt();
		int L = scan.nextInt();

		int[] t = new int[N];
		
		int select = 0;
		int tmp = 300;
		for(int i = 0; i < N; i++) {
			t[i] = L + i;
			int val = Math.abs(t[i]);
			if(tmp > val) {
				select = i;
				tmp = val;
			}
		}
		
		t[select] = 0;
		int ans = 0;
		for(int a: t) {
			ans += a;
		}
		
		System.out.println(ans);
		scan.close();
	}

}


Measured memory_bytes: 23252
#include<stdio.h>

int main(){

  int n,m,x;
  int i,j,cnt=0,flag;
  int left,mid,right;
  
  scanf("%d",&n);

  int S[n];

  for(i=0;i<n;i++){
    scanf("%d",&S[i]);
  }

  scanf("%d",&m);

  int T[m];

  for(i=0;i<m;i++){
    scanf("%d",&T[i]);
  }
  
  for(i=0;i<m;i++){
    left = 0;
    right = n;

    while(left<right){
      mid = (left + right) / 2;
      
      if(T[i]==S[mid]){
	cnt++;
	break;
      }else if(T[i]>S[mid]){
	left = mid + 1;
      }else{
	right = mid;
      }
    }
  }

  printf("%d\n",cnt);
  
  return 0;
}



Measured memory_bytes: 2312
num_list = []
num_list.append(int(input()))
num_list.append(int(input()))
num_list.append(int(input()))
num_list.append(int(input()))
num_list.append(int(input()))
minutes = 0
dist_10 = 0
min_dist_10 = 0
min_list_num = 0
for _ in range(5):
    minutes += min_dist_10
    min_dist_10 = 10
    for i in range(len(num_list)):
        num = num_list[i] + minutes
        dist_10 = 10-int((str(num)[-1:]))
        if (str(num)[-1:]) == "0":
            min_dist_10 = 0
            min_list_num = i
            break
        if min_dist_10 > dist_10:
            min_dist_10 = dist_10
            min_list_num = i
    minutes += int(num_list.pop(min_list_num))
print(minutes)


Measured memory_bytes: 3064
#include<bits/stdc++.h>
#include <cassert>
#include <algorithm>
#include <functional>
using namespace std;

int main(){
int n,k,b,c;
cin>>n>>k;
int ans;
b=n/k;
c=n%k;
ans=(b+c)-b;
cout<<ans<<endl;
}

Measured memory_bytes: 256
a, b, c, x = map(int, [input() for i in range(4)])
ans = 0
for i in range(a+1):
    for j in range(b+1):
        for k in range(c+1):
            if i * 500 + j * 100 + k * 50 == x:
                ans += 1
print(ans)


Measured memory_bytes: 3064