akhauriyash/Code-Regression huggingface dataset:
/*
....................../´¯/)
....................,/¯../
.................../..../
............./´¯/'...'/´¯¯`·¸
........../'/.../..../......./¨¯\
........('(...´...´.... ¯~/'...')
.........\.................'...../
..........''...\.......... _.·´
............\..............(
..............\.............\...
*/


#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <sstream>
#include <queue>
#include <deque>
#include <bitset>
#include <iterator>
#include <list>
#include <stack>
#include <map>
#include <set>
#include <functional>
#include <numeric>
#include <utility>
#include <climits>
#include <iomanip>
#include <unordered_map>
#include <unordered_set>
#include <time.h>
#include <math.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <assert.h>
#define ll long long int
#define ull unsigned long long int
#define pb push_back
#define mp make_pair
#define ye cout<<"YES";
#define no cout<<"NO";
#define ln cout<<"\n";
#define bs binary_search
#define lb lower_bound
#define ub upper_bound
#define pi 3.14159265358979323846
// cout<<"Case #"<<ts<<": “;
//priority_queue < pair<ll, ll>, vector<pair<ll, ll>>, greater<pair<ll, ll>>> pq;


using namespace std;

ll mod(ll x, ll m) {
	return (x % m + m) % m;
}

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

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

	ll t = 1, r, n, a, d, c, b, x, y, sum, cnt, i, j, k, m, l, q, maxx, minn, temp, ans, flag, g, ts;
	ll mod = 1000000007;
	char ch, chh;
	double dans;
	string str, ttr;

	//cin >> t;


	for (ts = 1; ts <= t; ts++)
	{
		flag = 0; sum = 0; cnt = 0; ans = 0; k = 0; maxx = 0; minn = 0; a = 0; b = 0; temp = 0;

		cin >> n;
		//ll arr[n]; for (i = 0; i < n; i++) {cin >> arr[i];}

		if (n >= 30)
			cout << "Yes";
		else
			cout<<"No";




		ln
	}
	return 0;
}


Measured memory_bytes: 3652
//配列の総和
#include<bits/stdc++.h>
#include<atcoder/all>

using namespace std;
using namespace atcoder;

#define rep(i, n) for (ll i = 0; i < (n); ++i)
#define mp(p, q) make_pair(p, q)
#define pb(n) push_back(n)
#define all(a) a.begin(), a.end()

typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef string str;

typedef vector<ll> vll;
typedef vector<ld> vd;
typedef vector<bool> vb;
typedef vector<char> vc;
typedef vector<str> vs;
typedef vector<vector<ll>> vvll;
typedef vector<vector<ld>> vvd;
typedef vector<vector<bool>> vvb;
typedef vector<vector<char>> vvc;
typedef vector<vector<str>> vvs;
typedef vector<pair<ll, ll>> vpll;

const ld PI = acos(-1.0);
const ll MAX = 9000000000000000000;
const ll MIN = -9000000000000000000;
const ll MOD = 1000000007;

template <typename T>
void fin(T a)
{
    cout << a << endl;
    exit(0);
}

void Main(void)
{
    ll n, q; cin >> n >> q;
    fenwick_tree<ll> x(n);
    rep(i, n)
    {
        ll a;
        cin >> a;
        x.add(i, a);
    }
    rep(i, q)
    {
        ll a, b, c; cin >> a >> b >> c;
        if(a) cout << x.sum(b, c) << endl;
        else x.add(b, c);
    }
    return;
}

int main(void)
{
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout << fixed << setprecision(12); //高精度少数表示
    Main();
    return 0;
}

Measured memory_bytes: 8248
# -*- coding: utf-8 -*-
 
import math
import itertools
import sys
import copy
 
# 入力
#A, B, C, D = map(int, input().split())
#L = list(map(int, input().split()))
N = int(input())

d = []
for _ in range(N) :
  d.append(int(input()))
d.sort(reverse=True)
#print (d)

cnt = 1
for i in range(1, N) :
  if d[i] != d[i-1] :
    cnt += 1

print (cnt)
  

Measured memory_bytes: 38256
# coding: utf-8
import sys

N = int(input())

for i in range(1,10):
  #print(N,i,N%i,len(str(int(N/i))))
  if N%i == 0 and len(str(int(N/i))) == 1:
    print('Yes')
    sys.exit()
print('No')

Measured memory_bytes: 38384
#include <iostream>
#include <vector>
//#include <fstream>	// require freopen

using namespace std;

const int M = 5000000;
int t[100][100];

int dijkstra (int from, int to, int n )
{
	int res = 0;
	vector <bool> v (n, false );
	vector <int> d (n, M );

	int p, i;
	int mind;

	d[from] = 0;
	do{
		mind = M;

		for (i = 0; i < n; ++i ){
			if (!v[i] && d[i] < mind ){
				mind = d[i];
				p = i;
			} // end if
		} // end for
	
		v[p] = true;

		for (i = 0; i < n; ++i ){		
			if (d[p] + t[p][i] < d[i] ){
				d[i] = d[p] + t[p][i];
			} // end if
		} // end for
	}while (mind != M );

	if (d[to] == M ){
		res = -1;
	}else{
		res = d[to];
	} // end if

	return res;
}
		
int main()
{
//	cut here before submit 
//	freopen ("testcase.boattravel2", "r", stdin );
	int n, k;

	while (cin >> n >> k && n && k ){
		for (int i = 0; i < n; ++i ){
			for (int j = 0; j < n; ++j ){
				t[i][j] = M;
			} // end for
		} // end for
		
		for (int i = 0; i < k; ++i ){
			int com, a, b, c, d, e;
			cin >> com;
			if (com == 0 ){
				int res = 0;
				cin >> a >> b;
				--a, --b;
				res = dijkstra (a, b, n );
				cout << res << endl;
			}else{ // if (com == 1 ){
				cin >> c >> d >> e;
				--c, --d;
				if (t[c][d] > e || t[d][c] > e ){
					t[c][d] = e; t[d][c] = e;
				} // end if
			} // end if
		} // end for
	} // end loop
		
	return 0;
}

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

#define PI 3.1415926535897932
#define MOD 1000000007
#define INF 1e9

#define REP(i, n) for(int i = 0; i < (n); i++)
#define REP1(i, n) for(int i = 1; i <= (n); i++)
#define FOR(i, start, end) for(int i = (start); i < (end); i++)
#define ALL(v) (v).begin(), (v).end()

using namespace std;

typedef long long ll;
typedef pair<int,int> pii;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<vi> vvi;
typedef vector<string> vs;
typedef vector<bool> vb;


void solve()
{
    int N; cin >> N;
    cout << N * N * N << endl;
}

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

    solve();

    return 0;
}

Measured memory_bytes: 256
import java.util.Iterator;
import java.util.Map;
import java.util.Scanner;
import java.util.Set;
import java.util.TreeMap;
import java.util.TreeSet;



