akhauriyash/Code-Regression huggingface dataset:
# -*- coding: utf-8 -*-
"""
D - Water Bottle
https://atcoder.jp/contests/abc144/tasks/abc144_d

"""
import sys


from math import tan, radians, pi

def is_ok(a, b, x, d):
    if b * tan(pi/2 - radians(d)) <= a:
        return (b * b * tan(pi/2 - radians(d)) * a) / 2 >= x
    else:
        return a * a * (b - a * tan(radians(d))) + (a * a * a * tan(radians(d))) / 2 >= x


def solve(a, b, x):
    lb, ub = 0.0, 90.0
    for _ in range(100):
        mid = (lb + ub) / 2
        if is_ok(a, b, x, mid):
            lb = mid
        else:
            ub = mid
    return (lb + mid) / 2


def main(args):
    a, b, x = map(int, input().split())
    ans = solve(a, b, x)
    print(ans)


if __name__ == '__main__':
    main(sys.argv[1:])


Measured memory_bytes: 3828
#include <bits/stdc++.h> //Andrei Alexandru a.k.a Sho10
#define ll long long
#pragma GCC optimize("O3")
#pragma GCC optimize("Ofast")
#define all(a) (a).begin(), (a).end()
#define sz size
#define f first
#define s second
#define pb push_back
#define er erase
#define in insert
#define mp make_pair
#define pi pair
#define rc(s) return cout<<s,0
#define endl '\n'
#define mod 1000000007
#define PI 3.14159265359
#define CODE_START  ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
using namespace std;
ll n;
string s;
int32_t main(){
CODE_START;
cin>>s;
if(s[s.size()-1]=='2'||s[s.size()-1]=='4'||s[s.size()-1]=='5'||s[s.size()-1]=='7'||s[s.size()-1]=='9'){
    cout<<"hon"<<endl;
}else if(s[s.size()-1]=='0'||s[s.size()-1]=='1'||s[s.size()-1]=='6'||s[s.size()-1]=='8'){
cout<<"pon"<<endl;
}else cout<<"bon"<<endl;
}




Measured memory_bytes: 3636
#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (int)(n); ++i)
#define rep2(i, s, n) for (int i = (s); i < (int)(n); i++)
using namespace std;
int main(){
  int n;
  cin>>n;
  vector<bool>a(55555,true);
  
  a.at(0)==false;
  a.at(1)==false;
  
  
  rep2(i,2,55555){
    if(a.at(i)){
      for(int j=i*2;j<55555;j+=i){
        a.at(j)=false;
      }
    }
  }
 
  int ex=n;

  
    rep2(i,7,55555){
      if(a.at(i)){
        if(i%5==1){
          cout<<i<<" ";
          ex--;
          if(ex==0){
            break;
          }
        }
      }
    }
  
  
  
}
  





Measured memory_bytes: 256
#pragma GCC optimize "03"
#include <bits/stdc++.h>
using namespace std;
 
#define ll long long int
#define ld long double
#define pi pair<int, int>
#define pb push_back
#define fi first
#define se second
#define IOS ios::sync_with_stdio(false); cin.tie(0); cout.tie(0)
#ifndef LOCAL
#define endl '\n'
#endif

const int N = 1e5 + 5;
const int mod = 1e9 + 7;
const int inf = 1e9 + 9;

signed main() {
	#ifdef LOCAL
		freopen("input.txt","r",stdin);
		freopen("output.txt","w",stdout);
	#endif
	IOS;
	int a, b;
	cin >> a >> b;
	cout << max({a+b, a-b, a*b});	
	return 0;
}

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

using ll = long long;

using str = string;
using ss = stringstream;

#define MOD 1000000007LL

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

    int n;cin>>n;
    str s;cin>>s;

    int cnt=0;
    vector<int> m(26,0);

    ll ans=1;

    for(int i=0;i<n;i++)m[s[i]-'a']++;
    
    for(int i=0;i<26;i++)
    {
        ans*=m[i]+1;
        ans%=MOD;
    }

    ans--;

    cout<<ans<<"\n";

    return 0;
}


Measured memory_bytes: 3736
#include <bits/stdc++.h>
using ll = long long;
using namespace std;
#define _overload3(_1, _2, _3, name, ...) name
#define _rep(i, n) repi(i, 0, n)
#define repi(i, a, b) for(int i = int(a); i < int(b); ++i)
#define rep(...) _overload3(__VA_ARGS__, repi, _rep, )(__VA_ARGS__)
const long long inf = 1LL << 60;
const int intinf = 1 << 30;
const long long mod = 1e9 + 7;

template <class T> void vecout(T V) {
    auto t = V.begin();
    while(t != V.end()) {
        cout << *t++;
        if(t != V.end())
            cout << " ";
    }
    cout << endl;
};

bool check(vector<int> W, int k, int P) {
    auto t = W.begin();
    int tmp = intinf, count = 0;
    while(t != W.end()) {
        if(tmp + *t <= P) {
            tmp += *t;
        } else {
            tmp = *t;
            count++;
        }
        *t++;
    }
    return count <= k;
}

int main() {
    int n, k, tmp, wmax = 0;
    cin >> n >> k;
    vector<int> W(n);
    rep(i, n) {
        cin >> tmp;
        W[i] = tmp;
        wmax = max(wmax, tmp);
    }

    int ng = wmax - 1;
    int ok = wmax * n;
    int mid;
    while(abs(ok - ng) > 1) {
        mid = (ok + ng) / 2;
        if(check(W, k, mid))
            ok = mid;
        else
            ng = mid;
    }
    cout << ok << endl;
}


Measured memory_bytes: 3664
#include <bits/stdc++.h>
#define F first
#define S second
#define all(a) a.begin(),a.end()
#define setDP(arr) memset(arr,-1,sizeof arr)
#define Clear(arr) memset(arr,0,sizeof arr)
#define oo 2000000000
#define inf 1000000000000000000
#define P1 31
#define P2 37
#define M  1000000007
#define M2 1000000009
#define pii pair<ll,ll>
typedef long long ll;
using namespace std;
const int N = 355001;
const int SQRTN = 320;
const int LOGN = 20;
const long double PI = acos(-1);
const long double TAU = 2*PI;

ll n , a , b , ans;

