akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>

#define all(X) (X).begin(), (X).end()
#define rep(I, A, B) for (int I = (A); I < (B); ++I)
#define ll long long
#define ld long double
#define linf (1ll << 60)

using namespace std;
// -------- Main Code -------- //
void runcase() {
    ll row, col, M;
    cin >> row >> col >> M;
    
    vector<ll> cnt_row(row, 0);
    vector<ll> cnt_col(col, 0);
    unordered_map<ll, ll> map;


    // for (int i=0; i<M; i++) {
    rep(i, 0, M) {
        int r, c;
        cin >> r >> c;
        cnt_row[r-1] ++;
        cnt_col[c-1] ++;
        ll idx = col * (r-1) + (c-1);
        map[idx] = 1;
    }

    ll res = 0;

    ll a, b;
    a = *max_element(all(cnt_row));
    b = *max_element(all(cnt_col));
    
    res = a + b - 1;

    vector<ll> va, vb;
    // for (int i=0; i<row; i++) 
    rep(i, 0, row) if (cnt_row[i] == a) va.emplace_back(i);
    // for (int i=0; i<col; i++) 
    rep(i, 0, col) if (cnt_col[i] == b) vb.emplace_back(i);

    // for (int i=0; i<va.size(); i++) for (int j=0; j<vb.size(); j++) {
    rep(i, 0, va.size()) rep(j, 0, vb.size()) {
        if (map[col * va[i] + vb[j]] == 0) {
            cout << res + 1 << "\n";
            return;
        } 
    }

    cout << res << "\n";
}

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    // int t;
    // cin >> t;
    // while (t-- > 0)
        runcase();
    return 0;
}


Measured memory_bytes: 29732
#include <iostream>
#include <cstdio>
#include <cstring>
#include <vector>
#include <queue>
#include <array>
#include <set>
#include <unordered_set>
#include <unordered_map>
#include <cmath>
#include <algorithm>
#include <numeric>
#include <cassert>
#include <utility>
#include <functional>
#include <random>

using namespace std;
using lli = long long int;
template<class T, class U> void init_n(vector<T>& v, size_t n, U x) 
{ v = vector<T>(n, x); }
template<class T> void init_n(vector<T>& v, size_t n) { init_n(v, n, T()); }
template<class T> void read_n(vector<T>& v, size_t n, size_t o = 0)
{ v = vector<T>(n+o); for (lli i=o; i<n+o; ++i) cin >> v[i]; }
template<class T> void read_n(T a[], size_t n, size_t o = 0)
{ for (lli i=o; i<n+o; ++i) cin >> a[i]; }
template<class T> T gabs(const T& x) { return max(x, -x); }
#define abs gabs

const lli mod = 1e9+7;
lli n, m;
vector<lli> x, y, ax, ay;
int main() {
  cin >> n >> m;
  read_n(x, n); read_n(y, m);
  init_n(ax, n); init_n(ay, m);
  for (lli i=0; i<n-1; ++i) ax[i] = x[i+1] - x[i];
  for (lli i=0; i<m-1; ++i) ay[i] = y[i+1] - y[i];

  lli xs = 0, ys = 0, xt = 0, yt = 0;
  for (lli i=0; i<n-1; ++i) {
    xt += (i+1)*ax[i];
    xs = (xs + xt) % mod;
  }
  for (lli i=0; i<m-1; ++i) {
    yt += (i+1)*ay[i];
    ys = (ys + yt) % mod;
  }
  lli ans = xs * ys % mod;
  cout << ans << endl;
  return 0;
}


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

#define ALL(a) (a).begin(), (a).end()
#define FOR(i, s, n) for (int i = (s); i < (n); i++)
#define rep(i, n) FOR(i, 0, n)
#define repi(i, n) FOR(i, 1, n + 1)
#define pp(v) cerr << #v "=" << (v) << endl;
#define ppa(v) cerr << "- " << #v << endl; rep(i,v.size()) cerr << #v << "[" << i << "] = " << v[i] << endl;
#define div_ceil(a,b) ((a) + ((b) - 1)) / (b)
#define UNIQUE(v) v.erase( unique(ALL(v)), v.end() );
#define INF 0x3f3f3f3f
#define LLINF 1000111000111000111LL
#define MOD 1000000007
#define TIME system("date +%M:%S.%N")
using Graph = vector<vector<int>>;
using ll = long long;
template<class T> T gcd(const T &a, const T &b) { return a < b ? gcd(b, a) : b ? gcd(b, a % b) : a; }
template<class T> T lcm(const T &a, const T &b) { return a / gcd(a, b) * b; }

#define x first
#define y second
#define mp make_pair
using Pos = pair<int,int>;
#define ppp(v) cerr << #v << "(" << v.x << "," << v.y << ")"
#define cr cerr << endl;

ll solve(ll n, ll m) {
  if (n==2 || m==2) return 0;
  if (n==1 && m==1) return 1;
  if (n==1) return m-2;
  if (m==1) return n-2;
  return (n-2)*(m-2);
}


int main() {
  ll n,m;cin>>n>>m;
  ll ans = solve(n,m);
  cout << ans << endl;
}


Measured memory_bytes: 256
import java.util.*;

public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int A = sc.nextInt();
        int B = sc.nextInt();
        int C = sc.nextInt();
        if(A<B&&A<C&&C<B){
            System.out.println("Yes");
        }else if(A>B&&B<C&&C<A){
            System.out.println("Yes");
        }else{
            System.out.println("No");
        }
        
    }
}


Measured memory_bytes: 23252
#include <bits/stdc++.h>
#define SORT(a) sort(a.begin(), a.end())
#define RSORT(a) sort(a.rbegin(), a.rend())
#define REP(i, n) for (int i = 0; i < n; i++)
#define FOR(i, start, end) for (int i = start; i < end; i++)
#define ALL(a) a.begin(), a.end()
#define MOD(a) a %= 1'000'000'007
using ll = long long;
using namespace std;
const int INF32       = 1'050'000'000;
const long long INF64 = 4'000'000'000'000'000'000;
const int MOD7        = 1'000'000'007;
const int MOD9        = 1'000'000'009;
template <class T> inline bool chmin(T &a, T b) {
    if (a > b) {
        a = b;
        return true;
    }
    return false;
}
template <class T> inline bool chmax(T &a, T b) {
    if (a < b) {
        a = b;
        return true;
    }
    return false;
}
void print() { std::cout << '\n'; }
void vprint() { std::cout << '\n'; }
template <class H, class... T> void print(H &&head, T &&... args) {
    std::cout << head;
    sizeof...(args) == 0 ? std::cout << "" : std::cout << ' ';
    print(std::forward<T>(args)...);
}
template <class T> void print(std::vector<T> &v) {
    for (int i = 0; i < v.size(); i++) {
        std::cout << v[i];
        i == v.size() - 1 ? std::cout << '\n' : std::cout << ' ';
    }
}
template <class T> void print(std::vector<std::vector<T>> &v) {
    for (int i = 0; i < v.size(); i++) {
        for (int j = 0; j < v[i].size(); j++) {
            std::cout << v[i][j];
            j == v[i].size() - 1 ? std::cout << '\n' : std::cout << ' ';
        }
    }
}
template <class H, class... T> void vprint(H &&head, T &&... args) {
    std::cout << head;
    sizeof...(args) == 0 ? std::cout << "" : std::cout << '\n';
    vprint(std::forward<T>(args)...);
}
template <class T> void vprint(std::vector<T> &v) {
    for (auto &&i : v) {
        std::cout << i << '\n';
    }
}
template <class T> void mprint(std::vector<std::vector<T>> &v) {
    for (int i = 0; i < v.size(); i++) {
        for (int j = 0; j < v[i].size(); j++) {
            std::cout << v[i][j];
            j == v[i].size() - 1 ? std::cout << '\n' : std::cout << "";
        }
    }
}

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

    ll K;
    cin >> K;
    ll N = 50;
    vector<ll> ans;
    ll d = K % N;
    REP(i, N - d) { ans.emplace_back(49 - d); }
    REP(i, d) ans.emplace_back(50);
    ll add = K / N;
    REP(i, N) { ans[i] += add; }
    print(ans.size());
    print(ans);

    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.nextLine();
        String T = sc.nextLine();