public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int[] d = new int[n];
        for (int i = 0 ; i < n ; i++) {
            d[i] = sc.nextInt();
        }
        if (d[0] != 0) {
            System.out.println(0);
            return;
        }
        for (int i = 1 ; i < n ; i++) {
            if (d[i] == 0) {
                System.out.println(0);
                return;
            }
        }
        Map<Integer, Integer> map = new TreeMap<Integer, Integer>();
        for (int i = 1 ; i < n ; i++) {
            if (map.containsKey(d[i])) {
                map.put(d[i], map.get(d[i]) + 1);
            } else {
                map.put(d[i], 1);
            }
        }
        int[] a = new int[map.size()];
        Set<Integer> set = new TreeSet<>();
        int b = 0;
        for (Map.Entry<Integer, Integer> entry : map.entrySet()) {
            a[b] = entry.getValue();
            set.add(entry.getKey());
            b++;
        }

        int [] c = new int[set.size()];
        int f = 0;
        for (Iterator<Integer> i = set.iterator() ; i.hasNext();) {
            c[f] = i.next();
            f++;
        }

        for (int i = 0 ; i < c.length ; i++) {
            if (c[i] != i + 1) {
                System.out.println(0);
                return;

            }
        }





        long ans = 1;
        long mod = 998244353;
        for (int i = 0 ; i < a.length - 1; i++) {
            int a1 = a[i];
            int a2 = a[i + 1];
            for (int j = 0 ; j < a2 ; j++) {
                ans *= (long) a1;
                ans %= mod;
            }
        }

        System.out.println(ans % mod);

    }

}


Measured memory_bytes: 57432
#include <iostream>
#include <algorithm>
#include <cmath>
#include <vector>
#include <queue>
#include <map>
#include <cmath>
#include <numeric>
#include <iomanip>
#include <set>
#include <string.h>

using namespace std;

typedef long long ll;

#define REP(i,n) for(ll (i)=0;(i)<(n);(i)++)
#define REP3(i,st,en) for(ll (i)=(st);(i)<(en);(i)++)

using P = pair<ll, ll>;
const int MOD = 1e9+7;
const ll INF = 1e+14;
const double PI = 3.14159265349;

ll euclid(ll a, ll b){
  while (b>1){
    a = a % b;
    swap(a,b);
  }
  return a;
}

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

  ll N;
  cin >> N;
  vector<ll> T(N);
  vector<ll> A(N);
  REP(i, N){ cin >> T[i] >> A[i]; }

  ll x=1;
  ll y=1;
  REP(i, N){
    x = (x%T[i]==0) ? x/T[i] : x/T[i]+1;
    y = (y%A[i]==0) ? y/A[i] : y/A[i]+1;
    ll p = max(x,y);
    x = T[i]*p;
    y = A[i]*p;
  }

  cout << x+y << "\n";
  return 0;
}


Measured memory_bytes: 256
#include <algorithm>
#include <bitset>
#include <climits>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <functional>
#include <iostream>
#include <queue>
#include <set>
#include <map>
#include <unordered_map>
#include <stack>
#include <string>
#include <vector>
 
using namespace std;
typedef long long ll;
using gra = vector<vector<ll>>;
using gram = vector<unordered_map<ll,ll>>;
 
typedef unsigned long long ull;
 
template <class T> inline bool chmin(T &a, T b) { if (a > b) { a = b; return true; } return false; }
template <class T> inline bool chmax(T &a, T b) { if (a < b) { a = b; return true; } return false; }
 
template <class T> T gcd(T a, T b) { return b ? gcd(b, a % b) : a; }
template <class T> T lcm(T a, T b) { return a / gcd(a, b) * b; }
template <class T> T dup(T a, T b) { return (a + b - 1) / b; }
template <class T> T modpow(T x, T p, T m) { T a=1; while(p){ if(p%2)a =a*x%m; x = x+x%m; p/=2; } return a; }
// template <class T> void prim(T a) { for(ll i=0;i<a.size();++i) { cout << a[i]; } cout << "\n"; }
 
#define mod 1000000007LL
#define INF 10000000000000000LL
 
#define rep(i, n) for (ll i = 0; i < n; ++i)
#define rep1(i, n) for (int i = 1; i <= n; ++i)
#define rrep(i, n) for (int i = (n - 1); i >= 0; --i)
#define rrep1(i, n) for (int i = n; i > 0; --i)
 
#define pri(x) cout << (x) << "\n"
#define pri2(x, y) cout << (x) << " " << (y) << "\n"
#define pri3(x, y, z) cout << (x) << " " << (y) << " " << (z) << "\n"
//#define modpow(x, p, m) { ll a=1; while(p){ if(p%2)a =a*x%m; x = x+x%m; p/=2; } return a; }
 
#define m0(h) memset(h, 0, sizeof(h))
#define m1(h) memset(h, 1, sizeof(h))
#define m(h, n) memset(h, (n), sizeof(h))
#define all(n) (n).begin(),(n).end()
#define bit(n) (1LL << (n))
#define pb push_back
 
//#ifdef LOCAL
//
//#define dpri(...) fprintf(stderr, __VA_ARGS__)
//#define pria(g) rep(i,g.size()){ cout << i << "{"; rep(j,g[i].size()) cout << g[i][j] << " "; cout << "}" << "\n"; }
//#else
//#define dpri(...) 42
//#define pria(g) 42
//#endif
 
 
 
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  // ---------------------
  // コーディング開始
  // ---------------------
  string s;
  cin >> s;
  bool ans = true;
  if(s[0]!='A') ans =false;
  s[0] = 'a';
  bool hoge = false;
  for(int i = 2;i < s.length() - 1;i++) {
    if(s[i]=='C'){
      hoge = true;
      s[i] = 'c';
      break;
    }
  }
  rep(i,s.length()){
    if(!(s[i]>='a' && s[i]<='z')){
      ans=false;
    }
  }
  if(ans&&hoge){
    pri("AC");
  }else{
    pri("WA");
  }
  return 0;
}


Measured memory_bytes: 256
#include <algorithm>
#include <bits/stdc++.h>
#include <cstdint>
#include <iostream>
#include <iterator>
#include <vector>

// lib/util.hpp
#ifndef UTIL_HPP
#define UTIL_HPP


typedef ::std::int_fast64_t i64;
typedef ::std::uint_fast64_t u64;
typedef ::std::int_fast32_t i32;
typedef ::std::uint_fast32_t u32;

namespace tools {
  template <typename T>
  void read(::std::istream& is, ::std::vector<T>& vector, const typename ::std::vector<T>::size_type size) {
    vector.reserve(size);
    ::std::copy_n(::std::istream_iterator<T>(is), size, ::std::back_inserter(vector));
  }
  template <typename T>
  void read(::std::vector<T>& vector, const typename ::std::vector<T>::size_type size) {
    ::tools::read(::std::cin, vector, size);
  }