signed main(){
    cin >> n >> a >> b ;
    if(a>b)return puts("0"),0;
    if(n==1&&(a!=b))return puts("0"),0;
    ans = b*(n-2)-(a*(n-2));
    ans++;
    cout << ans << endl;

}

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

#define ll long long



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

	int n;
	cin >> n;
	int dig = n % 10;
	if (dig == 2 || dig == 4 || dig == 5 ||dig == 7 || dig == 9) cout << "hon\n";
	else if (dig == 3) cout << "bon\n";
	else cout << "pon\n";
	return 0;
}



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

int main(){
  int a,b;
  cin >> a >> b;
  int ans = 1;
  int flag = 0;
  while(ans<1500){
    int cost1 = floor(ans*0.08);
    if(cost1 != a && flag==0){
      ans++;
      continue;
    }
    int cost2 = floor(ans*0.1);
    if(cost2 == b){
      break;
    }
    else{
      ans++;
      continue;
    }
  }
  if(ans==1500) cout << -1 << endl;
  else cout << ans << endl;
  return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define REP(i, n) for(int i = 0; i < n; i++)
#define REPR(i, n) for(int i = n - 1; 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());
 
using ll = long long;
using vll = vector<ll>;
using vvll = vector<vector<ll>>;
using P = pair<ll, ll>;

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

    ll n;
    cin >> n;
    ll a;
    map<ll, ll> mp;
    REP(i, n){
        cin >> a;
        mp[a]++;
    }
    ll ev = 0, res = mp.size();
    for(auto v : mp){
        if(v.second % 2 == 0) ev++;
    }
    if(ev % 2) cout << res - 1 << endl;
    else cout << res << endl;
    return 0;
}

Measured memory_bytes: 6528
#include <iostream>
#include <fstream>
#include <sstream>
#include <string>
#include <cstring>
#include <vector>
#include <set>
#include <map>
#include <unordered_map>
#include <queue>
#include <deque>
#include <stack>
#include <algorithm>
#include <bitset>
#include <cmath>
#include <cstdlib>
#include <ctime>
#include <numeric>
#include <functional>
#include <cctype>
#include <list>
#include <limits>
#include <cassert>
//#include <boost/multiprecision/cpp_int.hpp>

const double EPS = (1e-10);


using namespace std;
using Int = long long;
//using namespace boost::multiprecision;

const Int MOD = 1000000007;

long long mod_pow(long long x, long long n) {
    long long res = 1;
    for(int i = 0;i < 60; i++){
        if(n >> i & 1) res = res * x % MOD;
        x = x * x % MOD;
    }
    return res;
}

template<typename T>
T gcd(T a, T b) {
    return b != 0 ? gcd(b, a % b) : a;
}

template<typename T>
T lcm(T a, T b) {
    return a * b / gcd(a, b);
}

void fast_input() {
    cin.tie(0);
    ios::sync_with_stdio(false);
}

int solve(int R0, int W0, int C, int R) {
    return max((C*(W0)-R0+R-1)/R, 0);
}

int main(void) {
    int R0, W0, C, R;
    vector<int> ans;
    while (1) {
        cin >> R0 >> W0 >> C >> R;
        if (R0+W0+C+R == 0) break;
        ans.push_back(solve(R0, W0, C, R));
    }
    for (int &i : ans) {
        cout << i << endl;
    }
}   



Measured memory_bytes: 3156
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,tune=native")
#pragma GCC optimize("unroll-loops")
#include <bits/stdc++.h>

using namespace std;

#define forn(i, s, f) for (int i = s; i < f; i++)
#define ll long long
#define ull unsigned long long
#define ld long double
#define pii pair <int, int>
#define fs first
#define sc second
#define pb push_back
#define eb emplace_back
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define sz(x) (int)(x).size()

int main() {
    ios_base::sync_with_stdio(0), cin.tie(0);
    int n, m;
    cin >> n >> m;
    vector <vector <int>> a(m);
    forn (i, 0, m) { 
        int k;
        cin >> k;
        a[i].resize(k);
        forn (j, 0, k) 
            cin >> a[i][j], a[i][j]--;
    }
    vector <int> p(m);
    forn (i, 0, m) 
        cin >> p[i];
    int ans = 0;
    forn (mask, 0, 1 << n) {
        bool ok = 1;
        forn (i, 0, m) {
            int s = 0;
            forn (j, 0, sz(a[i])) 
                s += (mask >> a[i][j]);
            if (s % 2 != p[i] % 2) 
                ok = 0;
        }
        if (ok)
            ans++;
    }
    cout << ans;
    return 0;
}

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

using namespace std;

using ll = long long;
using ld = long double;

using vi = vector<int>;
using vvi = vector<vi>;
using vvvi = vector<vvi>;
using vl = vector<ll>;
using vvl = vector<vl>;
using vvvl = vector<vvl>;
using vd = vector<double>;
using vvd = vector<vd>;
using vb = vector<bool>;
using vvb = vector<vb>;
using vs = vector<string>;

const int INF = (1 << 30) - 1;
const ll INF64 = ((ll)1 << 62) - 1;
const double PI = 3.1415926535897932384626433832795;

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

int gcd(int x, int y) { return y ? gcd(y, x % y) : x; }
ll gcd(ll x, ll y) { return y ? gcd(y, x % y) : x; }
int lcm(int x, int y) { return x / gcd(x, y) * y; }
ll lcm(ll x, ll y) { return x / gcd(x, y) * y; }

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

	ll n, m;
	cin >> n >> m;
	vector<ll>v(n + 1), w(n + 1);
	for (int i = 1; i <= n; i++) {
		cin >> v[i] >> w[i];
	}

	vector<vector<ll>> dp(n + 1, vector<ll>(m + 1));
	for (int i = 1; i <= n; i++) {
		for (int j = 1; j <= m; j++) {
			if (j >= w[i]) {
				dp[i][j] = max(dp[i - 1][j], dp[i - 1][j - w[i]] + v[i]);
			} else {
				dp[i][j] = dp[i - 1][j];
			}
		}
	}

	cout << dp[n][m] << endl;
	return 0;
}