//        System.out.println(S);
//        System.out.println(T);

        int cnt = 0;
        for (int i = 0; i < S.length(); i++){
            if (S.charAt(i) != T.charAt(i)){
                cnt ++;
            }
        }
        System.out.println(cnt);

    }
}

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

typedef long long ll;

int dis(ll N){
    int cnt = 0;

    while(N > 0){
        N /= 10;
        cnt++;
    }

    return cnt;
}


ll even_div(ll N){

    ll ans = 1000000;

    for(ll i=1; i*i<=N; i++){
        if(N % i == 0){
            ll j = N/i;
            if(j*i == N){
                ll f = max(dis(i),dis(j));
                ans = min(ans,f);
            }
        }
    }

    return ans;
}


int main(){
    ll N;
    cin>>N;
    cout<<even_div(N)<<endl;

    return 0;
}

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

#define int long long
const double PI = 3.14159265358979323846;
typedef vector<int> vint;
typedef pair<int, int> pint;
int dx[8] = {1, 0, -1, 0, 1, -1, -1, 1};
int dy[8] = {0, 1, 0, -1, 1, 1, -1, -1};

int gcd(int a, int b) {
    if (b == 0) return a;
    return gcd(b, a % b);
}

int N,X;
int x[110000];
signed main() {
    cin >> N>>X;
    cin>> x[0];
    int ans=abs(X-x[0]);
    for(int i=1;i<N;i++){
        cin>>x[i];
        ans=gcd(ans,abs(X-x[i]));
    }
    cout<<ans<<endl;
}


Measured memory_bytes: 1024
#include <bits/stdc++.h>
using namespace std;
#define MS(x, i) memset(x, i, sizeof x)
#define debug(x) cout << #x << ": " << x << endl
#define pb push_back
#define all(x) (x).begin(),(x).end()
#define fi first
#define se second
#define NOS ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);

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

const int maxn = 1e5 + 10;
const int inf = 0x3f3f3f3f;
const int mod = 1e9 + 7;
const double eps = 1e-5;
char F[200];

inline ll read() {
    ll ret = 0, sgn = 1;
    char ch = getchar();
    while(ch < '0' || ch > '9'){
        if(ch == '-') sgn = -1;
        ch = getchar();
    }
    while (ch >= '0' && ch <= '9'){
        ret = ret*10 + ch - '0';
        ch = getchar();
    } 
    return ret*sgn;
}

inline void write( ll x ) {
    ll tmp = x > 0 ? x : -x;
    if(x < 0) putchar('-');
    int cnt = 0;
    while(tmp > 0) {
       F[cnt++] = tmp % 10 + '0';
       tmp /= 10;
    }
    while(cnt > 0) putchar(F[--cnt]);
}

int maxans[maxn];
int ans = -1;

int main()
{
    NOS
    // freopen("in.txt", "r", stdin);
    // freopen("out.txt", "w", stdout);
    
    int a;
    cin >> a;

    cout << a + a * a + a * a * a << endl;
    
    return 0;
}

Measured memory_bytes: 3640
#include<iostream>
#include<cstdio>
using namespace std;
int main(){
  char a[64],b[64];
  while(~scanf("%s%s",a,b)){
    int i;
    for(i=0;b[i];i++){
      printf("%c%c",a[i],b[i]);
    }
    if(a[i]) printf("%c",a[i]);
    printf("\n");
  }
  return 0;
}

Measured memory_bytes: 3156
#include <iostream>
#include <algorithm>
#include <numeric>
#include <vector>

using namespace std;

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

    int n;
    cin >> n;

    vector<int> ls(n);
    for(int i = 0; i < n; i++)
        cin >> ls[i];

    int max = *max_element(ls.begin(), ls.end());
    int sum = accumulate(ls.rbegin(), ls.rend(), 0);
    cout << ((max * 2 < sum) ? "Yes" : "No");
}

Measured memory_bytes: 256
x, k, d = gets.split.map(&:to_i)
 
x = x.abs
 
result = if x < k * d
  if k.even?
    n = x / (2 * d)
    a = x - n * 2 * d
    b = a - 2 * d
    [a.abs, b.abs].min
  else
    a0 = (x - d).abs
    if x <= d
      a0
    else
      x -= d
      n = x / (2 * d)
      a = x - n * 2 * d
      b = a - 2 * d
      [a.abs, b.abs].min
    end
  end
else
  x - k * d
end
 
puts result

Measured memory_bytes: 14304
#include <algorithm>
#include <array>
#include <cstddef>
#include <cstdint>
#include <iostream>
#include <map>
#include <set>
#include <vector>

using namespace std;

constexpr int64_t mod = 1000000007;

int main()
{
    int64_t n;
    cin >> n;
    int64_t ans = 1;
    for (int64_t i = 1; i <= n; i++)
    {
        ans *= i;
        ans %= mod;
    }
    cout << ans << endl;
}


Measured memory_bytes: 256
using System;
using System.Linq;

class stati {
static void Main(){for(int i=0;i<4;i++){
int []a=Console.ReadLine().Split().Select(int.Parse).ToArray();
int use =6000;
if(a[0]==4){use=2000;}
else if(a[0]==3){use=3000;}
else  if(a[0]==2){use=4000;}
Console.WriteLine(use*a[1]);

}




}
}

Measured memory_bytes: 9484
using System;
using System.Linq;

namespace C___Energy_Drink_Collector
{
    class Program
    {
        static void Main(string[] args)
        {
            var NM = Console.ReadLine().Split().Select(int.Parse).ToArray();
            int N = NM[0], M = NM[1];
            var AiBi = Enumerable.Range(1, N).Select(_ => Console.ReadLine().Split().Select(int.Parse).ToArray()).OrderBy(x => x[0]).ToArray();

            long count = 0, sum = 0;
            for (int i = 0; i < N; i++)
            {
                long A = AiBi[i][0], B = AiBi[i][1];

                if (count + B <= M)
                {
                    sum += A * B;
                    count += B;
                }
                else
                {
                    sum += A * (M - count);
                    break;
                }
            }

            Console.WriteLine(sum);
        }
    }
}