  template <typename T, ::std::size_t N>
  void read(::std::istream& is, ::std::array<T, N>& array) {
    ::std::copy_n(std::istream_iterator<T>(is), N, array.begin());
  }
  template <typename T, ::std::size_t N>
  void read(::std::array<T, N>& array) {
    ::tools::read(::std::cin, array);
  }
}

#endif

// main.cpp

int main() {
  i64 X;
  std::cin >> X;

  std::vector<std::pair<i64, i64>> Y({std::make_pair(0, 0)});
  for (i64 i = 1; i * i * i * i * i - Y.back().second <= 1000000000; ++i) {
    Y.push_back(std::make_pair(-i, -(i * i * i * i * i)));
    Y.push_back(std::make_pair(i, i * i * i * i * i));
  }

  for (const auto& pair1 : Y) {
    for (const auto& pair2 : Y) {
      if (pair1.second - pair2.second == X) {
        std::cout << pair1.first << ' ' << pair2.first << std::endl;
        return 0;
      }
    }
  }

  return EXIT_FAILURE;
}

Measured memory_bytes: 3564
#include <bits/stdc++.h>
using namespace std;
/* typedef */
typedef long long ll;
typedef pair<int, int> pii;
/* constant */
const int INF = 1 << 30;
const ll LINF = 1LL << 50;
const int NIL = -1;
const int MAX = 10000;
const int mod = 1000000007;
const double pi = 3.141592653589;
/* global variables */
/* function */
/* main */
int main(){
    int N; cin >> N;
    vector<string> v(N);
    string S;
    for (int i = 0; i < N; i++) {
        vector<char> tmp;
        cin >> S;
        for (auto s : S) tmp.push_back(s);
        sort(tmp.begin(), tmp.end());
        S = "";
        for (auto t : tmp) S += t;
        v[i] = S;
    }
    sort(v.begin(), v.end());
    ll ans = 0;
    string tmp = v[0];
    ll cnt = 0;
    v.push_back("a");
    for (int i = 0; i <= N; i++) {
        if (tmp == v[i]) cnt++;
        else {
            ans += (cnt - 1) * cnt / 2;
            cnt = 1;
            tmp = v[i];
        }
    }
    cout << ans << '\n';
}


Measured memory_bytes: 8064
<?php
  
$h[] = explode(" ",trim(fgets(STDIN)));
$h[] = explode(" ",trim(fgets(STDIN)));
$h[] = explode(" ",trim(fgets(STDIN)));
	
fscanf(STDIN,"%d",$n);

while ($line = fgets(STDIN)) {
   $tmp[] = trim($line);
}

for($i=0;$i<3;$i++){
  for($x=0;$x<3;$x++){
    for($y=0;$y<$n;$y++){
    	if($h[$i][$x] == $tmp[$y]){
        	$h[$i][$x] -= $h[$i][$x];	//存在した数字のところを０にする
          	break;
        }
    }
  } 
}


if($h[0][0] == $h[0][1] && $h[0][1] == $h[0][2]){
  echo "Yes";
}elseif($h[1][0] == $h[1][1] && $h[1][1] == $h[1][2]){
  echo "Yes";
}elseif($h[2][0] == $h[2][1] && $h[2][1] == $h[2][2]){
  echo "Yes";
}elseif($h[0][0] == $h[1][0] && $h[1][0] == $h[2][0]){
  echo "Yes";
}elseif($h[0][1] == $h[1][1] && $h[1][1] == $h[2][1]){
  echo "Yes";
}elseif($h[0][2] == $h[1][2] && $h[1][2] == $h[2][2]){
  echo "Yes";
}elseif($h[0][0] == $h[1][1] && $h[1][1] == $h[2][2]){
  echo "Yes";
}elseif($h[0][2] == $h[1][1] && $h[1][1] == $h[2][0]){
  echo "Yes";
}else{
	echo "No";
}


Measured memory_bytes: 3828
N = int(input())
A = list(map(int, input().split()))

for i in range(N - 1):
    if A[i] < 0:
        A[i] *= -1
        A[i + 1] *= -1

if A[-1] < 0:
    A[-1] *= -1
    print(sum(A) - 2*min(A))
else:
    print(sum(A))


Measured memory_bytes: 14412
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <stack>
#include <queue>
#include <set>
#include <cmath>
#include <map>
#include <fstream>
#include <iterator>
using namespace std;

// Debug Vector
template <typename T>
std::ostream &operator<<(std::ostream &out, const std::vector<T> &v)
{
    if (!v.empty())
    {
        out << '[';
        std::copy(v.begin(), v.end(), std::ostream_iterator<T>(out, ", "));
        out << "\b\b]";
    }
    return out;
}

template <typename T1, typename T2>
std::ostream &operator<<(std::ostream &out, const std::pair<T1, T2> &p)
{
    out << "[" << p.first << ", " << p.second << "]";
    return out;
}

typedef long long ll;
const int MAX_N = 101000;
int dp[MAX_N];

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

    int N;
    cin >> N;

    for (int i = 0; i < MAX_N; ++i)
    {
        dp[i] = N;
    }
    dp[0] = 0;
    for (int n = 1; n <= N; ++n)
    {
        for (int pow6 = 1; pow6 <= n; pow6 *= 6)
        {
            dp[n] = min(dp[n], dp[n - pow6] + 1);
        }

        for (int pow9 = 1; pow9 <= n; pow9 *= 9)
        {
            dp[n] = min(dp[n], dp[n - pow9] + 1);
        }
    }

    cout << dp[N] << endl;
}

Measured memory_bytes: 640
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define REP(i, n) for (int i = (0); i < (n); ++i)
#define ALL(obj) (obj).begin(), (obj).end()
#define DEBUG(val) cout << #val << " : " << val << endl
#define MOD 1000000007

int main() {
  int x;
  cin >> x;
  int ans = 8;
  if (400 <= x && x <= 599) ans = 8;
  if (600 <= x && x <= 799) ans = 7;
  if (800 <= x && x <= 999) ans = 6;
  if (1000 <= x && x <= 1199) ans = 5;
  if (1200 <= x && x <= 1399) ans = 4;
  if (1400 <= x && x <= 1599) ans = 3;
  if (1600 <= x && x <= 1799) ans = 2;
  if (1800 <= x && x <= 1999) ans = 1;
  cout << ans << endl;
}

Measured memory_bytes: 3616
#include<bits/stdc++.h>
//#include <ext/pb_ds/assoc_container.hpp>
//#include<ext/pb_ds/tree_policy.hpp>
#include<cstdio>
#include<vector>
#include<stdio.h>
#include<cstring>
#include<algorithm>
#include<string>
#include<iostream>
#include<map>
#include<set>
#include<queue>
#include<set>
#define READ                freopen("in.txt", "r", stdin)
#define WRITE               freopen("out.txt", "w", stdout)
#define INF9                1000000010
#define INF18               1000000000000000010
#define dist(ax,ay,bx,by)   sqrt((ax-bx)*(ax-bx)+(ay-by)*(ay-by))
#define gcd(a,b)            __gcd(a,b)
#define lcm(a,b)            (a*b)/__gcd(a,b)
#define m_p(a,b)            make_pair(a,b)
#define sqr(a)              ((a)*(a))
#define pb                  push_back
#define bpll(a)             __builtin_popcountll(a)
#define MX                  200006
#define PI                  acos(-1)
#define mod                  1000000007
#define cnt_bin(n)          __builtin_clzll(0ll) - __builtin_clzll(n)