Measured memory_bytes: 10788
#include <bits/stdc++.h>
#define rep(i,n) for(int i = 0; i < (int)(n); i++)
#define fi first
#define se second
#define pb push_back
#define eb emplace_back
#define sz(x) (int)(x).size()
using namespace std;
using ll = long long;
using P = pair<int, int>;
using vi = vector<int>;
using vc = vector<char>;
using vb = vector<bool>;
using vs = vector<string>;
using vll = vector<long long>;
using vp = vector<pair<int, int>>;
using vvi = vector<vector<int>>;
using vvc = vector<vector<char>>;
using vvll = vector<vector<long long>>;
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 (b<a) {a=b; return 1;} return 0;}

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    
    string s;
    cin >> s;
    rep(bit, 1<<3) {
        int ans = s[0] - '0';
        string t = "";
        t += s[0];
        rep(i, 3) {
            if (bit>>i&1) {
                ans += s[i+1] - '0';
                t += '+';
                t += s[i+1];
            } else {
                ans -= s[i+1] - '0';
                t += '-';
                t += s[i+1];
            }
        }
        if (ans == 7) {
            t += "=7";
            cout << t << endl;
            return 0;
        }
    }
}

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

using namespace std;
#define PI 3.14159265359
#define eps 1e-7
#define mp make_pair
#define pb push_back
#define FOR(i,a,b) for(int i=a;i<b;i++)
#define FORN(i,a,b) for(int i=a;i<=b;i++)
const int INF = 1<<29;
typedef unsigned long long ll;
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

int n,x;

int main(){
	ios_base::sync_with_stdio(false); //Fast I/O
	cin.tie(NULL);
	//freopen("input.txt","r",stdin);
	//freopen("output.txt","w",stdout);	

    cin >> n >> x;
    int c=0;

    while(n--){
        int a;
        cin >> a;
        a-=x;
        a=abs(a);

        c=__gcd(c,a);
    }

    cout << c << endl;

	return 0;
}


Measured memory_bytes: 256
"""
# 標準入力取得
## 文字列
 = sys.stdin.readline().rstrip()
 = list(sys.stdin.readline().rstrip())

## 数値
 = int(sys.stdin.readline())
 = map(int, sys.stdin.readline().split())
 = list(map(int, sys.stdin.readline().split()))
 = [list(map(int,list(sys.stdin.readline().split()))) for i in range(h)]  # 二次元配列入力　二次元マップみたいな入力のとき

# 0埋め, 小数点出力桁指定時のときの出力
a = 100
b = 0.987654321
print("{0:06d}-{1:6f}".format(a,b))
000100-0.987654

# 文字列をリストに格納
char_list = list("abcd") # ["a","b","c","d"]
"""

import math
import sys
import itertools
import queue
from fractions import gcd

def lcm(a, b):
    return a * b // gcd(a, b)

mod = 1000000007

if __name__ == "__main__":
    n = int(sys.stdin.readline())
    v = list(map(int, sys.stdin.readline().split()))
    c = list(map(int, sys.stdin.readline().split()))
    ans = 0
    for i in range(len(v)):
        n = v[i]-c[i]
        if n >0:
            ans += n
    print(ans)

Measured memory_bytes: 5072
#include <algorithm>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <vector>
#include <cstring>

typedef long long ll;
constexpr double PI = 3.141592653589793;
constexpr ll INF = 1e18 + 10;
template <class T>
bool chmax(T &a, const T &b)
{
    if (a < b)
    {
        a = b;
        return 1;
    }
    return 0;
}
template <class T>
bool chmin(T &a, const T &b)
{
    if (b < a)
    {
        a = b;
        return 1;
    }
    return 0;
}

using namespace std;
//    cout << setprecision(20) << ans << "\n";

vector<pair<ll, ll>> primeFactorize(ll N)
{
    vector<pair<ll, ll>> res;
    for (ll a = 2; a * a <= N; ++a)
    {
        if (N % a != 0)
            continue;
        ll ex = 0;

        while (N % a == 0)
        {
            ++ex;
            N /= a;
        }
        res.push_back({a, ex});
    }

    if (N != 1)
        res.push_back({N, 1});
    return res;
}

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

    int a, b;
    string s;
    cin >> a >> b >> s;
    if (s[a] != '-')
    {
        cout << "No"
             << "\n";
        return 0;
    }
    for (int i = 0; i < a + b + 1; i++)
    {
        if (i == a)
        {
            continue;
        }
        int p = s[i] - '0';
        if (p < 0 || 9 < p)
        {
            cout << "No"
                 << "\n";
            return 0;
        }
    }
    cout << "Yes"
         << "\n";

    return 0;
}


Measured memory_bytes: 3660
#include <bits/stdc++.h>
#include <iterator>
#include <set>
using namespace std;
const int Inf = 110000;
int dp[Inf] = {0};

int main(void)
{
    int N;
    cin >> N;
    for (int i = 0; i < Inf; i++) {
	dp[i] = N;
    }
    dp[0] = 0;
    for (int i = 0; i <= N; i++) {
	for (int pow6 = 1; pow6 <= i; pow6 *= 6) {
	    dp[i] = min(dp[i], dp[i - pow6] + 1);
	}
	for(int pow9=1;pow9<=i;pow9*=9){
	dp[i]=min(dp[i],dp[i-pow9]+1);
	}
    }
    cout <<dp[N]<< endl;
    return 0;
}


Measured memory_bytes: 640
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using P = pair<ll,ll>;
using vl = vector<ll>;
using Map = map<ll,ll>;
using T = tuple<ll,ll,ll>;
using vvl = vector<vector<ll>>;
#define all(v) v.begin(), v.end()
#define prt(v) cout<<v<<"\n";
#define fi(v) get<0>(v)
#define se(v) get<1>(v)
#define th(v) get<2>(v)
#define endl "\n"
template <typename T> bool chmax(T &a, const T &b){if (a<b){a=b;return 1;}return 0;}
template <typename T> bool chmin(T &a, const T &b){if (a>b){a=b;return 1;}return 0;}
const ll INF=1LL<<62;
const ll MOD=1000000007;


signed main(void){
    cin.tie(0);cout.tie(0);ios::sync_with_stdio(false);
    ll N;
    cin >> N;
    ll K;
    cin >> K;
    vector<ll> x(N,0);
    vector<ll> y(N,0);
    ll ans=INF;
    for(ll i=0;i<N;++i)cin>>x[i]>>y[i];
    for(ll i=0;i<N;++i){
        for(ll j=i+1;j<N;++j){
            vector<ll> Y(0);
            //x[i]とx[j]を選んだ;
            ll x1=min(x[i],x[j]);
            ll x2=max(x[i],x[j]);
            for(ll k=0;k<N;++k){
                if(x1<=x[k]&&x[k]<=x2)Y.emplace_back(y[k]);
            }
            sort(Y.begin(), Y.end());
            if(Y.size()<K)continue;
            ll H=INF;
            for(ll i=0;i<Y.size()-K+1;++i)chmin(H,Y[i+K-1]-Y[i]);
            chmin(ans,(x2-x1)*H);
        }
    }
    prt(ans)
    
    return 0;
}


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