Measured memory_bytes: 26556
N = int(input())
d = [0 for i in range(0,N)]
for i in range(0,N):
    d[i] = int(input())

count = 0
while len(d) != 0:
    mini = min(d)
    while mini in d:
        d.remove(mini)
    count += 1

print(count)


Measured memory_bytes: 3060
//A - Beginner

#include <iostream>

using namespace std;

int main()
{
    int n, r;

    cin >> n >> r;

    int ans;
    if (n >= 10) {
        ans = r;
    }else{
        ans = r + (100 * (10-n));
    }

    cout << ans << endl;

    return 0;
}


Measured memory_bytes: 256
#include <iostream>

using namespace std;

int main(){
    int n, m, x, left = 0, right = 0;
    cin >> n >> m >> x;
    for (int i = 0; i < m; i++) {
        int a;
        cin >> a;
        if (a < x) left++;
        else       right++;
    }
    cout << (right < left ? right : left) << endl;
    return 0;
}


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

int main() {
    string s;
    cin >> s;
    if (s == "AAA" || s == "BBB") cout << "No" << endl;
    else cout << "Yes" << endl;
    return 0;
}


Measured memory_bytes: 256
//#pragma GCC target ("avx2")
//#pragma GCC optimization ("O3")
//#pragma GCC optimization ("unroll-loops")
#include<bits/stdc++.h>
//#include <ext/pb_ds/assoc_container.hpp>
//#include <ext/pb_ds/tree_policy.hpp>
//using namespace __gnu_pbds;
#define eps 1e-8
#define eq(x,y) (fabs((x)-(y)) < eps)
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<int,int>pii;
//const ll mod = 998244353 ;
//long double PI = acosl(-1);
const ll infl = 1e18+0;
//const int inf = 1e9;
const int nmax = 2e5+5;
//const int MAXLG = log2(nmax)+1;
//mt19937 rng(chrono::system_clock::now().time_since_epoch().count());
//typedef tree< int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> ost;



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

    int h1,m1,h2,m2,k;
    cin>>h1>>m1>>h2>>m2>>k;
    if(h1>h2 or (h1==h2 and m1>m2) ) h2+=24;
    int t1 = h1*60+m1, t2 = h2*60+m2;
    int delt = t2 - t1;
    cout<<delt - k<<endl;
}
/*

*/


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

#define rep(i, n) for (int i = 0; i < int(n); i++)
#define rrep(i, n) for (int i = int(n) - 1; i >= 0; i--)
#define reps(i, n) for (int i = 1; i <= int(n); i++)
#define rreps(i, n) for (int i = int(n); i >= 1; i--)
#define repc(i, n) for (int i = 0; i <= int(n); i++)
#define rrepc(i, n) for (int i = int(n); i >= 0; i--)
#define repi(i, a, b) for (int i = int(a); i < int(b); i++)
#define repic(i, a, b) for (int i = int(a); i <= int(b); i++)
#define each(x, y) for (auto &x : y)
#define all(a) (a).begin(), (a).end()
#define bit32(x) (1 << (x))
#define bit64(x) (1ll << (x))

using namespace std;

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

inline void yes() { cout << "Yes" << '\n'; exit(0); }
inline void no() { cout << "No" << '\n'; exit(0); }
inline i64 gcd(i64 a, i64 b) { if (min(a, b) == 0) return max(a, b); if (a % b == 0) return b; return gcd(b, a % b); }
inline i64 lcm(i64 a, i64 b) { if (min(a, b) == 0) return max(a, b); return a / gcd(a, b) * b; }
inline u64 xorshift() { static u64 x = 88172645463325252ull; x = x ^ (x << 7); return x = x ^ (x >> 9); }
template <typename T> class pqasc : public priority_queue<T, vector<T>, greater<T>> {};
template <typename T> class pqdesc : public priority_queue<T, vector<T>, less<T>> {};
template <typename T> inline void amax(T &x, T y) { if (x < y) x = y; }
template <typename T> inline void amin(T &x, T y) { if (x > y) x = y; }
template <typename T> inline T exp(T x, i64 n, T e = 1) { T r = e; while (n > 0) { if (n & 1) r *= x; x *= x; n >>= 1; } return r; }
template <typename T> inline T bis(T ok, T ng, function<bool(T)> f, T eps = 1) { while (abs(ok - ng) > eps) { T mi = (ok + ng) / 2; (f(mi) ? ok : ng) = mi; } return ok; }
template <typename T> istream& operator>>(istream &is, vector<T> &v) { each(x, v) is >> x; return is; }
template <typename T> ostream& operator<<(ostream &os, vector<T> &v) { rep(i, v.size()) { if (i) os << ' '; os << v[i]; } return os; }
void solve(); int main() { ios::sync_with_stdio(0); cin.tie(0); cout << fixed << setprecision(16); solve(); return 0; }

void solve() {
  string S;
  cin >> S;
  int n = S.size();
  vector<vi32> d(21, vi32(n));
  rep(i, n) {
    if (S[i] == 'R') {
      d[0][i] = i + 1;
    } else {
      d[0][i] = i - 1;
    }
  }
  rep(i, 20) rep(j, n) {
    d[i + 1][j] = d[i][d[i][j]];
  }
  vi32 ans(n);
  rep(i, n) {
    ans[d[20][i]]++;
  }
  cout << ans << endl;
}


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

int main()
{
	string a, b;
	cin >> a >> b;
	int s = 0;
	for (int i = 0; i < (int)a.length(); i++)
	{
		if (a[i] == b[i])
		{
			s++;
		}
	}
	if (((int)b.length()==(int)a.length()+1 && s==(int)a.length()))
	{
		cout << "Yes" << "\n";
	}
	else
	{
		cout << "No" << "\n";
	}
}

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

int main(){
	int n, maxi =0;
	cin >> n;
	map<string,int> m;
	while(n--){
		string s;
		cin >> s;
		m[s]++;
		maxi = max(maxi,m[s]);

	}
	for(auto const& x: m){
		if (x.second == maxi) cout << x.first << endl;
	}
	
 }


Measured memory_bytes: 25216
#include<iostream>
using namespace std;
int main(){
  int n,m=0;
  cin >> n;
  if(n >= 105) m++;
  if(n >= 135) m++;
  if(n >= 165) m++;
  if(n >= 189) m++;
  if(n >= 195) m++;
  cout << m << endl;
  return 0;
}

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


#define li          long long int
#define rep(i,to)   for(li i=0;i<((li)(to));i++)
#define repp(i,start,to)    for(li i=(li)(start);i<((li)(to));i++)
#define pb          push_back
#define sz(v)       ((li)(v).size())
#define bgn(v)      ((v).begin())
#define eend(v)     ((v).end())
#define allof(v)    (v).begin(), (v).end()
#define dodp(v,n)       memset(v,(li)n,sizeof(v))
#define bit(n)      (1ll<<(li)(n))
#define mp(a,b)     make_pair(a,b)
#define rin rep(i,n)
#define EPS 1e-12
#define ETOL 1e-8
#define MOD 1000000007
typedef pair<li, li> PI;