typedef long long lli;
using namespace std;

vector<lli>adj[MX];
bool vis[MX];

lli cnt=0;

void dfs(lli u)
{
    cnt++;
    for(lli i=0; i<adj[u].size(); i++)
    {
        lli v= adj[u][i];

        if(vis[v]==false)
        {
            vis[v]=true;
            dfs(v);
        }
    }
}


int main()
{
    lli n, m;
    scanf("%lld %lld", &n, &m);

    for(lli i=0; i<m;i++)
    {
        lli a, b;
        scanf("%lld %lld", &a, &b);
        adj[a].push_back(b);
        adj[b].push_back(a);
    }

    lli ans=0;

    for(lli i=1; i<=n; i++)
    {
        if(vis[i]==false)
        {
            vis[i]=true;
            cnt=0;
            dfs(i);

            ans= max(ans, cnt);
        }
    }

    cout<<ans<<endl;


    return 0;
}


Measured memory_bytes: 20992
N, K = map(int, input().split())
box = set()
for i in range(K):
    temp = int(input())
    temp2 = set(map(int, input().split()))
    for j in temp2:
        box.add(j)

ans = 0
for i in range(1, N+1):
    if i not in box:
        ans += 1
print(ans)

Measured memory_bytes: 67460
import sys
n = int(input())
a = [int(i) for i in input().split()]

for i in range(n-2,0 , -1):
    #print(a[i])
    if   a[i] <= a[i+1]:
        continue
    elif a[i] - a[i+1] > 1:
        print("No")
        sys.exit()
    else:
        a[i] = a[i] -1
        continue
print("Yes")
    

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

int main() {
	int h, w;
	while (true) {
		cin >> h >> w;
		if (h == 0 && w == 0)break;
		for (int i = 0; i < h; i++) {
			for (int j = 0; j < w; j++) {
				cout << "#";
			}
			cout << endl;
		}
		cout << endl;
	}
}


Measured memory_bytes: 3092
#include <bits/stdc++.h>
#include <cstdlib> // abs(x-y)
#include <iomanip> // 出力の桁数指定
#define rep(i, s, n) for (int i = (s); i < (int)(n); i++)

using namespace std;

int main() {
  int a, b, c;
  //string s;
  cin >> a >> b >> c;

  cout << (a+b+c>=22 ? "bust" : "win") << endl;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define NL            "\n"
#define _SAD()        ios::sync_with_stdio(0),cin.tie(0), cout.tie(0);
#define SZ(s)         s.size()
#define SRT(x,y)      sort(x,x+y)
#define REV(a,b)      reverse(a,a+b)
#define VSRT(x)       sort(x.begin(),x.end())
#define VREV(x)       reverse(x.begin(),x.end())
int main()
{
    _SAD()
    string s,k;
    cin>>s>>k;
    if(s==k)
    {
        cout<<"="<<NL;
    }
    else if(s>k)
    {
        cout<<">"<<NL;
    }
    else
    {
        cout<<"<"<<NL;
    }
    return 0;
}


Measured memory_bytes: 256
// https://qiita.com/tanakh/items/0ba42c7ca36cd29d0ac8
#[allow(unused_macros)]
macro_rules! p {
    ($($x:expr),*) => {
        $(println!("{:?}", $x);)*
    };
}
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
    ($($r:tt)*) => {
        #[allow(unused_mut)]
        let mut s = {
            use std::io::Read;
            let mut s = String::new();
            std::io::stdin().read_to_string(&mut s).unwrap();
            s
        };
        let mut iter = s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
}

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

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

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

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

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

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

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

    ($iter:expr, $t:ty) => {
        $iter.next().unwrap().parse::<$t>().expect("Parse error")
    };
}
#[allow(unused_imports)]
use std::cmp::*;
trait Each: Iterator{
    fn each<F>(self, mut f: F) where
        Self: Sized, F: FnMut(Self::Item),
    {
        self.fold((), move |(), item| f(item));
    }
}
impl<T:Iterator>Each for T{}

fn main(){
    input!{
        n: usize,
        a:[u64;n]
    }
    let mut ans = a
        .iter()
        .enumerate()
        .map(|(i,&x)|(x,i+1))
        .collect::<Vec<_>>();
    ans.sort();
    //dbg!(&ans);
    let ans: Vec<_> = ans.into_iter().map(|(_,x)|x.to_string()).collect();
    //dbg!(&ans);
    println!("{}",ans.join(" "));
}

Measured memory_bytes: 12920
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

public class Main {

    static List<Long> bList = new ArrayList<>();
    static List<Long> pList = new ArrayList<>();
    static List<Long> nList = new ArrayList<>();

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

        int N = scanner.nextInt();
        long X = scanner.nextLong();


        bList.add((long)0);
        pList.add((long)1);
        nList.add((long)1);
        for (int i = 1; i <= N; i++) {
            long b = bList.get(i-1);
            long p = pList.get(i-1);
            bList.add(2*b + 2);
            pList.add(2*p + 1);
            nList.add(2*b + 2 + 2*p + 1);
        }

        System.out.println(pSize(N, X));
    }

    static long pSize(int n, long x) {
        if (n == 0) {
            return 1;
        }
        if (x == 1 || x == n) {
            return 0;
        }

        long size = nList.get(n);
        if (size == x) {
            // 全部
            return pList.get(n);
        }
        if ((size+1)/2 == x) {
            // 真ん中
            return pList.get(n-1) + 1;
        }

        if ((size+1)/2 > x) {
            // 下
            return pSize(n-1, x-1);
        } else {
            // 上
            long p = pList.get(n-1) + 1;
            long s = nList.get(n-1);
            return p + pSize(n-1, x-s-2);
        }
    }

}


Measured memory_bytes: 21844
n = gets.to_i
h = Hash.new(0)
n.times do
  s = gets.chomp
  h[s] += 1
end
ss = Array.new(n+1){[]}
mx = 0
h.each do |k,v|
  ss[v] << k
  mx = [v, mx].max
end

ss[mx].sort!
ss[mx].each do |s|
  puts s
end




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

int main()
{int n,k;
		cin>>n;
		cin>>k;
		int s[n];
		for(int i=0;i<n;i++)cin>>s[i];
		int a[n];
		a[n-1]=0;
		a[n-2]=s[n-1]>s[n-2]?(s[n-1]-s[n-2]):(s[n-2]-s[n-1]);
		for(int i=n-3;i>=0;i--){
		    long long  min=1000000001;
		    for(int j=1;j<=k&&i+j<n;j++){
		        int t=a[i+j]+((s[i+j]>s[i])?(s[i+j]-s[i]):(s[i]-s[i+j]));
		        min=min<t?min:t;
		    }
		    a[i]=min;
		}
		cout<<a[0];
	return 0;
}