using namespace __gnu_pbds; 
using namespace __gnu_cxx;
using namespace std;
using ll = long long;

#define eb emplace_back
#define pb push_back
#define mp make_pair
#define ff first
#define ss second
#define len(v) ((int)v.size())
#define all(v) v.begin(), v.end()
#define precision(n) fixed<<setprecision(n)

#ifdef LOCAL
    #include "debug.h"
#else
    #define debug(...) 42
#endif

void io(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);    
    #ifdef LOCAL
        freopen("input.txt","r",stdin);
        freopen("output.txt","w",stdout);
    #endif
}

template<typename T> using oset = tree <T, null_type, less <T>, rb_tree_tag, tree_order_statistics_node_update >;
template<typename T> using MinPriorityQueue = priority_queue <T, vector <T>, greater <T> >;
template<typename T> void done(T ans) {cout << ans << "\n"; exit(0);}

auto seed = chrono::high_resolution_clock::now().time_since_epoch().count();
mt19937_64 mt(seed);

clock_t time_p=clock();
void printTime(){
    time_p=clock()-time_p;
    cerr<<"Time Taken : "<<(float)(time_p)/CLOCKS_PER_SEC<<"\n";
}

template <typename A>
istream& operator>>(istream& input,vector<A>& x) {
  for(auto& i:x)
    input>>i;
  return input;
}
 
template<typename A>
ostream& operator<<(ostream& output,vector<A>& x) {
  for(auto& i:x)
    output<<i<<' ';
  return output;
}
 

const int mod = 1e9 + 7;
const int N = 1e5 + 5;
bool solve(ll n, ll d) {
    while(n % d == 0 and d > 1) {
        n = n / d;
    }
    if(n % d == 1)
        return true;
    else return false;
}
int main(){
    io();
    ll n;
    cin >> n;
    set<ll> divi;
    for(ll i = 1; i <= sqrt(n); i++) {
        if(n % i == 0) {
            if(solve(n, i)) {    
                divi.insert(i);
            }
            if(i != (n / i)) {
                if(solve(n, n / i)) {
                    divi.insert(n / i);
                }
            }
        }
    }
    n -= 1;
    for(ll i = 1; i <= sqrt(n); i++) {
        if(n % i == 0) {
            if(solve(n + 1, i)) {
                if(divi.find(i) == divi.end())     
                    divi.insert(i);
            }
            if(i != (n / i)) {
                if(solve(n + 1, n / i)) {
                    if(divi.find(n / i) == divi.end())     
                        divi.insert(n / i);
                }
            }
        }
    }
    // for(int d : divi)   cout << d << " ";
    cout << divi.size();


}



Measured memory_bytes: 256
/*
██████╗  ███████╗  
██╔══██╗ ██╔════╝ 
██████╔╝ ███████╗ 
██╔══██╗ ╚════██║  
██║  ██║ ███████║      
╚═╝  ╚═╝ ╚══════╝                                                                                                             
*/

#include<bits/stdc++.h>
using namespace std;
 