#define INF bit(60)

#define DBGP 1


#define idp if(DBGP)
#define F first
#define S second
#define p2(a,b)     idp cout<<a<<"\t"<<b<<endl
#define p3(a,b,c)       idp cout<<a<<"\t"<<b<<"\t"<<c<<endl
#define p4(a,b,c,d)     idp cout<<a<<"\t"<<b<<"\t"<<c<<"\t"<<d<<endl
#define p5(a,b,c,d,e)       idp cout<<a<<"\t"<<b<<"\t"<<c<<"\t"<<d<<"\t"<<e<<endl
#define p6(a,b,c,d,e,f)     idp cout<<a<<"\t"<<b<<"\t"<<c<<"\t"<<d<<"\t"<<e<<"\t"<<f<<endl
#define p7(a,b,c,d,e,f,g)       idp cout<<a<<"\t"<<b<<"\t"<<c<<"\t"<<d<<"\t"<<e<<"\t"<<f<<"\t"<<g<<endl
#define p8(a,b,c,d,e,f,g,h)     idp cout<<a<<"\t"<<b<<"\t"<<c<<"\t"<<d<<"\t"<<e<<"\t"<<f<<"\t"<<g<<"\t"<<h<<endl
#define p9(a,b,c,d,e,f,g,h,i)       idp cout<<a<<"\t"<<b<<"\t"<<c<<"\t"<<d<<"\t"<<e<<"\t"<<f<<"\t"<<g<<"\t"<<h<<"\t"<<i<<endl
#define p10(a,b,c,d,e,f,g,h,i,j)        idp cout<<a<<"\t"<<b<<"\t"<<c<<"\t"<<d<<"\t"<<e<<"\t"<<f<<"\t"<<g<<"\t"<<h<<"\t"<<i<<"\t"<<j<<endl
#define foreach(it,v)   for(__typeof((v).begin()) it=(v).begin(); it!=(v).end(); ++it)
#define p2p(x)      idp p2((x).F, (x).S)
#define dump(x,n)   idp{rep(i,n){cout<<x[i]<<" ";}puts("");}
#define dump2(x,n)  idp{rep(i,n){cout<<"["<<x[i].F<<" , "<<x[i].S<<"] ";}puts("");}
#define dumpi(x)    idp{foreach(it, x){cout<<(*it)<<" ";}puts("");}
#define dumpi2(x)   idp{foreach(it, x){cout<<"["<<(it)->F<<" , "<<(it)->S<<"] ";}puts("");}

#define read2d(a,w,h)   rep(i,h)rep(j,w)cin>>a[i][j]
#define dump2d(a,w,h)   rep(i,h){rep(j,w)cout<<a[i][j]<<" ";puts("");}

typedef pair<li, li> PI;

vector<li> edge[100100];
li h[100100];
li n, m;

int main() {
    cin >> n >> m;
    rin{
        cin >> h[i];
    }
    rep(i, m) {
        li a, b;
        cin >> a >> b;
        a--;
        b--;
        edge[a].pb(b);
        edge[b].pb(a);
    }

    li res = 0;
    rin{
        bool ok = true;
        for (auto next : edge[i]) {
            if (h[next] >= h[i]) {
                ok = false;
                break;
            }
        }
        if (ok) {
            res++;
        }
    }
    cout << res << endl;

    return 0;
}

Measured memory_bytes: 10256
#from math import gcd

from math import factorial as f

from math import ceil,floor,sqrt


import bisect
import re
import heapq


from copy import deepcopy
import itertools

from sys import exit

ii = lambda : int(input())
mi = lambda : map(int,input().split())
li = lambda : list(map(int,input().split()))


yes = "Yes"
no = "No"

def main():
    a,b,c,k = mi()
    ans = 0
    ans+=min(a,k)
    k-=a
    if k<=0:
        print(ans)
        exit()
    k-=b
    if k<=0:
        print(ans)
        exit()
    print(ans-k)





main()




Measured memory_bytes: 10024
#include<bits/stdc++.h>
using namespace std;
int main()
{
	long long a;
	string b;
	cin>>a>>b;
	int ans;
	ans+=(b[0]-'0')*100;
	ans+=(b[2]-'0')*10;
	ans+=(b[3]-'0');
	long long d=a*ans/100; 
	cout<<d<<endl;
}

Measured memory_bytes: 3612
#include <bits/stdc++.h>
#define FOR(i, a, b) for (int i = (a); i <= (b); i++)
#define RFOR(i, a, b) for (int i = (a); i >= (b); i--)
#define LFOR(i, a, b) for (long long int i = (a); i <= (b); i++)
#define LRFOR(i, a, b) for (long long int i = (a); i >= (b); i--)
#define MOD 1000000007
#define INF 1000000000           // 2000000000
#define LINF 1000000000000000000 // 9000000000000000000
#define DINF 1000000000000000.0
#define PI 3.14159265358979

//.size()はunsigned int　0-1をするとオーバーフローする

using namespace std;
typedef long long int ll;
typedef pair<long long int, long long int> P;

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

int main(void) {
    int a,b,c;

    cin>>a>>b>>c;

    if(b+c<=a){
        cout<<0<<endl;
    }else{
        cout<<b+c-a<<endl;
    }
}


Measured memory_bytes: 256
# -*- coding: utf-8 -*-
from collections import defaultdict

n = int(input())
sd = defaultdict(int)
for _ in range(n):
    s = input()
    sd[s] += 1

m = int(input())
td = defaultdict(int)
for _ in range(m):
    t = input()
    td[t] += 1

res = 0
for s in sd:
    res = max(res, sd[s] - td[s])
print(res)

Measured memory_bytes: 3316
#include <bits/stdc++.h>
using namespace std;
 
int main(){
int i;
int r;
int D;
int x[11];
 cin >> r >> D >> x[0];
for(i=1;i<11;i++){
  x[i]=r*x[i-1]-D;
  cout << x[i] << endl;
}
}

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

#define INF_LL (int64)1e18
//#define INF (int32)1e9
#define REP(i, n) for(int64 i = 0;i < (n);i++)
#define FOR(i, a, b) for(int64 i = (a);i < (b);i++)
#define all(x) x.begin(),x.end()
#define fs first
#define sc second

using int32 = int_fast32_t;
using uint32 = uint_fast32_t;
using int64 = int_fast64_t;
using uint64 = uint_fast64_t;
using PII = pair<int32, int32>;
using PLL = pair<int64, int64>;

const double eps = 1e-10;

template<typename A, typename B>inline void chmin(A &a, B b){if(a > b) a = b;}
template<typename A, typename B>inline void chmax(A &a, B b){if(a < b) a = b;}

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

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

template<typename T,typename U,typename... V>
typename enable_if<is_same<T, U>::value!=0>::type
fill_v(U &u,const V... v){u=U(v...);}