Measured memory_bytes: 1024
#include<algorithm>     //sort,二分探索,など
#include<bitset>        //固定長bit集合
#include<cmath>         //pow,logなど
#include<complex>       //複素数
#include<deque>         //両端アクセスのキュー
#include<fstream>       //ファイルストリーム（標準入力変更用）
#include<functional>    //sortのgreater
#include<iomanip>       //setprecision(浮動小数点の出力の誤差)
#include<iostream>      //入出力
#include<iterator>      //集合演算(積集合,和集合,差集合など)
#include<map>           //map(辞書)
#include<numeric>       //iota(整数列の生成),gcdとlcm(c++17)
#include<queue>         //キュー
#include<set>           //集合
#include<stack>         //スタック
#include<string>        //文字列
#include<unordered_map> //イテレータあるけど順序保持しないmap
#include<unordered_set> //イテレータあるけど順序保持しないset
#include<utility>       //pair
#include<vector>        //可変長配列

//名前
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef map<string, int> msi;
typedef map<string, ll> msll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pllll;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<string> vs;
typedef vector<bool> vb;
typedef vector<vector<int>> vvi;
typedef vector<vector<ll>> vvll;
typedef vector<vector<string>> vvs;
typedef vector<vector<bool>> vvb;

//定数
const ll MOD = 1000000007;
const ll INF = 1000000000000000000;
const double PI = 3.14159265358979323846;

//マクロ
#define rep(i,n) for(int i=0;i<n;i++)
#define reps(i,s,e) for(int i=s;i<e;i++)
#define repse(i,s,e) for(int i=s;i<=e;i++)
#define rrep(i,n) for(int i=n-1;i>=0;i--)
#define all(x) (x).begin(),(x).end()
#define rall(x) (x).rbegin(),(x).rend()
#define in(x1) cin >> x1
#define in2(x1, x2) cin >> x1 >> x2
#define in3(x1, x2, x3) cin >> x1 >> x2 >> x3
#define inN(x, N) rep(i, N) in(x[i])
#define outl(x) cout << x << endl
#define out2l(x, y) cout << x << " " << y << endl 

//よく使う関数
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }

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

    //標準入力をファイルに変更
    //std::ifstream in("input.txt");
    //std::cin.rdbuf(in.rdbuf());
    ld A, B, H, M;
    cin >> A >> B >> H >> M;

    ld a1 = ((double)M) / 60;
    ld a2 = (((double)M) / 60 + ((double)H)) / 12;
    ld c = cos((a2 - a1) * 2 * PI);
    ld ans = sqrt(A * A + B * B - 2 * A * B * c);

    cout << setprecision(10) << setiosflags(ios::fixed);
    outl(ans);

    return 0;
}

Measured memory_bytes: 4172
from heapq import heappush, heappop

N = int(input())
A = [-int(x) for x in input().split()]
A = sorted(A)
ans = 0
I = [A[0]]
for a in A[1:]:
  ans += heappop(I)
  heappush(I, a)
  heappush(I, a)
print(-ans)

Measured memory_bytes: 106248
#include <cstdio>
#define repi(i,a,b) for(int i=(a);i<(b);++i)
#define rep(i,a) repi(i,0,a)
#define all(a) (a).begin(), (a).end()

template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }

int A, B, C, D;

int main()
{
  scanf( "%d%d%d%d", &A, &B, &C, &D );

  int L = A+B, R = C+D;

  puts( L > R ? "Left" : L == R ? "Balanced" : "Right" );

  return 0;
}

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


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

    int N;
    cin >> N;
    int a[N];
    rep(i,N) cin >> a[i];

    int count=1;
    rep(i,N){
        if(a[i]==count) count++;
    }

    if(count==1) count = -1;
    else count=N-count+1;
    cout << count << endl;


}

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

int main(void){
    string S;
    cin >> S;
    bool flag = false;
    if (S.size()%2 == 0) {
        for (int i = 0; i < S.size(); i++) {
            if ((i % 2 == 0 && S[i] == 'h') || (i % 2 == 1 && S[i] == 'i'))
                flag = true;
            else {
                flag = false;
                break;
            }
        }
    }
    
    if (flag)
        cout << "Yes";
    else
        cout << "No";
}

Measured memory_bytes: 256
import sys; sys.setrecursionlimit(2147483647); input = sys.stdin.readline
from math import floor, ceil, sqrt, factorial, log
from collections import Counter, defaultdict, deque
from operator import itemgetter
INF = float('inf'); MOD = 10**9+7
def I(): return int(input())
def MI(): return map(int, input().split())
def LI(): return list(MI())
def LIR(n): return [LI() for i in range(n)]
def IS(): return input().rstrip()
import re