#define ll long long int
#define rep(i,n) for(int i=0;i<n;i++)
#define rev(i,n) for(int i=n-1;i>=0;i--)
#define haha(j,a,n) for(int j=a;j<n;j++)
#define Max(x,y,z) max(x,max(y,z))
#define Min(x,y,z) min(x,min(y,z))
#define endl "\n"
#define bc(v) v.begin(),v.end()
#define vl vector<ll>
#define vi vector<int>
#define why 1000000007
#define NUM 100005
#define F first
#define S second
#define bhar(a) rep(i,a.size()) cin>>a[i];
#define show(a) rep(i,a.size()) cout<<a[i]<<" ";
#define sott(a) sort(bc(a))
#define mp(a,b) make_pair(a,b)
#define pb push_back
#define mapp map<ll,ll>
#define dkac cout<<fixed<<setprecision(15);
#define ios ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define yeah(n) while(n--)
ll gcd(int a, int b){if(b==0) return a; else return gcd(b,a%b);}
ll bitfun(ll x){
  return (x&(-x));
}
void solve(){
  dkac
  long double l,ans;;
  cin>>l;
  ans=(l/3)*(l/3)*(l/3);
  cout<<ans;
}
int main(){
    ios
    int t=1; 
    //cin>>t;
    yeah(t){
      solve();
    }
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define IOS ios::sync_with_stdio(false); cin.tie(0);
#define FOR(i,s,n) for(int i = s; i < (n); i++)
#define REP(i,n) FOR(i,0,n)
#define ALL(n) (n).begin(), (n).end()
#define RALL(n) (n).rbegin(), (n).rend()
using ll = long long;
using ull = unsigned long long;

int main(void)
{
    IOS
    int n; cin >> n;
    string s; cin >> s;

    int ans = 0;
    int tmp = 0;
    for (char c : s) {
        switch (c)
        {
        case 'I':
            tmp++;
            break;
            
            case 'D':
            tmp--;
            break;
        
        default:
            break;
        }
        ans = max(tmp, ans);
    }
    cout << ans <<endl;

    return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define MOD 1000000007
#define INF 1e9
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define all(x) (x).begin(),(x).end()

int main(){
    int n;
    cin>>n;
    vector<int> a(n),b(n),c(n);
    rep(i,n) cin>>a[i];
    rep(i,n) cin>>b[i];
    rep(i,n) cin>>c[i];

    ll ans=0;
    sort(all(a));
    sort(all(c));
    rep(i,n){
        ll ue=lower_bound(all(a),b[i])-a.begin();
        ll sita=n-(upper_bound(all(c),b[i])-c.begin());
        //cout<<ue<<" "<<sita<<endl;
        ans+=ue*sita;
    }
    cout<<ans<<endl;
}

Measured memory_bytes: 1536
#include <bits/stdc++.h>
using namespace std;
#define REP(i, n) for(int i = 0; i < n; i++)
#define REPR(i, n) for(int i = n - 1; 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());
 
using ll = long long;
using vll = vector<ll>;
using vvll = vector<vector<ll>>;
using P = pair<ll, ll>;

int main(){
    ll n;
    cin >> n;
    string s, t;
    cin >> s >> t;

    int res = 0, len = min(s.size(), t.size());
    REP(i, len){
        if(s.substr(s.size() - 1 - i, i + 1) == t.substr(0, i + 1)){
            res = max(res, i + 1);
        }
    }
    ll ans = s.size() + t.size() - res;
    ans = max(ans, n);
    cout << ans << endl;
}

Measured memory_bytes: 256
while True:
    val = input().split(" ")
    a = int(val[0])
    b = int(val[2])
    op = val[1]
    
    if op == "+":
        print(a + b)
    elif op == "-":
        print(a - b)
    elif op == "*":
        print(a * b)
    elif op == "/":
        print(a // b)
    elif op == "?":
        break


Measured memory_bytes: 5596
#include <iostream>
#include <string>
#include <algorithm>

using namespace std;

int main(void) {
	int num, i = 0, j, a = 0, b = 0, ab = 0, ans = 0, buf;
	string s;
	cin >> num;
	for (; i < num; i++) {
		cin >> s;
		for (j = 0; j < s.size() - 1; j++) {
			if (s[j] == 'A' && s[j + 1] == 'B')
				ans++;
		}
		if (s[0] == 'B') {
			b++;
			if (s[s.size() - 1] == 'A') {
				a++;
				ab++;
			}
		}
		else if (s[s.size() - 1] == 'A')
			a++;
	}
	buf = min(a, b);
	if (buf > 0 && a == b && a == ab)
		buf--;
	printf("%d\n", ans + buf);
	return 0;
}

Measured memory_bytes: 256
#define _USE_MATH_DEFINES
#include <cassert>
#include <cstdio>
#include <cstring>
#include <iostream>
#include <string>
#include <sstream>
#include <vector>
#include <queue>
#include <stack>
#include <list>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <algorithm>
#include <complex>
#include <cmath>
#include <numeric>
#include <bitset>
#include <functional>

using namespace std;

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

typedef long long int64;
typedef pair<int, int> ii;
const int INF = 1 << 29;
const int MOD = 1e9 + 7;

const int N = 1e5 + 10;
vector<ii> a[N];

int main() {
  int n, m;
  scanf("%d%d", &n, &m);
  for (int i = 0; i < m; ++i) {
    int P, Y;
    scanf("%d%d", &P, &Y);
    a[P].emplace_back(Y, i);
  }
  vector<ii> ret(m);
  for (int i = 1; i <= n; ++i) {
    sort(a[i].begin(), a[i].end());
    for (int j = 0; j < a[i].size(); ++j) {
      int k = a[i][j].second;
      ret[k] = {i, j + 1};
    }
  }
  for (int i = 0; i < m; ++i) {
    printf("%06d%06d\n", ret[i].first, ret[i].second);
  }
  return 0;
}


Measured memory_bytes: 7808
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,m=map(int,input().split())
tree=UnionFind(n)
for i in range(m):
    a,b=map(int,input().split())
    tree.union(a-1,b-1)
ans=0
for i in range(n):
    ans=max(ans,tree.size(i))
print(ans)

Measured memory_bytes: 14296
#include <cstdio>
#include <iostream>
#include <algorithm>
#include <string>
#include <cstring>
#include <vector>
#include <queue>
#include <set>
#include <map>
#include <cmath>
#include <iomanip>
#include <cassert>
#include <bitset>
using namespace std;

typedef pair<int, int> P;
#define rep(i, n) for (int i=0; i<(n); i++)
#define all(c) (c).begin(), (c).end()
#define uniq(c) c.erase(unique(all(c)), (c).end())
#define _1 first
#define _2 second
#define pb push_back
#define INF 1145141919
#define MOD 1000000007

int M, N;
int A[100];

int f(int X) {
  int s = 1;
  int w = X;
  rep(i, N) {
    if (w >= A[i]) {
      w -= A[i];
    }
    else {
      s++;
      w = X - A[i];
      if (w < 0) return false;
    }
  }
  return s;
}

signed main() {
  ios::sync_with_stdio(false); cin.tie(0);
  while (cin >> M >> N) {
    if (N == 0 && M == 0) break;
    rep(i, N) cin >> A[i];
    int lo = *max_element(A, A+N) - 1, hi = 3000000;
    while (hi - lo > 1) {
      int mid = (lo + hi) / 2;
      if (f(mid) <= M) hi = mid;
      else lo = mid;
    }
    cout << hi << "\n";
  }
  return 0;
}

Measured memory_bytes: 3088
#include<stdio.h>
int isPrime(int x){
  int i;
  if(x<2) return 0;
  else if(x==2) return 1;
  if(x%2==0) return 0;
  for(i=3; i*i<=x; i+=2){
    if(x%i==0) return 0;
  }
  return 1;
}

int main(){
  int n, x, i;
  int cnt=0;
  scanf("%d",&n);
  for(i=0; i<n; i++){
    scanf("%d",&x);
    if(isPrime(x)) cnt++;
  }
  printf("%d\n",cnt);

  return 0;
}

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

int main() {
    int n; cin >> n;
    int s[n];
    int sum = 0;
    for (int i = 0; i < n; i++) { cin >> s[i]; sum += s[i]; }
    sort(s, s + n);

    int ans = 0;
    for (int i = 0; i < n; i++) {
        if (sum % 10 != 0) { ans = sum; break; } 
        else {
            if (s[i] % 10 != 0) sum -= s[i];
        }
    }
    cout << ans << endl;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int n,m;
    cin >> n >> m;
    int ara[m][2];
    for(int i =0; i <m;i++)
    {
        cin >> ara[i][0] >> ara[i][1];
    }
    int digit[n+1]={0};
    bool is[n+1];
    memset(is,false,sizeof(is));
    int f = 0;
    for(int i =0; i<m;i++)
    {
        if(!is[ara[i][0]] || digit[ara[i][0]] == ara[i][1])
        {
            if(ara[i][0] == 1 && ara[i][1] == 0 && n != 1)
            {
                f = 1;
                break;
            }
            digit[ara[i][0]] = ara[i][1];
            is[ara[i][0]] = true;
        }
        else
        {
            f = 1;
            break;
        }
    }
    if(f == 1)
    {
        cout << "-1" << endl;
    }
    else
    {
        if(digit[1] == 0 && n!= 1)
        {
            digit[1] = 1;
        }
        for(int i =1; i <= n;i++ )
        {
            cout << digit[i];
        }
        cout << endl;
    }
}






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

//repetition
#define FOR(i,a,b) for(ll i=(a);i<(b);++i)
#define rep(i, n) for(ll i = 0; i < (ll)(n); i++)

//container util
#define all(x) (x).begin(),(x).end()

//typedef
typedef long long ll;
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<ll> VLL;
typedef vector<VLL> VVLL;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef pair<ll, ll> PLL;

//const value
//const ll MOD = 1e9 + 7;
//const int dx[] = {0,1,0,-1};//{0,0,1,1,1,-1,-1,-1};
//const int dy[] = {1,0,-1,0};//{1,-1,0,1,-1,0,1,-1};

//conversion
inline int toInt(string s) {int v; istringstream sin(s);sin>>v;return v;}
inline ll toLL(string s) {ll v; istringstream sin(s);sin>>v;return v;}
template<class T> inline string toString(T x) {ostringstream sout;sout<<x;return sout.str();}

const int MAX = 510000;
const int MOD = 1000000007;

long long fac[MAX], finv[MAX], inv[MAX];

// テーブルを作る前処理
void COMinit() {
    fac[0] = fac[1] = 1;
    finv[0] = finv[1] = 1;
    inv[1] = 1;

    for (int i = 2; i < MAX; i++){
        fac[i] = fac[i - 1] * i % MOD;
        inv[i] = MOD - inv[MOD%i] * (MOD / i) % MOD;
        finv[i] = finv[i - 1] * inv[i] % MOD;
    }
}

// 二項係数計算
long long COM(int n, int k){
  if (n < k) return 0;
  if (n < 0 || k < 0) return 0;
  return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
}

// Mod int
const int mod = 1000000007;
struct mint {
  ll x;
  mint():x(0){}
  mint(ll x):x((x%mod+mod)%mod){}
  // mint(ll x):x(x){}
  mint& fix() { x = (x%mod+mod)%mod; return *this;}
  mint operator-() const { return mint(0) - *this;}
  mint& operator+=(const mint& a){ if((x+=a.x)>=mod) x-=mod; return *this;}
  mint& operator-=(const mint& a){ if((x+=mod-a.x)>=mod) x-=mod; return *this;}
  mint& operator*=(const mint& a){ (x*=a.x)%=mod; return *this;}
  mint operator+(const mint& a)const{ return mint(*this) += a;}
  mint operator-(const mint& a)const{ return mint(*this) -= a;}
  mint operator*(const mint& a)const{ return mint(*this) *= a;}
  bool operator<(const mint& a)const{ return x < a.x;}
  bool operator==(const mint& a)const{ return x == a.x;}
};
istream& operator>>(istream&i,mint&a){i>>a.x;return i;}
ostream& operator<<(ostream&o,const mint&a){o<<a.x;return o;}
typedef vector<mint> vm;
typedef vector<vm> vvm;
//

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

  VVI edge(n);

  rep(i,n-1){
    int a,b;
    cin >> a >> b;
    a--, b--;
    edge[a].push_back(b);
    edge[b].push_back(a);
  }

  mint ans = k;
  function<void(int,int)> dfs = [&](int v, int p){
    int kouho = k-1;
    if(p != -1) kouho--;
    for(int x: edge[v]){
      if(x == p) continue;
      ans *= kouho;
      kouho--;
      dfs(x,v);
    }
  };
  dfs(0,-1);
  cout << ans << endl;
  return 0;
}


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

int main() {
long long n,s,t;
s=0;
t=0;
cin >> n;
vector<long long>p(n);
vector<long long>q(n);
vector<long long>tmp(n);
for (long i=0;i<n;i++){
    cin >>p.at(i);}
for (long i=0;i<n;i++){
    cin >>q.at(i);}
for(long i=0;i<n;i++){
    tmp.at(i)=i+1;}
do{
    s++;
    if (tmp==p)break;
    
}while(next_permutation(tmp.begin(),tmp.end()));
for(long i=0;i<n;i++){
    tmp.at(i)=i+1;}
do{
    t++;
    if (tmp==q)break;
    
}while(next_permutation(tmp.begin(),tmp.end()));
cout << abs(s-t);}



Measured memory_bytes: 256
#include<iostream>

using namespace std;

int main(){
	char S[27];
	bool used[26];
	bool rightflag = true;
	for(int i = 0; i < 26; i++){
		used[i] = false;
	}
	cin >> S;
	for(int i = 0; i < 26; i++){
		if(S[i] == '\0'){
			break;
		}
		if(used[S[i] - 'a'] == false){
			used[S[i] - 'a'] = true;
		}else{
			rightflag = false;
			break;
		}
	}
	if(rightflag == true){
		cout << "yes" << endl;
	}else{
		cout << "no" << endl;
	}
	return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <algorithm>

using namespace std;



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

    int n;
    cin >> n;

    if (n < 10) {
        cout << "Yes";
    }
    else if (n >= 10 && n < 100) {
        if (n % 10 == n / 10) {
            cout << "Yes";
        }
        else {
            cout << "No";
        }
    }
    else if (n >= 100 && n < 1000) {
        if (n % 10 == n / 100) {
            cout << "Yes";
        }
        else {
            cout << "No";
        }
    }

    return 0;
}


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

int main(){
    int n;
    cin >> n;
    int cnt=0;
    for(int i=1; i<=n; i++){
        if(to_string(i).size()%2==1)cnt++;
    }
    cout << cnt << endl;
}

Measured memory_bytes: 256
#include<cstdio>
#include<cmath>
#include<string>
#include<iostream>
#include<algorithm>
#include<utility>
#include<vector>
#include<map>
#include<set>
#include<limits>
#include<bitset>
#include<array>
#include<numeric>
#include<iomanip>
#include<functional>

using namespace std;
typedef long long int ll;

#define C(I) cout<<(I)<<endl

ll n,m,a,b,c,x,y,z,aa[100010],ba[100010];
bool r,ra,rb,rc;
string s,sa,sb,sc;
char ca,cb,cc;
vector<ll> va,vb,vc;

int main(){
    cin>>ca>>cb;
    if(ca=='H'){
        C(cb=='H' ? "H":"D");
    }
    else{
        C(cb=='H' ? "D":"H");
    }
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
long long a,b,c,kk;
int main()
{
    cin>>a>>b>>c;
    if(b>=a)
    {
        cout<<1<<endl;
        return 0;
    }
    else if(c>=b)
    {
        cout<<-1<<endl;
        return 0;
    }
    else if((a-b)%(b-c)>=1)
            kk=1;
    cout<<((a-b)/(b-c)+kk)*2+1<<endl;
    return 0;
}

Measured memory_bytes: 256
import java.util.*;
public class Main {
  public static void main(String[] args){
	Scanner sc = new Scanner(System.in);
	// 整数の入力
	String s = sc.next();
	String t = sc.next();
    int a = sc.nextInt();
    int b = sc.nextInt();
    String u = sc.next();
    if (u.equals(s)) {
      a--;
    } else {
      b--;
    }
	System.out.println(a + " " + b);
  }
}




Measured memory_bytes: 22740
#include<iostream>
#include<bits/stdc++.h>
using namespace std;
int n;
double a[5000];
long double cache[5000][5000]={0};
long double prob(int i,int et)
{
	if(i>=n&&et<=-1)
	return 1;
	if(et>n-i-1)
	{
	//cout<<"hello there;";
	return 0;
}
	if(cache[i][et]!=0)
	return cache[i][et];
	return cache[i][et]=(a[i]*prob(i+1,et-1)+(1-a[i])*prob(i+1,et+1));
}
int main()
{
	cin>>n;	
	for(int i=0;i<n;i++)
	cin>>a[i];
	long double x= prob(0,0);
	cout<<fixed<<setprecision(10)<<x;
	//for(int i=0;i<3;i++)
	//{cout<<endl;
	//for(int j=0;j<3;j++)
	//cout<<cache[i][j]<<" ";
}


Measured memory_bytes: 234112
#include<bits/stdc++.h>
#define fi first
#define se second
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define pb push_back
#define len(x) (int)(x).size()
#define rep(i,x) for(int i=0;i<x;++i)

typedef long long ll;
typedef long double ld;

using namespace std;

signed main(){
    ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
    string s,  t;
    cin >> s >> t;
    int a , b ;cin >> a >> b;
    string u;cin >> u;
    if(s == u)--a;
    else --b;
    cout << a << ' ' << b;
    return 0;
}


Measured memory_bytes: 256
#include<stdio.h>
#define D 100

int bubble(int A[],int N){
  int a = 0,flag =1,es;
  for(int i=0;flag>0;i++){
    flag = 0;
    for(int j = N-1;j>i;j--){
      if(A[j]<A[j-1]){
	es=A[j];
	A[j]= A[j-1];
	A[j-1] = es;
	flag = 1;
	a++;
      }
    }
  }
  return a;
}

int main(){
  int A[D],N,a,i;
  scanf("%d",&N);
  for(i = 0;i<N;i++)
    scanf("%d",&A[i]);

  a = bubble(A,N);

  for(i = 0;i<N;i++){
    if(i>0)
      printf(" ");
    printf("%d",A[i]);
  }

  printf("\n");
  printf("%d\n",a);

  return 0;
}

  



Measured memory_bytes: 2084
import java.util.Scanner;

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

    void solve(Scanner sc) {
        int x1 = sc.nextInt();
        int y1 = sc.nextInt();
        int x2 = sc.nextInt();
        int y2 = sc.nextInt();
        int x = x2 - x1;
        int y = y2 - y1;
        int a = x2 - y;
        int b = y2 + x;
        int c = x1 - y;
        int d = y1 + x;
        System.out.printf("%d %d %d %d%n", a, b, c, d);
    }
}

Measured memory_bytes: 25300
#include <stdio.h> 
#define _ll long long
#define N 1e18
_ll g(_ll a, _ll b)
{
	_ll t, i, c;
	if(a<b)
	{
		t=a;
		a=b;
		b=t;
	}
	//printf("a=%lld, b=%lld", a, b); 
	for(i=1; i<N; i++)
	{
		//printf("a=%lld\n", a);
		c=a*i;;
		if(c%b==0)
		break;
	}
	return c;
	
}
int main()
{
	int n;
	
	while(scanf("%d", &n)!=EOF)
	{
		_ll a, i, b=1;
		for(i=0; i<n; i++)
		{
			scanf("%lld", &a);
			b=g(a, b);
			//printf("b=%lld\n", b);
		}
		printf("%lld\n", b);
	}
	return 0;
}

Measured memory_bytes: 128
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;

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

        ll tmp = N / 10.0;
        ll tmp2 = N - (tmp * 10);
        if (tmp == 9 || tmp2 == 9) {
                cout << "Yes" << endl;
        }
        else cout << "No" << endl;


}


Measured memory_bytes: 256
n = int(input())
count = 0
check = 0
for j in range(1, n+1):
    if j % 2 == 0:
        continue
    for i in range(1, j):
        if j % i == 0:
            check += 1
    if check == 7:
        # print(j)
        count += 1
    check = 0
print(count)


Measured memory_bytes: 2940
/// Containers Start
#include <algorithm>
#include <bitset>
#include <cstdlib>
#include <functional>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <list>
#include <map>
#include <queue>
#include <regex>
#include <random>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <tuple>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <vector>
/// C Header Files
#include <cassert>
#include <cctype>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <ctime>
#include <math.h>
#include <stdio.h>
/// Containers End

using namespace std;

/// Math Start
#define PI acos(-1.0)
#define Pi 3.141592653589793
#define EPS (1e-7)
#define INF (0x3f3f3f3f)
/// Math End

/// Extra Start
#define nn '\n'
#define pb push_back
#define ull unsigned long long
#define ll long long
#define MOD 1000000007
#define sz(a) int((a).size())
#define space " "
#define All(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
/// Extra End

#define rep(i, n) for (int i = 0; i < n; i++)
#define Cini(a)                                                                \
    int a;                                                                     \
    cin >> a;
#define Cinii(a, b)                                                            \
    int a, b;                                                                  \
    cin >> a >> b;
#define Ciniii(a, b, c)                                                        \
    int a, b, c;                                                               \
    cin >> a >> b >> c;
#define Cins(s)                                                                \
    string s;                                                                  \
    cin >> s;
#define Cinss(s1, s2)                                                          \
    string s1, s2;                                                             \
    cin >> s1 >> s2;
#define Cinc(c)                                                                \
    char c;                                                                    \
    cin >> c;
/// Functions End


/// Debug Start
#define deb(x) cout << #x << ": " << x << endl
#define deb2(x, y) cout << #x << ": " << x << '\t' << #y << ": " << y << endl;
#define deb3(x, y, z)                                                          \
    cout << #x << ": " << x << '\t' << #y << ": " << y << '\t' << #z << ": "   \
         << z << endl;
/// Debug End

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

/**>>>>>>>>>>>>>>>>>>> END <<<<<<<<<<<<<<<<<<**/

/// template


signed main(void) {
    cin.sync_with_stdio(false);
    cin.tie(0);
    Cini(N);
    vector<int> A(N);
    rep(i,N)cin>>A[i];
    int tempMin=A[0],ansCount=0;
    rep(i,N){
        if(A[i]<=tempMin){
            ansCount++;
        }
        tempMin = min(tempMin,A[i]);
    }
    cout << ansCount << nn;
    return 0;
}

Measured memory_bytes: 1024
#include<stdio.h>

struct Card
{
char mark;
char value;
};

int main(){

struct Card C1[100],C2[100],c;
int n,i,j,mini;
char ch;
scanf("%d%c",&n,&ch);

for(i=0;i<n;i++)
{
scanf("%c%c%c",&C1[i].mark,&C1[i].value,&ch);
C2[i]=C1[i];
}

for(i=0;i<=n-1;i++)
{
for(j=n-1;j>=i+1;j--)
{
if(C1[j].value<C1[j-1].value)
{
c=C1[j];
C1[j]=C1[j-1];
C1[j-1]=c;
}
}
}

for(i=0;i<=n-1;i++)
{
mini=i;
for(j=i;j<=n-1;j++)
{
if(C2[j].value<C2[mini].value)
{
mini=j;
}
}
c=C2[i];
C2[i]=C2[mini];
C2[mini]=c;
}
for(i=0;i<n;i++)
{
printf("%c%c",C1[i].mark,C1[i].value);
if(i<n-1) printf(" ");
}
printf("\nStable\n");
for(i=0;i<n;i++)
{
printf("%c%c",C2[i].mark,C2[i].value);
if(i<n-1) printf(" ");
}
for(i=0;i<n;i++)
{
if(C1[i].mark!=C2[i].mark)
{
printf("\nNot stable\n"); break;
}
}
if(i==n) printf("\nStable\n");

return 0;
}

Measured memory_bytes: 1784
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define pb push_back
#define mii map <int, int>
#define mll map <ll, ll>
#define pii pair <int, int>
#define pll pair <ll, ll>
#define vi vector <int>
#define vd vector <double>
#define vll vector <ll>
#define fi first
#define se second
#define si set <int>
#define sll set <ll>
#define spii set <pii>
#define vs vector <string>
#define vpii vector <pair <int,int> >
#define vpll vector <pair <long long,long long> >
#define vvi vector <vector <int> >
#define vvpii vector <vector <pii > >
#define vb vector <bool>
#define vvb vector <vb>
#define mp make_pair
#define vvll vector <vll>
#define vsi vector <si>
#define rep(i, n) for (int i = 0; i < (n); i++)
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(),(x).rend()
#define MANX MAXN
#define itn int
#define in(x); { for (auto &to : x) cin>>to;}
#define out(x); { for (auto &to : x) cout<<to<<" ";cout<<'\n'; }

const ll INFLL = 1e18;
const int MAXN = 2e5+100;
const ll INF = 1e9;
const ll mod1=1e9+7;
const ll mod2=2e9+11;
int sz[MAXN],par[MAXN];
void make_set(int s)
{
    par[s]=s;
    sz[s]=1;
}
int find_set(int s)
{
    if (s==par[s])
        return s;
    return par[s]=find_set(par[s]);
}
void union_sets(int u,int v)
{
    u=find_set(u);
    v=find_set(v);
    if (u!=v)
    {
        if (sz[u]<sz[v])
            swap(u,v);
        sz[u]+=sz[v];
        par[v]=u;
    }
}
void solve()
{
    int n,m;
    cin>>n>>m;
    for (int i=0;i<n;i++)
        make_set(i);
    while (m--)
    {
        int u,v;
        cin>>u>>v;
        u--,v--;
        union_sets(u,v);
    }
    int mx=0;
    for (int i=0;i<n;i++)
    {
        if (find_set(i)==i)
            mx=max(mx,sz[i]);
    }
    cout<<mx<<'\n';
}

int main() {
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    #ifdef Mip182
    freopen("a.in","r",stdin);
    #endif
    int _t;
//    cin>>_t;
    _t=1;
    while (_t--)
        solve();
    //n=1 ?
    //recursion - matrix exponential
    //linear algebra - just a joke
    //check ios_base, MAXN, mod1 before submit
    //if debug more than 15 minutes - write stress
    //compression
}

Measured memory_bytes: 5232
#include<iostream>
#include<vector>
#include <numeric>
#include <utility>
#define INF 1e7
#define rep(i,n) for (int i = 0; i < (n); ++i)
int main(){
    int N, M, X;
    int cost, result=INF;
    std::vector<int> C, skill;
    std::vector<std::vector<int> > A;
    //std::cin >> N >> M >> X;
    std::cin >> N >> M >> X;
    A.resize(N, std::vector<int>(M));
    C.resize(N);
    skill.resize(M);
    for(int i=0; i<N; i++){
        std::cin >> C[i];
        for(int j=0; j<M; j++){
            std::cin >> A[i][j];
        }
    }
    for(int i=0; i< 1<<N; i++){
        cost = 0;
        std::fill(skill.begin(), skill.end(), 0);
        for(int j=0; j<N; j++){
            if(i>>j & 1){
                cost+=C[j];
                for(int k=0; k<M; k++){
                    skill[k] += A[j][k];
                }
            }
        }
        bool ok = true;
        for(int j=0; j<M; j++){
            if (skill[j] < X) ok = false;
        }
        if (ok) result = std::min(result, cost);
    }
    if (result == INF) std::cout << -1 << std::endl;
    else std::cout << result << std::endl;
    return 0;
}

Measured memory_bytes: 3164