template<typename T,typename U,typename... V>
typename enable_if<is_same<T, U>::value==0>::type
fill_v(U &u,const V... v){
  for(auto &e:u) fill_v<T>(e,v...);
}


constexpr int64 mod = 1e9+7;

int main(void) {
    int64 A, B, C;
    cin >> A >> B >> C;
    cout << max((int64)0, C-max((int64)0, A-B)) << endl;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i, n) for (ll i = 0; i < (ll)(n); ++i)
#define rep2(i, s, n) for (ll i = s; i < (ll)(n); i++)
#define repr(i, n) for (ll i = n; i >= 0; i--)
#define pb push_back
#define COUT(x) cout << (x) << endl
#define COUTF(x) cout << setprecision(15) << (x) << endl
#define ENDL cout << endl
#define DF(x) x.erase(x.begin())  // 先頭文字削除
#define ALL(x) x.begin(), x.end()
#define SORT(x) sort(ALL(x))
#define REVERSE(x) reverse(ALL(x))
#define ANS cout << ans << endl
#define RETURN(x)    \
  cout << x << endl; \
  return 0
#define init() \
  cin.tie(0);  \
  ios::sync_with_stdio(false)
#define debug(x) cerr << "[debug] " << #x << ": " << x << endl;
#define debugV(v)                       \
  cerr << "[debugV] " << #v << ":";     \
  rep(i, v.size()) cerr << " " << v[i]; \
  cerr << endl;
using namespace std;
using ll = long long;
using ld = long double;
using vll = vector<ll>;
using P = pair<ll, ll>;
constexpr ll INF = 0x3f3f3f3f3f3f3f3f;
constexpr ld PI = 3.141592653589793238462643383279;
ll get_digit(ll x) {
  return to_string(x).size();
}

ll gcd(ll x, ll y) {
  return y ? gcd(y, x % y) : x;
}

ll lcm(ll a, ll b) {
  return a / gcd(a, b) * b;
}

vector<P> factorize(ll n) {
  vector<P> result;
  for (ll i = 2; i * i <= n; ++i) {
    if (n % i == 0) {
      result.pb({i, 0});
      while (n % i == 0) {
        n /= i;
        result.back().second++;
      }
    }
  }
  if (n != 1) {
    result.pb({n, 1});
  }
  return result;
}

vll divisor(ll n) {
  vll ret;
  for (ll i = 1; i * i <= n; i++) {
    if (n % i == 0) {
      ret.push_back(i);
      if (i * i != n) ret.push_back(n / i);
    }
  }
  SORT(ret);
  return (ret);
}

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

signed main() {
  init();
  ll N;
  cin >> N;
  string S;
  cin >> S;

  vector<vll> alpha(26);
  rep(i, S.size()) {
    ll index = S[i] - 'a';
    alpha[index].pb(i);
  }

  ll Q;
  cin >> Q;

  rep(i, Q) {
    int type;
    cin >> type;
    if (type == 1) {
      ll a;
      char b;
      cin >> a >> b;
      --a;
      if (b == S[a]) {
        continue;
      }

      // --
      ll index = S[a] - 'a';
      alpha[index].erase(find(ALL(alpha[index]), a));

      S[a] = b;

      // ++
      auto lb = lower_bound(ALL(alpha[b - 'a']), a);
      alpha[b - 'a'].insert(lb, a);
    } else {
      int a, b;
      cin >> a >> b;
      --a;
      --b;
      ll ans = 0;
      rep(i, alpha.size()) {
        if (alpha[i].size() == 0) continue;
        ll lb = lower_bound(ALL(alpha[i]), a) - alpha[i].begin();
        ll ub = upper_bound(ALL(alpha[i]), b) - alpha[i].begin();
        if (lb <= (ll)alpha[i].size() - 1 && lb != ub) {
          ans++;
        }
      }
      ANS;
    }
  }
  return 0;
}

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

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

#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define all(x) (x).begin(),(x).end()
#define rall(x) (x).rbegin(),(x).rend()

void YN(bool flg){if(flg) cout << "YES" << endl; else cout << "NO" << endl;}
void Yn(bool flg){if(flg) cout << "Yes" << endl; else cout << "No" << endl;}
void yn(bool flg){if(flg) cout << "yes" << endl; else cout << "no" << endl;}

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

const int M = 1000005;

int main()
{   
    int n;
    cin >> n;
    vi a(n);
    rep(i, n) cin >> a[i];

    vi cnt(M);
    for(int x : a) {
        if(cnt[x] != 0) {
            cnt[x] = 2;
            continue;
        }
        for(int i = x; i < M; i += x) cnt[i]++;
    }
    int ans = 0;
    for(int x : a) {
        if(cnt[x] == 1) ans++;
    }
    cout << ans << endl;
    

    return 0;
}


Measured memory_bytes: 7976
#include <stdio.h>

void check_a_is_larger_than_b(int *a,int *b);

int main(){
   int a, b; 
   scanf("%d %d",&a,&b);
   check_a_is_larger_than_b(&a,&b);
   while(a%b!=0){
      a=a%b;
      check_a_is_larger_than_b(&a,&b);
   }
   printf("%d\n",b);
   return 0;
}

void check_a_is_larger_than_b(int *a,int *b){
   int tmp;
   if(*a<*b){ tmp=*a; *a=*b; *b=tmp; }
}

Measured memory_bytes: 592
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#ifdef ONLINE_JUDGE
#define LLD "%I64d"
#else
#define LLD "%lld"
#endif
#define fu(a,b,c) for(int a=b;a<=(int)c;++a)
#define fd(a,b,c) for(int a=b;a>=(int)c;--a)
#define cu(a,b,c) for(int a=b;a<(int)c;++a)
#define cd(a,b,c) for(int a=(b)-1;a>=(int)c;--a)
#define gcd(a,b) __gcd(a,b) 
#define pii pair<int,int>
#define pll pair<long long,long long>
#define all(a) a.begin(),a.end()
#define F first
#define S second
#define pb push_back
#define pf push_front
#define MOD 1000000007 
#define MAXN 52
#define MAXH 20
#define MAXM 52
#define INF 100000000
#define ll long long
#define ull unsigned long long
#define RNG rng mt19937(time(NULL))
#define udist(a,b) uniform_int_distribution<uint32_t> distribution(a,b)
#define max3(a,b,c) max(a, max(b, c))
#define min3(a,b,c) min(a, min(b, c))
#define gmax(a,b) a = max(a, b)
#define gmin(a,b) a = min(a, b)
#define whatis(x) cerr << #x << " is " << x << endl;
#define fast_io() ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define PI 3.1415926535897932384626433
using namespace std;
using namespace __gnu_pbds;
typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> ordered_set;

ll mod_pow(ll x,ll p){
	if(p == 0)return 1;
	ll y = 1;
	while(p > 1){
		if(p&1)y = x * y % MOD;
		x = x * x % MOD;
		p>>=1;
	}
	return x * y % MOD;;
}

const int N = 200005;
ll fac[N],inv[N];

inline ll mul(ll x,ll y){
	return x * y % MOD;
}