def main():
    S = IS()
    if len(S)%2 == 1: print('No')
    elif 'hi'* (len(S)//2) == S: print('Yes')
    else: print('No')

if __name__ == '__main__':
    main()

Measured memory_bytes: 3808
#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
template<typename T> bool chmax(T &a,T b){if(a<b){a=b;return true;}return false;}
template<typename T> bool chmin(T &a,T b){if(a>b){a=b;return true;}return false;}
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define itn int
#define rep1(i,n) for(int i=1;i<=(int)(n);i++)
#define rrep(i,n) for(int i=(int)(n)-1;i>=0;i--)
#define rrep1(i,n) for(int i=(int)(n);i>=1;i--)
#define all(vec) vec.begin(),vec.end()
#define sort(vec) sort((vec).begin(),(vec).end())
#define rsort(vec) sort((vec).rbegin(), (vec).rend())
typedef long long ll;
typedef long double ld;
typedef pair<ll,ll> pll;
typedef pair<int,int> pii;
typedef tuple<ll,ll,ll> tlll;
typedef tuple<int,int,int> tiii;
const ll mod=1e9+7;
const int inf=1<<30;
const ll lnf=1ll<<60;

ll rui(ll a,ll n){
  ll ans=1;
  while(n>0){
    if(n&1) ans=ans*a%mod;
    a=a*a%mod;
    n/=2;
  }
  return ans;
}

ll rui2(ll x){
  ll ans=0;
  while(x%2==0){
    x/=2;
    ans++;
  }
  return ans;
}

ll rui5(ll x){
  ll ans=0;
  while(x%5==0){
    x/=5;
    ans++;
  }
  return ans;
}

int main(){
  itn n; cin >> n;
  double r;
  vector<ll> a(n);
  rep(i,n){
    cin >> r;
    a[i]=llround(r*1e9);
  }
  ll ints=0;
  set<pii> st25;
  map<pll,ll> mp;
  rep(i,n){
    ll cnt5=rui5(a[i]);
    ll cnt2=rui2(a[i]);
    if(cnt2>=9&&cnt5>=9) ints++;
    st25.insert(pii(cnt2,cnt5));
    mp[pll(cnt2,cnt5)]++;
  }
  ll ans=0;
  for(auto a:st25){
    for(auto b:st25){
      if(a.first+b.first>=18&&a.second+b.second>=18) ans+=mp[a]*mp[b];
    }
  }
  ans=(ans-ints)/2;
  cout << ans << endl;
}

Measured memory_bytes: 4748
#include <iostream>
#include<vector>
#include<algorithm>
#include<string>
#include<map>
#include<set>
#include<stack>
#include<queue>
#include<math.h>
using namespace std;
typedef long long ll;
#define int long long
typedef vector<int> VI;
typedef pair<int, int> pii;
typedef priority_queue<int> PQ;
#define fore(i,a) for(auto &i:a)
#define REP(i,n) for(int i=0;i<n;i++)
#define eREP(i,n) for(int i=0;i<=n;i++)
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define eFOR(i,a,b) for(int i=(a);i<=(b);++i)
#define SORT(c) sort((c).begin(),(c).end())
#define rSORT(c) sort((c).rbegin(),(c).rend())
#define LB(x,a) lower_bound((x).begin(),(x).end(),(a))
#define UB(x,a) upper_bound((x).begin(),(x).end(),(a))
#define INF 1000000000
#define LLINF 9223372036854775807
#define mod 1000000007
//vector<vector<int> > dp;
//vector<vector<vector<int> > > vvvi;
//dp=vector<vector<int> >(N, vector<int>(M,0));
//vector<pair<int,int> > v;
//v.push_back(make_pair(x,y));
//priority_queue<int,vector<int>, greater<int> > q2;



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

	int N;
	cin >> N;
	VI A(N);
	bool F = true;
	int cnt = 0;

	map<int, int> mp;
	VI B;

//	cout << "K" << endl;

	REP(i, N) {
		cin >> A[i];
		if (N % 3 != 0 && A[i]!=0) {
			F = false;
		}
		if (mp[A[i]] == 0) {
			cnt++;
			B.push_back(A[i]);
		}
		mp[A[i]]++;
	}
	if (N % 3 == 0) {
		if (cnt > 3) {
			F = false;

		}
		REP(i, B.size()) {
			if (mp[B[i]] != (N / 3)) {
				F = false;
				//cout << "K" << endl;
			}
		}
		int S = B[0] ^ B[1];
		int SS = B[2] ^ S;
		//cout << S << " " << SS << endl;
		if (SS!=0) {
			F = false;
			//cout << "K" << endl;
		}
	}


	if (mp[B[0]] == N / 3 * 2 && mp[0] == N / 3&&cnt==2) {
		F = true;
	}
	if (mp[B[1]] == N / 3 * 2 && mp[0] == N / 3 && cnt == 2) {
		F = true;
	}
	if (cnt == 1 && B[0] == 0)F = true;
	if (F) {
		cout << "Yes" << endl;
	}
	else {
		cout << "No" << endl;
	}
	return 0;
}



Measured memory_bytes: 6260
#include<stdio.h>
#include<algorithm>
using namespace std;
int n,k,i,j,srx[200001],sry,t,p;
int main()
{
   scanf("%d%d",&n,&k);
   for(i=1;i<=n;++i)
   {
        scanf("%d",&t);
        srx[t]++;
   }
   sort(srx+1,srx+n+1);
   for(i=n;i>n-k;--i)
   sry+=srx[i];
   printf("%d",n-sry);
   return 0;
}

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

int main() {
	ios :: sync_with_stdio(false);
	int a, b;
	while(cin >> a >> b) {
		int n = a + b;
		int ans = 0;
		if(n == 0)
			ans = 1;
		else {
			while(n) {
				ans ++;
				n /= 10;
			}
		}
		cout << ans << '\n';
	}
	return 0;
}

Measured memory_bytes: 3144
#include <stdio.h>

int main(void) {
  int count = 1;
  int n;
  scanf("%d",&n);
  if (n == 1 || n==2||n==4){
      count = 4;
      printf("%d\n",count);
    }
  else {
     while(n != 4) {
      if(n % 2 == 0) {
      n /= 2;
        }   else {
      n = (3 * n) + 1;
        }
    count++;
     }
     printf("%d\n",count+3);
   }

  return 0;
}

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

#define fr(i,n) _back
#define pb	push_back
#define eb	emplace_back
#define mk	make_pair
#define fi	first
#define se	second
#define endl	'\n'

typedef long long ll;
typedef pair<int,int> ii;
typedef vector<ii> vii;
const ll INF = 0x3f3f3f3f3f3f3f;
const double PI = acos(-1.0);

const int T = 1e3 + 3;
const int N = 4100;

int n,m,gol;
ll v[T];
int key[T];
ll dp[T][N];

ll solve(int at, int mask) {
    if(mask == gol) return 0;
    if(at == m) return INF;
    if(dp[at][mask] != -1) return dp[at][mask];
    return dp[at][mask] = min(solve(at+1,mask), solve(at+1,mask|key[at])+v[at]);
}

int main() {
    ios_base::sync_with_stdio(false);
    memset(dp, -1, sizeof dp);

    cin >> n >> m;
    gol = pow(2,n)-1;

    for(int i = 0; i < m; i++) {
        cin >> v[i];
        int p; cin >> p;
        for(int j = 0; j < p; j++) {
            int x; cin >> x;
            key[i] |= (1 << (x-1));
        }
    }

    ll ans = solve(0,0);
    cout << (ans >= INF? -1 : ans) << endl;
    return 0;
}



Measured memory_bytes: 32640
n = int(input())
a = list(map(int, input().split()))


def sadness(b):
  sad = 0
  for i, e in enumerate(a):
    i += 1
    sad += abs(e - (b + i))
  return sad


d = []
for i, e in enumerate(a):
  i += 1
  d.append(e - i)

d.sort()