inline ll inverse(ll x){
	return mod_pow(x, MOD - 2);	
}

ll comb(ll n, ll k){
	ll res = mul(fac[n],inv[k]);
	res = mul(res, inv[n-k]);
	return res;
}

int main(){
	ll n,a,b,c;
	cin >> n >> a >> b >> c;	
	fac[0] = inv[0] = 1;
	cu(i,1,N){
		fac[i] = fac[i-1] * i % MOD;
		inv[i] = inverse(fac[i]);
	}
	ll expa = 0;
	cu(i,0,n){
		ll len = mul(n + i,1 + c * inverse(100 - c));
		ll aprob = mul(mod_pow(a,n),inverse(mod_pow(100-c,n)));
		ll bprob = mul(mod_pow(b,i),inverse(mod_pow(100-c,i)));
		ll prob = mul(comb(n - 1 + i, n - 1), mul(aprob, bprob));
		expa = (expa + mul(len, prob)) % MOD;
	}
	cu(i,0,n){
		ll len = mul(n + i,1 + c * inverse(100 - c));
		ll aprob = mul(mod_pow(a,i),inverse(mod_pow(100-c,i)));
		ll bprob = mul(mod_pow(b,n),inverse(mod_pow(100-c,n)));
		ll prob = mul(comb(n - 1 + i, n - 1), mul(aprob, bprob));
		expa = (expa + mul(len, prob)) % MOD;
	}
	cout << expa << '\n';
}


Measured memory_bytes: 3456
#include <bits/stdc++.h>
         
using namespace std;
     
int main(){
  int a,b,c,d; cin >> a >> b >> c >> d;
  if(a+b>c+d) cout << "Left" << endl;
  else if(a+b==c+d) cout << "Balanced" << endl;
  else cout << "Right" << endl;
      
  return 0;
}


Measured memory_bytes: 256
#include <iostream>
using namespace std;
int main(void){
  string S;
  int K;
  bool iti = true;
  cin >> S >> K;
  for(int i = 0; K > i; i++){
    if(S.at(i) != '1'){
      cout << S.at(i) << endl;
      iti = false;
      break;
    }
  }
  if(iti){
    cout << 1 << endl;
  }
  return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <algorithm>
#include <cmath>
#include <string>
#include <sstream>
#include <vector>
#include <queue>
#include <set>
#include <map>
#include <ctime>

#define inf 0x3f3f3f3f
#define Inf 0x3FFFFFFFFFFFFFFFLL
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define Rep(i, n) for (int i = 1; i <= (n); ++i)
#define clr(x, a) memset(x, (a), sizeof x)
using namespace std;
typedef long long ll;

int main() {
  int n;
  cin >> n;
  cout << (n + 1) / 2 << endl;
  return 0;
}



Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main()
{
    int n=0,i;
    string s;
    cin>>s;
    for(i=0;i<4;i++)
    {
        if(s[i]=='+')
            n++;
        else
            n--;
    }
    cout<<n<<endl;

    return 0;
}

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

#define rep(i, n) for (ll i = 0; i < (n); i++)
#define rep2(i, a, b) for (ll i = (a); i < (b); i++)
typedef uint64_t ull;
typedef int64_t ll;
typedef std::pair<ll, ll> PLL;

using namespace std;

// {{{ Modint
template <std::int64_t M>
class modint {
 public:
  int64_t a;

  explicit constexpr modint(const int64_t x = 0) noexcept :
    a((x % M + M) % M) {}
  constexpr int64_t &value() noexcept { return a; }
  constexpr const int64_t &value() const noexcept { return a; }
  constexpr modint operator+(const modint rhs) const noexcept {
    return modint(*this) += rhs;
  }
  constexpr modint operator-(const modint rhs) const noexcept {
    return modint(*this) -= rhs;
  }
  constexpr modint operator*(const modint rhs) const noexcept {
    return modint(*this) *= rhs;
  }
  constexpr modint operator/(const modint rhs) const noexcept {
    return modint(*this) /= rhs;
  }
  constexpr modint &operator+=(const modint rhs) noexcept {
    a += rhs.a;
    if (a >= M) {
      a -= M;
    }
    return *this;
  }
  constexpr modint &operator-=(const modint rhs) noexcept {
    if (a < rhs.a) {
      a += M;
    }
    a -= rhs.a;
    return *this;
  }
  constexpr modint &operator*=(const modint rhs) noexcept {
    a = a * rhs.a % M;
    return *this;
  }
  constexpr modint &operator/=(modint rhs) noexcept {
    int64_t exp = M - 2;
    while (exp) {
      if (exp % 2) {
        *this *= rhs;
      }
      rhs *= rhs;
      exp /= 2;
    }
    return *this;
  }
};
// }}}

signed main() {
  ll x, y;
  cin >> x >> y;
  if ((x+y)%3 != 0) {
    cout << 0 << endl;
    return 0;
  }

  ll n = (x+y)/3;
  ll k = y-n;
  if (k < 0 || k > n) {
    cout << 0 << endl;
    return 0;
  }
  using mint = modint<1000000007>;
  mint ans(1);
  for (ll i = n; i > n-k; i--)
    ans *= mint(i);
  for (ll i = 1; i <= k; i++)
    ans /= mint(i);

  cout << ans.value() << endl;
}


Measured memory_bytes: 256
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {

	public static void main(String[] args) {
		// ?¨??????\????????????
		//BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		
		String line = null;
		try {
			line = br.readLine();
		} catch (IOException e) {
			e.printStackTrace();
		}
		
		int x = Integer.parseInt(line);
		
		System.out.println(x*x*x);
	}

}

Measured memory_bytes: 24144
#include <iostream>
#include <cmath>
#include <vector>
#include <string>
#include <map>
#include <queue>
#include <algorithm>
#include <numeric>
#include <fstream>
#include <iomanip>

typedef long double ld;
typedef long long ll;
const ll INF = (ll)1e18 + 1;
const ll MOD = 1e9 + 7;

// Output
template<class T, class S> std::ostream& operator <<(std::ostream& os, std::pair<T, S> p)
{
  return os << "(" << p.first << " " << p.second << ")";
}

template<class T> std::ostream& operator <<(std::ostream& os, std::vector< T > v)
{
  for (ll i = 0; i < (ll)v.size(); i++){ os << " [" << i << "]" << v[i]; if (i % 10 == 9) os << std::endl; }
  //os << v[0]; for (ll i = 1; i < (ll)v.size(); i++){ os << " " << v[i]; }
  return os;
}

template<class T, class S> std::ostream& operator <<(std::ostream& os, std::map< T, S > m)
{
  ll i = 0; for (auto p : m){ os << " [" << i << "]" << p.first << "->" << p.second; i++;}
  return os;
}

template<class T> std::ostream& operator <<(std::ostream& os, std::vector< std::vector<T> > vv)
{
  for (auto& vec : vv){ os << vec << std::endl; }
  os << "--------" << std::endl;
  return os;
}

void print(){ std::cout << std::endl; }
template<typename H> void print(H&& head){ std::cout << head << std::endl; }
template<typename H, typename... T> void print(H&& head, T&&... tail){
  std::cout << head << " ", print(std::forward<T>(tail)...);
}

void solve()
{
  ll N;
  std::string S;
  std::cin >> N >> S;

  std::vector< std::vector<ll> > cnt(N, std::vector<ll>(10, 0LL));
  cnt[0][S[0] - '0'] = 1;
  for (ll i = 1; i < N; i++) {
    cnt[i][S[i] - '0'] = 1;
    for (ll j = 0; j <= 9; j++) {
      cnt[i][j] += cnt[i-1][j];
    }
  }

  std::map<std::string, bool> mp;
  for (char x = '0'; x <= '9'; x++) {
    for (char y = '0'; y <= '9'; y++) {
      for (char z = '0'; z <= '9'; z++) {
        std::string key;
        key += x; key += y; key += z;
        for (ll i = 1; i <= N-2; i++) {
          if ((cnt[0][x - '0'] > 0 || cnt[i-1][x - '0'] - cnt[0][x - '0'] > 0) &&
              S[i] == y &&
              cnt[N-1][z - '0'] - cnt[i][z - '0'] > 0) {
            mp[key] = true;
          }
        }
      }
    }
  }

  print(mp.size());
  return;
}

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

  solve();
  return 0;
}



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

int N, M, Q;
vector<int> a, b, c, d;

int score(vector<int> A) {
    int res = 0;
    rep(i, Q) if (A[b[i]] - A[a[i]] == c[i]) res += d[i];
    return res;
}

int main() {
    cin >> N >> M >> Q;
    a.resize(Q); b.resize(Q); c.resize(Q); d.resize(Q);
    rep(i, Q){
        cin >> a[i] >> b[i] >> c[i] >> d[i];
        a[i]--, b[i]--;
    }

    queue<vector<int>> que;
    rep(i, M){
        vector<int> q = {i+1};
        que.push(q);
    }

    int ans = 0;
    while (!que.empty()){
        vector<int> elem = que.front();
        que.pop();
        if (elem.size()==N) ans = max(ans, score(elem));
        else {
            repi(i, elem[elem.size()-1], M+1){
                vector<int> elem_new = elem;
                elem_new.push_back(i);
                que.push(elem_new);
            }
        }
    }
    cout << ans << endl;
}

Measured memory_bytes: 9756
#include <iostream>
#include <algorithm>
#include <sstream>
#include <iomanip>
#include <vector>
#include <deque>
#include <queue>
#include <stack>
#include <map>
#include <set>
#include <unordered_map>
#include <unordered_set>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
#define rep(i,n) for (int i=0;i<(n);i++)
#define all(a) (a).begin(),(a).end()
#define reunique(v) v.erase(unique(v.begin(),v.end()),v.end())
#define RET(p,x) return p<<x<<endl,0;
#define Debug(x) cerr<<#x<<" = "<<x<<endl
const int inf=1e9;
const ll h1=239017;
const ll h2=731604233;
const ll mod=1000000007;
const ll mod2=1000000009;
const int dx[]={1,0,-1,0,1,0,-1,0};
const int dy[]={0,1,0,-1,1,0,-1,0};
ll n,k,ans=0;
signed main()
{
	ios_base::sync_with_stdio();cin.tie();cout.tie();
	cout<<setprecision(15);
	cin>>n>>k;
	for (ll i=k+1;i<=n;++i) for (ll j=0;j*i+k<=n;++j) ans+=max(0LL,min(i-k,n-j*i-k+1));
	if (!k) ans-=n;
	cout<<ans<<endl;
	return 0;
}

Measured memory_bytes: 256
c = [list(map(int, input().split())) for i in range(3)]

f = c[0][0]
s = c[0][1] - f
t = c[0][2] - f

for i in c:
    i_f = i[0]

    if i[1] != i_f + s or i[2] != i_f + t:
        print("No")
        exit()

print("Yes")


Measured memory_bytes: 3060
$<.map{|i|a=i.split(?,).map(&:to_i).sort;c,b=a.uniq.map{|j|a.count(j)}.sort[-2..-1];puts b>3?"four card":b>2?c<2?"three card":"full house":b>1?c<2?"one pair":"two pair":a[4]-a[0]<5||a[1]>9?:straight: :null}

Measured memory_bytes: 8584
#include <iostream>
#include <algorithm>
#include <set>
#include<map>
#include <queue>

using namespace std;

int N;
long long int C, h[200005];
long long int a[200005], b[200005], dp[200005];
long long int INF = 1199999999999999999;

deque<int> deq;


long double x_val(int m, int k) {

	long double ret;
	return ret = 1.0L*(b[k] - b[m]) / (a[m] - a[k]);
}

void ADD(int k ) {

	while (deq.size() >=2) {
		int Y= deq.size();
		int m = deq[Y - 2];
		int n = deq[Y - 1];

		if (x_val(m, k) < x_val(n, k)) { break; }
		else { deq.pop_back(); }

	}

	deq.push_back(k);
}

long long int EVAL(long long int x) {

	int m = deq[0];

	long long int ret = a[m] * x + b[m];

	while(deq.size() >= 2) {
		m = deq[0];
		int n = deq[1];

		if (a[m] * x + b[m] > a[n] * x + b[n]) {
			ret = a[n] * x + b[n];
			deq.pop_front();
		}
		else {
			break;
		}
	}

	return ret;

}

int main(void) {

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

	for (int i = 2; i <= N; i++) { dp[i] = INF; }

	dp[1] = 0;

	a[1] = -h[1] * 2;
	b[1] = dp[1] + h[1] * h[1];

	deq.push_back(1);


	for (int i = 2; i <= N; i++) {

		dp[i] = h[i]*h[i]+C+EVAL(h[i]);
		
		a[i] = -h[i] * 2;
		b[i] = dp[i] + h[i] * h[i];
		
		ADD(i);
	}

	cout << dp[N] << endl;
	

	return 0;
}

Measured memory_bytes: 7040
#include<cstdio>
#include<cstring>
#include<vector>
#include<queue>
#include<algorithm>
#include<cmath>
#include<climits>
#include<string>
#include<set>
#include<numeric>
#include<map>
#include<iostream>
#include<iomanip>
using namespace std;
#define rep(i,n) for(int i = 0;i<((int)(n));i++)
#define reg(i,a,b) for(int i = ((int)(a));i<=((int)(b));i++)
#define irep(i,n) for(int i = ((int)(n)-1);i>=0;i--)
#define ireg(i,a,b) for(int i = ((int)(b));i>=((int)(a));i--)
typedef long long ll;
typedef pair<ll, ll> mp;


/*
lからrまでのスライムを合体させる最小コスト
*/


ll n,a[410],dp[410][410],dp2[410],mod=1e9+7,ans=0;

ll f(ll l,ll r){
	if(l==r)return 0;
	if(dp[l][r]!=0)return dp[l][r];
	ll smallest=1e18;
	reg(i,l,r-1){
		smallest = min(smallest, f(l,i)+f(i+1,r));
	}
	return dp[l][r]=smallest+dp2[r]-dp2[l-1];
}