if len(d) % 2 == 1:
  print(sadness(d[len(d) // 2]))
else:
  print(min(sadness(d[len(d) // 2]), sadness(d[len(d) // 2 + 1])))


Measured memory_bytes: 26180
#include <bits/stdc++.h>
using namespace std;
 
int gcd(int x,int y){
    if(y==0)return x;

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

int ctoi(char c) {
	if (c >= '0' && c <= '9') {
		return c - '0';
	}
	return 0;
}

int main()
{

    int A,B,C,temp=0,sum=0;
    cin>>A>>B>>C;

    
    for(int i=1;i<=B;i++){
        if((A*i)%B==C){
            cout<<"YES"<<endl;
            return 0;
        }

    }
    
    cout<<"NO"<<endl;

    
    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <algorithm>
#include <utility>
#include <string>
#include <queue>
#include <stack>

using namespace std;

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

const ll mod = 1000000007;

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

  int n;
  cin >> n;
  vector<int> a(n);
  for (auto &x: a) cin >> x;

  int ans = 0;
  int target = 1;
  for (int i = 0; i < n; i++) {
    if (a[i] == target) target++;
    else ans++;
  }

  if (target == 1) ans = -1; // impossible

  cout << ans << endl;

  return 0;
}


Measured memory_bytes: 1024
//g++ -std=c++14 test.cpp -o test.out
//問題URL
//https://atcoder.jp/contests/dp/tasks/dp_o
//bitDP
//Nが25くらいまでなら2^25が大体10^7とオーダーが同じくらいなので行ける
//参考
//https://emtubasa.hateblo.jp/entry/2019/02/05/183137
#include <string.h>
#include <stdlib.h>
#include <math.h>
#include <cassert>
#include <algorithm>
#include <functional>
#include <iostream>
#include <iomanip>
#include <vector>
#include <queue>
#include <map> 
#include <utility>
#include <limits.h>
#include <bitset>
#include <set>
using namespace std;
 
#define LL long long int
const LL INF = (LL)(1e18)+1;
const int INF_INT = 2147483647-1e6;
const LL mod = 1000000007ll;
const int mod_int = 1000000007;

int N;
LL a[21][21];//隣接行列

LL ans = 0;

void solve(){
	vector<vector<LL>> dp(N,vector<LL>(1LL<<N,0));
	for(int i=0;i<N;i++){
		if(a[0][i]) dp[0][(1<<N)-1-(1<<i)] = 1;
	}
	for(int i=1;i<N;i++){
		for(int j=0;j<N;j++){
			if(a[i][j]) {
				for(int k=0;k<(1<<N);k++){
					if((k>>j)%2 == 0) {
						dp[i][k] += dp[i-1][k+(1<<j)];
						dp[i][k] %= mod;
					}
				}
			}
		}
	}
	ans = dp[N-1][0];
}
 
int main(){
	cin >> N;
	for(int i=0;i<N;i++){
		for(int j=0;j<N;j++) cin >> a[i][j];
	}
 
	solve();

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

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

int main() {
	int a, b, c;
	cin >> a >> b >> c;
	//bool型でやるとうまくいく.
	bool ticket = false;
	//切符が正しいかの判断
	if (a == 0) {
		if (c == 1) {
			ticket = true;
		}
	} 
	else {
		if (b == 1) {
			ticket = true;
		}
	}

	//openかcloseかにする.
	string ans;
	if (ticket == true) ans = "Open";
	else ans = "Close";

	//出力
	cout << ans << endl;
}


Measured memory_bytes: 3164
#include <iostream>

using namespace std;

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

int main() {
    int N, M;
    cin >> N >> M;

    char A[60][60];
    char B[60][60];
    rep(y, N)rep(x, N)cin >> A[y][x];
    rep(y, M)rep(x, M)cin >> B[y][x];

    bool exist = false;
    rep(ly, N) {
        rep(lx, N) {
            if (ly + M - 1 >= N || lx + M - 1 >= N)continue;

            bool match = true;
            rep(y, M) {
                rep(x, M) {
                    if (A[ly + y][lx + x] != B[y][x])match = false;
                }
            }
            if (match)exist = true;
        }
    }
    if (exist)cout << "Yes" << endl;
    else cout << "No" << endl;
}

Measured memory_bytes: 256
#include<iostream>
#include<stdio.h>
#include<vector>
#include<algorithm>
#include<set>
#include<string>
#include<map>
#include<string.h>
#include<complex>
#include<math.h>
#include<queue>
#include <functional>
#include<time.h>
#include <stack>
#include<iomanip>
using namespace std;
#define rep(i,a,n) for(int i=(a);i<(n);i++)
#define ll long long
#define llint long long int
#define reverse(v)  reverse(v.begin(), v.end());
#define Yes(ans) if(ans)cout<<"Yes"<<endl; else cout<<"No"<<endl;
#define YES(ans) if(ans)cout<<"YES"<<endl; else cout<<"NO"<<endl;
#define hei(a) vector<a>
#define whei(a) vector<vector<a>>
#define UF  UnionFind 
#define Pint pair<int,int>
#define keta(a)  fixed << setprecision(a)
constexpr auto INF = 100000000000;
constexpr auto mod = 1000000007;
//辞書順はnext_permutation( begin( v ), end( v ) );やで！
struct edge { int to, cost; };



int main() {
	int n, k;
	cin >> n >> k;
	hei(llint) h(n);
	whei(int) G(n);
	rep(i, 0, n) {
		cin >> h[i];
	}
	rep(i, 0, k) {
		int a, b;
		cin >> a >> b;
		a--;
		b--;
		G[a].push_back(b);
		G[b].push_back(a);
	}
	int ans = 0;
	rep(i, 0, n) {
		if (G[i].size() == 0) {
			ans++;
			continue;
		}
		bool s=true;
		for (auto x : G[i]) {
			if (h[i] <= h[x])s = false;
		}
		if (s)ans++;
	}
	cout << ans << endl;

	return 0;
}

Measured memory_bytes: 9068
m={'A':0,'B':1,'C':2}
a = 'A'
b='B'
while True:
    try:
        a, b = list(input().split(','))
    except:
        break
    m[a],m[b]=m[b],m[a]

if m['A']==0:  print('A')
elif m['B']==0:   print ('B')
elif m['C']==0:  print('C')







Measured memory_bytes: 5556
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
ll pow(ll n){
	ll answer = 1;
	for (ll i = 1; i <= n; ++i)
		answer *= 2;
	return answer;
}
int main(int argc, char const *argv[])
{
	ll n,p;
	cin>>n>>p;
	ll count_even = 0, count_odd = 0;
	for (ll i = 0; i < n; ++i)
	{
		ll t; cin>>t;
		if(t%2 == 0)
			count_even++;
		else
			count_odd++;
	}
	ll answer = 0;
	if(p == 0){
		answer = pow(count_even);
		answer += count_odd > 0? pow(count_odd - 1) - 1 : 0;
		answer += (count_even >0 ? pow(count_even) - 1: 0) * (count_odd > 0? pow(count_odd - 1) - 1: 0);
	}
	else{
		answer = count_odd > 0? pow(count_odd - 1) : 0;
		answer += (count_even>0? (pow(count_even) - 1): 0) * (count_odd > 0? pow(count_odd - 1) : 0);
	}
	cout<<answer<<endl;
	return 0;
}

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

int main(){
  int N;
  cin >> N;
  bool tf=false;
  int count=0;
  for(int i=0; i<N/7+1; i++){
    for(int j=0; j<N/4+1; j++){
      if(N==7*i+4*j){
        count++;
        tf=true;
      }
    }
    
  }
  if(tf)
    cout << "Yes" << endl;
  else
    cout << "No" << endl;
}

Measured memory_bytes: 256
h,w=map(int,input().split())
s=[list(input()) for _ in range(h)]

q=[(0,0)]
s[0][0]=0
dxy=[(1,0),(-1,0),(0,1),(0,-1)]
while q:
    x,y=q.pop(0)
    for dx,dy in dxy:
        nx,ny=x+dx,y+dy
        if not 0<=nx<w:
            continue
        if not 0<=ny<h:
            continue
        if s[ny][nx]=="#":
            continue
        if s[ny][nx]==".":
            s[ny][nx]=s[y][x]+1
            q.append((nx,ny))
        else:
            continue
if s[h-1][w-1]=="." or s[h-1][w-1]=="#":
    print(-1)
else:
    kuro=0
    for i in range(h):
        kuro+=s[i].count("#")

    print(h*w-s[h-1][w-1]-1-kuro)


Measured memory_bytes: 40688
#include <bits/stdc++.h>
 
using namespace std;
 
#define MAX 120
#define INF 1e9
 
struct Edge {
    int to, cost;
    Edge(int t, int c) : to(t), cost(c) {}
};
 
struct State {
    int cost, v, tic;
    State(int c, int v, int t) : cost(c), v(v), tic(t) {}
    bool operator < (const State &s) const {
	return cost > s.cost;
    }
};
 
int C, V, E, src, dst;
vector<Edge> G[MAX];
 
int dijkstra()
{
    priority_queue<State> Q;
    Q.push(State(0, src, C));
    int dist[MAX][11];
    fill(dist[0], dist[0]+MAX*11, INF);
    dist[src][C] = 0;
   
    while (!Q.empty()) {
	State s = Q.top(); Q.pop();
	int v = s.v,t = s.tic;
	if (dist[v][t] < s.cost) continue;
	if (v == dst) return dist[v][t];
     
	for (int i = 0; i < (int)G[v].size(); i++) {
	    Edge e = G[v][i];
	    if (dist[v][t] + e.cost < dist[e.to][t]) {
		dist[e.to][t] = dist[v][t] + e.cost;
		Q.push(State(dist[e.to][t], e.to, t));
	    }
	    if (t > 0) {
		if (dist[v][t] + e.cost/2 < dist[e.to][t-1]) {
		    dist[e.to][t-1] = dist[v][t] + e.cost/2;
		    Q.push(State(dist[e.to][t-1], e.to, t-1));
		}
	    }
	}
    }
}
 
int main()
{
    while (cin >> C >> V >> E >> src >> dst, C) {
	src--; dst--;
	for (int i = 0; i < V; i++) {
	    G[i].clear();
	}
	for (int i = 0; i < E; i++) {
	    int a,b,c;
	    cin >> a >> b >> c; a--; b--;
	    G[a].push_back(Edge(b, c));
	    G[b].push_back(Edge(a, c));
	}
	cout << dijkstra() << endl;
    }
    return 0;
}

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

int main(void){
    int count2=0;
    int ans[100000]={0};
    while(1){
        int a=0;
        int d=0;
        int n=0;
        int sq=0;
        scanf("%d %d %d",&a,&d,&n);
        if(a==0&&d==0&&n==0) break;
        int sum=a;
        int count=0;
        int end=0;
        while(1){
            /* if(sum==2){
                count++;
                if(count==n){
                    ans[count2]=sum;
                    end=1;
                }
                }*/
            
            sq=sqrt(sum);
           
           
            for(int i=2;i<=sq+1;i++){
                if(i==sq+1&&sum!=1){
                    count++;
                   
                    if(count==n){
                        ans[count2]=sum;
                        end=1;
                    }
                    break;
                }
                if(sum%i==0) break;
            }
            if(end==1) break;
            sum+=d;
        }
        count2++;
    }
    
    for(int i=0;i<count2;i++){
        printf("%d\n",ans[i]);
    }
    return 0;
     
}


Measured memory_bytes: 2152
#include<iostream>
#include<string>
using namespace std;
int main(){
	int a,b,c,d=0;
	cin>>a>>b>>c;
	for(int i=a;i<=b;i++){
		if(c%i==0)
			d++;
	}
	cout<<d<<endl;
	return 0;
}

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

int main(){
    int i=0,j=0,N=0,AB=0,A=0,B=0,BA=0;
    cin >> N;
    string s;
    for(i=0;i<N;i++){
        cin >> s;
        if(s[0]=='B'&&s[s.size()-1]!='A')B++;
        if(s[0]!='B'&&s[s.size()-1]=='A')A++;
        if(s[0]=='B'&&s[s.size()-1]=='A')BA++;
        for(j=0;j<s.size()-1;j++){
            if(s[j]=='A'&&s[j+1]=='B')AB++;
        }
        //cout << A << " " << B << " " << AB << " " << BA << endl;
    }
    if(BA==0)cout << AB + min(A,B) << endl;
    else if(A==0&&B==0)cout << AB + BA - 1 << endl;
    else cout << AB + BA + min(A,B) << endl;
    return 0;
}

Measured memory_bytes: 256
import java.util.Scanner;

public class Main {


    public static void main(String[] args) {

        Scanner sc = new Scanner(System.in);
        String s = sc.next();

        int index = s.lastIndexOf("s");

        if (index == s.length() - 1) {
            System.out.println(s + "es");
        } else {
            System.out.println(s + "s");
        }
        

    }
}

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

#define pb push_back
#define mp make_pair
typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef complex<double> point;
#define xx real()
#define yy imag()

#define REP(i, a, b) for(int i = (a); i < (int)(b); i++)
#define REPN(i, a, b) for(int i = (a); i <= (int)(b); i++)
#define FA(it, x) for(__typeof((x).begin()) it = (x).begin(); it != (x).end(); it++)
#define SZ(x) (int)(x).size()
#define BE(x) (x).begin(), (x).end()
#define SORT(x) sort(BE(x))
#define _1 first
#define _2 second

#define x1 gray_cat_x1
#define y1 gray_cat_y1

template<class T> T gcd(T a, T b) { return b ? gcd(b, a % b) : a; }

mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());

#define file "I1"

const double EPS = 1e-9;
const double PI = acos(-1.);
const int INF = 1e9;
const ll MOD = 1e9 + 7;

const int MAXN = 2e5 + 5;

int a[MAXN], b[MAXN];

ll get(int n, int mask) {
	ll ans = 0ll;
	REP(i, 0, n) {
		if ((mask | a[i]) == mask) {
			ans += b[i];
		}
	}
	return ans;
}

void solve(){
	int k, n;
	scanf("%d%d", &n, &k);
	REP(i, 0, n) {
		scanf("%d%d", &a[i], &b[i]);
	}
	ll ans = get(n, k);
	for(int i = 30; i >= 0; i--) {
		if (k & (1 << i)) {
			int mask = k ^ (1 << i);
			mask |= (1 << i) - 1;
			ans = max(ans, get(n, mask));
		}
	}
	cout << ans << endl;
}   

int main(){

    //freopen(file".in", "r", stdin); freopen(file".out", "w", stdout);
    int t = 1;
    //cin >> t;
    while(t--){
        solve();    
    }
}


Measured memory_bytes: 1024