int main(void){
	cin>>n;
	reg(i,1,n)cin>>a[i];
	//
	dp2[0]=0;
	reg(i,1,n)dp2[i]=dp2[i-1]+a[i];
	reg(i,1,n)rep(j,n)dp[i][j]=0;
	//
	cout<<f(1,n)<<endl;
	return 0;
}

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

int main()
{
	int N;
	cin >> N;
	vector<long long> A( N );
	for( int i = 0; i < N; i++ ) {
		cin >> A[i];
	}

	vector<long long> S( N + 1 );
	for( int i = 1; i < N + 1; i++ ) {
		S[i] = S[i - 1] + A[i - 1];
	}
	map<long long, long long> mp;
	for( int i = 0; i < N + 1; i++ ) {
		mp[ S[i] ]++;
	}
	long long ans = 0;
	for( auto it = mp.begin(); it != mp.end(); it++ ) {
		if( it->second > 1 ) {
			long long n = it->second;
			ans += n * (n - 1) / 2;
		}
	}

	cout << ans << endl;
}


Measured memory_bytes: 15872
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<n;i++)
#define FOR(i,start,end) for(int i=start;i<=end;i++)
const int INF = 1001001001;
#define all(a) a.begin(), a.end()
#define rall(a) a.rbegin(), a.rend()
#define Sort(a) sort(a.begin(), a.end())
#define Rort(a) sort(a.rbegin(), a.rend())
typedef long long ll;
const ll MOD=1000000007;
using namespace std;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
template<class T>auto MAX(const T& a) { return *max_element(a.begin(),a.end()); }
template<class T>auto MIN(const T& a) { return *min_element(a.begin(),a.end()); }
template<class T, class U>U SUM(const T& a, const U& v) { return accumulate(a.begin(),a.end(), v); }
template<class T, class U>U COUNT(const T& a, const U& v) { return count(a.begin(),a.end(), v); }
template<class T, class U>int LOWER(const T& a, const U& v) { return lower_bound(a.begin(),a.end(), v) - a.begin(); }
template<class T, class U>int UPPER(const T& a, const U& v) { return upper_bound(a.begin(),a.end(), v) - a.begin(); }
int GCD(int a, int b) { return b ? GCD(b, a%b) : a; }
int LCM(int a, int b) { int g = GCD(a, b); return a / g * b; }
typedef long double ld;
typedef unsigned long long int ull;
typedef pair<int,int> P;
typedef vector<int> vi;
typedef vector<char> vc;
typedef vector<bool> vb;
typedef vector<double> vd;
typedef vector<string> vs;
typedef vector<ll> vll;
typedef vector<pair<int, int>> vpii;
typedef vector<pair<ll, ll>> vpll;
typedef vector<vi> vvi;
typedef vector<vvi> vvvi;
typedef vector<vc> vvc;
typedef vector<vs> vvs;
typedef vector<vll> vvll;
typedef map<int, int> mii;
typedef set<int> si;
//---------------------------------------------------------------------------------------------------

int main(void){
    // Your code here!
    int n; cin >> n;
    string s,t; cin >> s >> t;
    int ans = 2*n;
    int now = 0;
    FOR(i,1,n) {
        if (s.substr(n-i,i) == t.substr(0,i)) {
            now = max(now,i);
        }
    }
    cout << max(n,ans-now) << endl;
}


Measured memory_bytes: 3636
import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int m1 = sc.nextInt();
        int d1 = sc.nextInt();
        int m2 = sc.nextInt();
        int d2 = sc.nextInt();

        if(d2 == 1){
            System.out.println("1");
        }else{
            System.out.println("0");
        }
    }
}


Measured memory_bytes: 23764
#define _USE_MATH_DEFINES
#include <bits/stdc++.h>
#define dump(x) cout << x << endl
typedef int64_t Int;

using namespace std;
using Graph = vector<vector<Int>>;

const double pi = M_PI;
const Int MOD = 1000000007;

int main() {
    Int n, a, b, c, d, e;
    cin >> n >> a >> b >> c >> d >> e;
    Int m = 0;
    m = min({a, b, c, d, e});
    Int ans;
    if (n % m == 0) {
        ans = n / m;
    } else {
        ans = n / m + 1;
    }
    ans += 4;

    cout << ans << endl;

    return 0;
}


Measured memory_bytes: 256
#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<iomanip>
#include<math.h>
#include<complex>
#include<queue>
#include<deque>
#include<stack>
#include<map>
#include<set>
#include<bitset>
#include<functional>
#include<assert.h>
#include<numeric>
using namespace std;
#define REP(i,m,n) for(int i=(int)(m) ; i < (int) (n) ; ++i )
#define rep(i,n) REP(i,0,n)
using ll = long long;
const int inf = 1e9 + 7;
const ll longinf = 1LL << 60;
const ll mod = 1e9 + 7;


int x, y;



int main(){

	cin >> x >> y;
	cout << x + y / 2 << endl;

	return 0;
}



Measured memory_bytes: 256
#include <algorithm>
#include <cmath>
#include <deque>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <string>
#include <utility>
#include <vector>
#define MOD 1000000007
using namespace std;
typedef long long ll;
#include <cstring>

int main() {
  int n;
  cin >> n;
  cout << 10 - n / 200 << endl;
}

Measured memory_bytes: 3632
import java.util.Scanner;

public class Main {

	Scanner sc;
	int[] table = new int[ 50001 ];
	int[] prime = new int[ 50001 ];
	int pCounter = 0;

	private Main(){
		sc = new Scanner( System.in );
		table[ 1 ] = 1;
		for( int i = 2; i < table.length; i++ ){
			table[ i ] = 0;
		}
		for( int i = 2; i < table.length; i++ ){
			if( table[ i ] == 1 ){ continue; }
			prime[ pCounter++ ] = i;
			for( int j = i * 2; j < table.length; j += i){
				table[ j ] = 1;
			}
		}
	}

	private void run(){
		while( true ){
			int n = sc.nextInt();
			if( n == 0 ){ break; }
			int counter = 0;

			for( int i = 0; prime[ i ] <= n / 2; i++ ){
				int cN = n - prime[ i ];
				if( table[ cN ] == 0 ){ counter++; }
			}
			System.out.println( counter );
		}
	}
	public static void main( String[] args ){
		new Main().run();
	}
}

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

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = Integer.parseInt(sc.next());
		int M = Integer.parseInt(sc.next());
		int X = Integer.parseInt(sc.next());
		int Y = Integer.parseInt(sc.next());
		int[] x = new int[N];
		int[] y = new int[M];
		for (int i = 0; i < N; i++) {
			x[i] = Integer.parseInt(sc.next());
		}
		for (int i = 0; i < M; i++) {
			y[i] = Integer.parseInt(sc.next());
		}
		Arrays.sort(x);
		Arrays.sort(y);
		int Z = y[0];
		if (X < Z && Z <= Y && x[x.length - 1] < Z) {
			System.out.println("No War");
		} else {
			System.out.println("War");
		}

		sc.close();

	}
}

Measured memory_bytes: 21844