akhauriyash/Code-Regression huggingface dataset:
#include<bits/stdc++.h>
using namespace std;
int n,m,k,t;
double f[305][305][305];
double solve(int x,int y,int z)
{
	if(f[x][y][z]!=-1) return f[x][y][z];
	double ret=0;
	if(x>0) ret+=(solve(x-1,y,z))*(x*1.0)/((x+y+z)*1.0);
	if(y>0) ret+=(solve(x+1,y-1,z))*(y*1.0)/((x+y+z)*1.0);
	if(z>0) ret+=(solve(x,y+1,z-1))*(z*1.0)/((x+y+z)*1.0);
	ret+=(t*1.0)/((x+y+z)*1.0);
	//ret+=1.0*(x+y+z)/(t*1.0);
	//if(x+y+z<t) ret+=(t*1.0)/((t-x-y-z)*1.0);
	//printf("f(%d,%d,%d)=%lf\n",x,y,z,ret);
	return f[x][y][z]=ret;
}
int main()
{
	scanf("%d",&t);
	for(int i=1;i<=t;i++) 
	{
		int x;
		scanf("%d",&x);
		if(x==1) n++;
		if(x==2) m++;
		if(x==3) k++;
	}
	for(int i=0;i<=t;i++) for(int j=0;j<=t;j++) for(int k=0;k<=t;k++) f[i][j][k]=-1;
	f[0][0][0]=0;
	printf("%.12lf\n",solve(n,m,k));
	return 0;
 } 

Measured memory_bytes: 219392
#region Using directives
using System;
using static System.Console;
using static System.Convert;
using System.Collections.Generic;
using System.Linq;
#endregion
 
namespace ConsoleApp2
{
    class Program
    {
        static void Main(string[] args)
        {
            string[] s = (ReadLine()).Split();
            long N = ToInt64(s[0]);
            long M = ToInt64(s[1]);
            long K = ToInt64(s[2]);
            if (K % N == 0 || K % M == 0)
            {
                WriteLine("Yes");
                ReadKey();
                return;
            }
            for (long i = 1; i <= N; i++)
            {
                long answ = 0;
                for(long j = 1; j <= M; j++)
                {
                    answ = i*j + (N-i)*(M-j);
                    if (answ == K)
                    {
                        WriteLine("Yes");
                        ReadKey();
                        return;
                    }
                }
            }
            WriteLine("No");
            ReadKey();
        }
    }
}

Measured memory_bytes: 13268
#include <stdio.h>
int main()
{
    int n, i, p, max=-1000000, min=1000000;
    long long int sum=0;
    scanf("%d", &n);
    for(i=0; i<n; i++){
        scanf("%d", &p);
        if(p<min){
            min = p;
        }
        if(p>max){
            max=p;
        }
        sum+=p;
    }
    printf("%d %d %lld\n", min, max, sum);
    return 0;
}

     


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

int main()
{
    int K;
    cin >> K;
    int even = 0, odd = 0;
    for (int i = 1; i <= K; i++)
    {
        if (i % 2 == 0)
            even++;
        else
            odd++;
    }
    cout << even * odd << endl;
    return 0;
}

Measured memory_bytes: 256
#include <algorithm>
#include <iostream>
#include <math.h>
#include <stdio.h>
#include <string>
#include <sstream>
#include <vector>
#include <set>
#include <stack>
#include <map>
#include <cmath>
#include <queue>
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
using namespace std;
typedef long long ll;
#define MAX_N 2000000

int main()
{
	int n;
	cin>>n;
	int number = n;
	vector<int> factorList;
	for(int i = 2; i*i <= n; i++){
		while( number % i == 0 ){
			factorList.push_back(i);
			number = number / i;
			//cout<<number<<":"<<i<<endl;
		}
	}
	if(number != 1) factorList.push_back(number);
	if( number == n){
		cout<<n<<":"<<" "<<n<<endl;
	}else{
		cout<<n<<":";
		rep(i,factorList.size()){
			cout<<" "<<factorList[i];
		}
		cout<<endl;
	}

	return 0;
}




Measured memory_bytes: 3152
#include<stdio.h>
#include<string.h>
#include<math.h>
#include<stdlib.h>
#define ll long long
#define sc scanf
#define  pr printf
#define sl strlen

int main()
{
    
    ll x;
    sc("%lld",&x);
    if(x>=30)
        pr("Yes\n");
    else
        pr("No\n");
   return 0;
}                

Measured memory_bytes: 1656
#include <stdio.h>

int main(){
    int n,m,i,j,x[20],y[20],z[30],p[31],q[31],a[20],b[20],c[20],s;
    char d[i];
    while(1) {
        scanf("%d",&n);
        if (n==0) break;
        for (i=0;i<n;i++) {
            scanf("%d %d",&x[i],&y[i]);
        }
        scanf("%d",&m);
        for (i=0;i<m;i++) {
            getchar();
            scanf("%c %d",&d[i],&z[i]);
        }
        p[0]=10;
        q[0]=10;
        for (i=0;i<m;i++) {
            p[i+1]=p[i];
            q[i+1]=q[i];
            if (d[i]=='N') {q[i+1]=q[i]+z[i];}
            if (d[i]=='S') {q[i+1]=q[i]-z[i];}
            if (d[i]=='E') {p[i+1]=p[i]+z[i];}
            if (d[i]=='W') {p[i+1]=p[i]-z[i];}
        }
        s = 1;
        for (i=0;i<n;i++) {
            c[i] = 0;
            for (j=0;j<m;j++) {
                a[i] = b[i] = 0;
                if ((x[i]<=p[j]&&x[i]>=p[j+1])||(x[i]>=p[j]&&x[i]<=p[j+1])) {
                    a[i]=1;
                }
                if ((y[i]<=q[j]&&y[i]>=q[j+1])||(y[i]>=q[j]&&y[i]<=q[j+1])) {
                    b[i]=1;
                }
                c[i] |= a[i]*b[i];
            }
        }
        for (i=0;i<n;i++) {
            s*=c[i];
        }
        if (s==1) {printf("Yes\n");}
        if (s!=1) {printf("No\n");}
    }
    return 0;
}

Measured memory_bytes: 1016
#include <stdio.h>

const long long sup = (long long)1 << 60;

typedef struct {
	int t, h, cost;
} edge;

int main()
{
	int i, u, w, c, N, M, P;
	edge e[5001];
	scanf("%d %d %d", &N, &M, &P);
	for (i = 0; i < M; i++) {
		scanf("%d %d %d", &u, &w, &c);
		e[i].t = u;
		e[i].h = w;
		e[i].cost = P - c;
	}	

	int k, flag[2501] = {};
	long long min[2501];
	for (i = 2, min[1] = 0; i <= N; i++) min[i] = sup;
	for (k = 1, flag[N] = 1; k < N; k++) {
		for (i = 0; i < M; i++) {
			u = e[i].t;
			w = e[i].h;
			c = e[i].cost;
			if (min[u] < sup && min[w] > min[u] + c) min[w] = min[u] + c;
			if (flag[w] == 1) flag[u] = 1;
		}
	}
	for (i = 0; i < M; i++) {
		u = e[i].t;
		w = e[i].h;
		c = e[i].cost;
		if (min[u] < sup && min[w] > min[u] + c && flag[w] == 1) break;
	}
	
	if (i == M) printf("%lld\n", (min[N] < 0)? -min[N]: 0);
	else printf("-1\n");
	fflush(stdout);
	return 0;
}

Measured memory_bytes: 1772
#include <iostream>
#include <sstream>
#include <cstdio>
#include <stdlib.h>
#include <string>
#include <vector>
#include <algorithm>
using namespace std;

int main(){
  long long a,v,b,w,t;
  cin>>a>>v>>b>>w>>t;
  if(a>b&&(a+(-1)*v*t)<=(b+(-1)*w*t))cout<<"YES"<<endl;
  else if(a<b&&(a+v*t)>=(b+w*t))cout<<"YES"<<endl;
  else cout<<"NO"<<endl;

  return 0;
}


Measured memory_bytes: 3620
module IntMap = Map.Make (struct
  type t = int
  let compare x y = compare y x
end)

let add x s =
  IntMap.add x
    (1 +
      try IntMap.find x s
      with Not_found -> 0) s

let remove x s =
  match IntMap.find x s with
  | exception Not_found -> s
  | 1 -> IntMap.remove x s
  | n -> IntMap.add x (n - 1) s

let () = Scanf.scanf "%d\n" @@ fun n ->
  let ss =
    Array.init (1 lsl n) @@ fun _ ->
      Scanf.scanf "%d " @@ fun s -> s in
  let rec solve (q, ss) = function
    | 0 -> ()
    | n ->
        solve
          (IntMap.fold (fun s n ->
            Array.fold_right (fun () (q, ss) ->
              let (_, _, r) = IntMap.split s q in
              let (s', _) = IntMap.min_binding r in
              (remove s' q, add s' ss)) @@
            Array.make n ()) ss (q, ss)) (n - 1) in
  let q = Array.fold_right add ss IntMap.empty in
  let (s, _) = IntMap.min_binding q in
  print_endline @@
  try solve (remove s q, IntMap.singleton s 1) n; "Yes"
  with Not_found -> "No"



Measured memory_bytes: 32144
#include<bits/stdc++.h>
using namespace std;
using lint = long long;

signed main(){
  lint N, P; cin >> N >> P;
  string s; cin >> s;
  lint ans = 0;
  if(P == 2 || P == 5){
    for(lint i = 0; i < N; i++){
      if((s[N - i - 1] - '0') % P == 0) ans += N - i;
    }
  }
  else{
    map<lint, lint> MAP;
    MAP[0]++;
    lint num = 0, ten = 1;
    for(lint i = 0; i < N; i++){
      ten = (10 * ten) % P;
      num = num + (s[N - i - 1] - '0') * ten;
      num %= P;
      MAP[num]++;
    }
    for(auto value : MAP){
      ans += value.second * (value.second - 1) / 2;
    }
  }
  cout << ans << endl;
}

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

int main()
{
    string s, t;
    cin >> s >> t;
    int x, y;
    x = s.size();
    y = t.size();
    sort(s.begin(),s.end());
    sort(t.begin(),t.end());
    reverse(t.begin(),t.end());

    int n = min(x, y);
    int count = 0;
    for (int i = 0; i < n; i++)
    {
        if (s[i] > t[i])
        {
            cout << "No" << endl;
            break;
        }
        else if (s[i] < t[i])
        {
            cout << "Yes" << endl;
            break;
        }
        count++;
    }
    if (count == n)
    {
        if (x >= y)
        {
            cout << "No" << endl;
        }
        else
        {
            cout << "Yes" << endl;
        }
    }
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
string a, b;
long long dp[25];
map<string, int> mp;
class fastio {
public:
    fastio() {
        ios_base::sync_with_stdio(false);
        cout.tie(nullptr);
        cin.tie(nullptr);
    }
} __fastio;
int fact(int n) {
  if(n == 0) return dp[n] = 1;
  return dp[n] = n * fact(n-1);
}
void solve() {
  /*
  fact(15);
  */
  int n; cin >> n;
  for(int i=0; i<n; i++){
    string s; cin >> s;
    sort(s.begin(), s.end());
    mp[s]++;
  }
  long long ans = 0;
  for(auto it : mp) {
    long long k = it.second;
    /*
    if(k >= 2) {
      ans += (dp[k] / (dp[k-2] * dp[2]));
    }
    */
    ans += (k*(k-1))/2;
  }
  cout << ans << endl;
}
int main() {
  __fastio;
  solve();
  return 0;
}


Measured memory_bytes: 11264
#include <stdio.h>
#include <iostream>
#include <algorithm>
#include <queue>
#include <cstring>
#include <string>
#include <stack>
#include <map>
#include <set>
#include <cmath>
#include <iomanip>
#include <ctime> 
using namespace std;

#define pb push_back
#define All(a) a.begin(), a.end()
#define met(a, b) memset(a, b, sizeof(a))
#define rep1(i, l, r) for(int i = l; i <= r; ++i)
#define rep2(i, l, r) for(int i = l; i < r; ++i) 
#define per(i, r, l) for(int i = r; i >= l; --i)
typedef long long ll;
typedef double db;
typedef long double ldb;
const int NIL = -1;
const int oo = 0x3f3f3f3f;
const ll INF = 2e18;
const db eps = 1e-8;
const db PI = acos(-1.0);

inline int read(void)
{
	int x = 0, f = 1; char ch = getchar();
	while(ch < '0' || ch > '9')	{ if(ch == '-') f = -1; ch = getchar(); } 
	while(ch >= '0' && ch <= '9') {	x = (x << 1) + (x << 3) + ch - '0';	ch = getchar();	}
	return x * f;
}

inline void write(int x)
{
	if(x < 0) { putchar('-'); x = -x; }
    if(x >= 10) write(x/10); 
	putchar(x%10+'0'); 
}

int main(void)
{
	int x1 = read(), y1 = read(), x2 = read(), y2 = read();
	int x3, y3, x4, y4;
	int x = x2 - x1, y = y2 - y1;
	int ax = -y, ay = x;
	x3 = x2 + ax; y3 = y2 + ay;
	x4 = x1 + ax; y4 = y1 + ay;
	printf("%d %d %d %d", x3, y3, x4, y4);
	
	return 0;
} 

Measured memory_bytes: 256
#include <cmath>
#include <cassert>
#include <iostream>
#include <iomanip>
#include <map>
#include <set>
#include <vector>
#include <algorithm>
#include <queue>
#include <cstring>

using namespace std;

#define forsn(i,s,n) for (int i = (s);i < (int)(n);i++)
#define forn(i,n) forsn(i,0,n)
#define dforsn(i,s,n) for (int i = (n-1);i >= (int)(s);i--)
#define dforn(i,n) dforsn(i,0,n)
#define all(v) (v).begin(), (v).end()
#define F first
#define S second

int a[100000];

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

	int n, l; cin >> n >> l;
	forn(i,n) cin >> a[i];
	int m = 0, idx;
	forn(i,n - 1) {
		if (a[i] + a[i + 1] > m) {
			m = a[i] + a[i + 1];
			idx = i;
		}
	}
	
	if (m >= l) {
		cout << "Possible\n";
		forn(i, idx) cout << i + 1 << endl;
		dforsn(i, idx + 1, n - 1) cout << i + 1 << endl;
		cout << idx + 1 << endl;
	} else {
		cout << "Impossible\n";
	}
}


Measured memory_bytes: 1280
#define _USE_MATH_DEFINES
#include <iomanip>
#include <iostream>
#include <vector>
#include <string>
#include <stack>
#include <queue>
#include <map>
#include <tuple>
#include <climits>
#include <algorithm>
#include <cmath>
using namespace std;

typedef long long LL;
typedef vector<int> VI;
typedef vector<double> VD;
typedef vector<LL> VLL;
typedef vector<string> VS;
typedef vector<bool> VB;
typedef vector<vector<int>> VVI;
typedef vector<vector<long long>> VVLL;
typedef vector<vector<bool>> VVB;
typedef vector<vector<double>> VVD;

#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
#define all(a) (a).begin(),(a).end()

const int MOD = 1000000007;

template<class T>bool chmax(T &a, const T &b){
	if(a<b){
		a=b;
		return true;
	}
	return false;
}

template<class T>bool chmin(T &a, const T &b){
	if(a>b){
		a=b;
		return true;
	}
	return false;
}

void debug(VI &arr){
	int n=arr.size();
	rep(i,n){
		cout<<arr.at(i)<<endl;
	}
}

void debug(VVI &board){
	int h = board.size();
	int w = board.at(0).size();
	rep(i,h){
		rep(j,w){
			cout << board.at(i).at(j) << " ";
		}
		cout<<endl;
	}
}

void debug(VVLL &board){
	int h = board.size();
	int w = board.size();
	rep(i,h){
		rep(j,w){
			cout<<board.at(i).at(j)<<" ";
		}
		cout<<endl;
	}
}

LL gcd(LL a,LL b){
	return b==0?a:gcd(b,a%b);
}

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

int main(){
	//cout<<fixed;
	//cout<<setprecision(9)<<...
	int n;cin>>n;
	rep(i,10)rep(j,10){
		if(i*j==n){
			cout<<"Yes"<<endl;
			return 0;
		}
	}
	cout<<"No"<<endl;
	return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <algorithm>
#include <iomanip>
#include <string>
#include <stack>
#include <queue>
#include <map>
#include <set>
#include <tuple>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <climits>
#include <cassert>
#include <cstdint>
#include <cctype>
#include <numeric>
#include <bitset>
#include <functional>

using namespace std;

using ll =  long long;
using Pll = pair<ll, ll>;
using Pii = pair<int, int>;

constexpr int N_MAX = 200000;
constexpr int M_MAX = 200000;
constexpr ll MOD = 1000000007;

ll fact[N_MAX+1], rfact[N_MAX+1];

ll perm(ll n, ll k) {
    if(n-k < 0LL) return 0LL;
    return (fact[n] * rfact[n-k]) % MOD;
}

ll comb(ll n, ll k) {
    if(n-k < 0LL) return 0LL;
    return (perm(n, k) * rfact[k]) % MOD;
}

ll modpow(ll a, ll p) {
    ll ret = 1LL;
    while(p) {
        if(p & 1) {
            ret = (ret * a) % MOD;
        }
        a = (a * a) % MOD;
        p >>= 1;
    }
    return ret;
}

void init_fact(ll n) {
    fact[0] = fact[1] = 1;
    rfact[0] = rfact[1] = 1;
    for(ll i=2;i<=n;++i) {
        fact[i] = (fact[i-1] * i) % MOD;
        rfact[i] = modpow(fact[i], MOD-2);
    }
}


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

    init_fact(n);

    ll ans = 1; // 元に戻る分
    for(ll i=1;i<=min(n-1, k);++i) {    // i は 0 の数
        ans += (comb(n-1, i) * comb(n, i)) % MOD;
        ans %= MOD;
    }

    cout << ans << endl;
}


Measured memory_bytes: 3328
//#include <tourist>
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> p;
const int INF = 1e9;
const ll LINF = ll(1e18) + 1;
const int MOD = 1000000007;
const int dx[4] = {0, 1, 0, -1}, dy[4] = {-1, 0, 1, 0};
const int Dx[8] = {0, 1, 1, 1, 0, -1, -1, -1}, Dy[8] = {-1, -1, 0, 1, 1, 1, 0, -1};
#define yes cout << "Yes" << endl
#define YES cout << "YES" << endl
#define no cout << "No" << endl
#define NO cout << "NO" << endl
#define rep(i, n) for (int i = 0; i < n; i++)
#define ALL(v) v.begin(), v.end()
#define debug(v)          \
    cout << #v << ":";    \
    for (auto x : v)      \
    {                     \
        cout << x << ' '; \
    }                     \
    cout << endl;
template <class T>
bool chmax(T &a, const T &b)
{
    if (a < b)
    {
        a = b;
        return 1;
    }
    return 0;
}
template <class T>
bool chmin(T &a, const T &b)
{
    if (b < a)
    {
        a = b;
        return 1;
    }
    return 0;
}
//cout<<fixed<<setprecision(15);有効数字15桁
//-std=c++14
ll gcd(ll a, ll b) { return b ? gcd(b, a % b) : a; }
ll lcm(ll a, ll b) { return a / gcd(a, b) * b; }
int n, m;
ll a,b,c;

int main()
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    cin >> a>>b>>c;
    ll temp=min(b,c);
    if(c-b<0){
        cout<<c+b<<"\n";
        return 0;
    }
    ll temp1=min(c-b,a+1);
    cout << 2*(temp)+temp1 << "\n";
}


Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <array>
#include <queue>
#include <deque>
#include <map>
#include <set>
#include <sstream>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <list>
#include <numeric>
#include <stack>
#include <iomanip>
#include <random>
#include <complex>
#include <functional>
#include <tuple>

using namespace std;

#define Rep(i,a,b) for(int i = a; i < b; ++i)
#define rep(i,b) Rep(i,0,b)
#define allof(a) (a).begin(), (a).end()

#define Yes(q) ((q) ? "Yes" : "No")
#define YES(q) ((q) ? "YES" : "NO")
#define Possible(q) ((q) ? "Possible" : "Impossible")
#define POSSIBLE(q) ((q) ? "POSSIBLE" : "IMPOSSIBLE")

using ll = long long;

using pint = std::pair<int, int>;
using pll = std::pair<ll, ll>;


constexpr int inf = 1e9 + 7;
constexpr ll infll = 1ll << 60ll;
constexpr ll mod = 1e9 + 7;
// 0~3までは右左下上 4~7までは斜め
constexpr int dx[] = { 1, 0, -1, 0, 1, 1, -1, -1 };
constexpr int dy[] = { 0, -1, 0, 1, 1, -1, -1, 1 };

namespace {
	template<typename T> void chmax(T& a, T b) { a = std::max(a, b); }
	template<typename T> void chmin(T& a, T b) { a = std::min(a, b); }
	template<typename T> void chadd(T& a, T b) { a = a + b; }

	void Cout(long long x, const char* end = "\n") { std::cout << x << end; }
	template <typename T> void Cout(const T& x, const char* end = "\n") { std::cout << x << end; }
	template <typename T> void Cout(const std::vector<T>& x, const char* sep = " ", const char* end = "\n") { for (std::size_t i = 0, sz = x.size(); i < sz; i++) { std::cout << x[i] << (i == sz - 1 ? end : sep); } }

	void CCout(long long x, const char* end = "\n") { std::cerr << x << end; }
	template <typename T> void CCout(const T& x, const char* end = "\n") { std::cerr << x << end; }
	template <typename T> void CCout(const std::vector<T>& x, const char* sep = " ", const char* end = "\n") { for (std::size_t i = 0, sz = x.size(); i < sz; i++) { std::cerr << x[i] << (i == sz - 1 ? end : sep); } }

	// 標準入出力
	struct inp {
		std::size_t sz;
		inp(std::size_t _sz = 1) : sz(_sz) {}
		template <typename T> operator T () const { T a; std::cin >> a; return a; }
		template <typename T> operator std::vector<T>() const { vector<T> a(sz); for (std::size_t i = 0; i < sz; i++) std::cin >> a[i]; return a; }
		template <typename T, typename U> operator std::pair<T, U>() const { T f; U s; std::cin >> f >> s; return std::pair<T, U>(f, s); }
	};

	inp inp1; // input one
}

int main() {

	size_t n = inp1;
	vector<ll> a = inp(n);
	rep(i, n) a[i] = -a[i];

	// 用いる色の最小値

	// 同じ色なら ai < aj

	// 左から貪欲じゃダメなの？

	vector<int> num;
	num.emplace_back(a[0]);
	
	Rep(i, 1, n) {
		// どの場所に入れることができるか
		int index = upper_bound(allof(num), a[i]) - num.begin();
		
		if (index == num.size()) {
			// 新しいやつ
			num.push_back(a[i]);
		}
		else {
			num[index] = a[i];
		}
	}

	Cout(num.size());

	return 0;
}

Measured memory_bytes: 1660
#include <iostream>

using namespace std;

int main()
{
   int i, h, m, s;
   cin >> i;
   h = i / 3600;
   m = i / 60 - h * 60;
   s = i % 60;
   cout << h << ":" << m << ":" << s << endl;

   return 0;
}


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

int main(void) {
    int N;cin>>N;
    set<int> se;
    for (int i = 0; i < N; i++) {
        int A;cin>>A;
        if (se.find(A) != se.end()) se.erase(A);
        else se.insert(A);
    }
    cout << se.size() << endl;
    return 0;
}

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

int main(){
  int n;
  cin >> n;
  vector<int64_t> l(n);
  for (int i = 0; i < n; i++){
    cin >> l.at(i);
  }
  int count = 0;
  for (int i = 0; i < n - 2; i++){
    for (int j = i + 1; j < n - 1; j++){
      for (int k = j + 1; k < n; k++){
        if (l.at(i) != l.at(j) && l.at(j) != l.at(k) && l.at(k) != l.at(i)){
          if (max(l.at(i), max(l.at(j), l.at(k))) * 2 < l.at(i) + l.at(j) + l.at(k)){
            count++;
          }
        }
      }
    }
  }
  cout << count << endl;
}

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

long long int MOD = 1000000007;

int main() {
  long long int X;
  cin >> X;
  if (X % 11 == 0) cout << X / 11 * 2 << endl;
  else if (X % 11 <= 6) cout << X / 11 * 2 + 1 << endl;
  else cout << X / 11 * 2 + 2 << endl;
}

Measured memory_bytes: 256
#include<stdio.h>
int main()
{
	int n;
	scanf("%d",&n);
	int ans=0;
	int i; 
	int a,b; 
	for(i=1;i<=n;i++)
	{
		scanf("%d%d",&a,&b);
		ans=ans+b-a+1;
		 
	}
	printf("%d",ans); 
}

Measured memory_bytes: 128
#include<iostream>
using namespace std;
int main(){
	int a;
	int f=0;
	int s[1000];
	cin>>a;
	for(int i=0;i<a;i++){
		cin>>s[i];
		if(s[i]%2==0){
			if(s[i]%5!=0&&s[i]%3!=0){
				f=1;
			}
		}
	}
	if(f)cout<<"DENIED";
	else cout<<"APPROVED";
	return 0;
}

Measured memory_bytes: 3612
<?php
$n = fgets(STDIN);
$discs = array();
for ($i = 0; $i < $n; $i++) {
    $disc = fgets(STDIN);
    if (array_search($disc, $discs) === false) {
        array_push($discs, $disc);
    }
}
echo count($discs);
?>


Measured memory_bytes: 3700
#include <bits/stdc++.h>
using namespace std;
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    long long int t,n,q,i,b,c=0,d,k,p,v;
    cin>>n;
    long long int a[n];
    for(i=0;i<n;i++)
    {
        cin>>a[i];
    }
    sort(a,a+n);
    for(i=0;i<n-1;i++)
    {
        if(a[i]==a[i+1])
        {
            cout<<"NO\n";
            return 0;
        }
    }
    cout<<"YES\n";

    return 0;
}

Measured memory_bytes: 5220
#include<bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0; i<(n); i++)
const int MX = 100005;
int q, a, b, c, d, ss[MX], tt[MX];
string s, t;
int main(){
	cin >> s >> t >> q;
	rep(i,s.size()) ss[i+1] = ss[i] + 1 + (s[i] == 'A');
	rep(i,t.size()) tt[i+1] = tt[i] + 1 + (t[i] == 'A');
	rep(i,q){
		scanf("%d%d%d%d", &a, &b, &c, &d);
		puts((ss[b] - ss[a-1] - tt[d] + tt[c-1]) % 3 == 0 ? "YES" : "NO");
	}
}

Measured memory_bytes: 1664
def divs(n):
  d = 0
  for i in range(1, int(n**0.5)+1):
    if n % i == 0:
      d += 1
      if i != n // i:
        d += 1
  return d

c = 0
for i in range(1, int(input()) + 1, 2):
  if divs(i) == 8:
    c += 1
print(c)

Measured memory_bytes: 2940
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include<math.h>
#define ll long long int

int matoi(char n){
  if(n=='0'){
    return 0;}
  if(n=='1'){
    return 1;}
  if(n=='2'){
    return 2;}
  if(n=='3'){
    return 3;}
  if(n=='4'){
    return 4;}
  if(n=='5'){
    return 5;}
  if(n=='6'){
    return 6;}
  if(n=='7'){
    return 7;}
  if(n=='8'){
    return 8;}
  if(n=='9'){
    return 9;}
  return 0;
}

int four(char s[],int i){
  return matoi(s[i])*1000+matoi(s[i+1])*100+matoi(s[i+2])*10+matoi(s[i+3]);
}

int main(){
  char s[200001];
  scanf("%s",s);

  int n=strlen(s);
  int tmp=0,k=1;
  int mod[2020]={};
  mod[0]=1;
  ll count=0;

  for(int i=n-1;i>=0;i--){
    tmp += matoi(s[i])*k;
    tmp %=2019;
    mod[tmp]++;
    //printf("%d\n",tmp);
    k *=10;
    k %=2019;}
  
  for(int i=0;i<2019;i++){
    count += mod[i]*(mod[i]-1)/2;}
	  
  printf("%lld\n",count);
  
  return 0;
}


Measured memory_bytes: 1928
#include<cstdio>
using namespace std;
int n,m,k,r[10],a,b,c,i,j,l;
long long d[210][210],f[300][10];
long long min(long long a,long long b){return a<b?a:b;} 
int main()
{
	scanf("%d%d%d",&n,&m,&k);
	for (i=1;i<=k;i++) scanf("%d",&r[i]);
	for (i=1;i<=n;i++)
	  for (j=1;j<=n;j++)
	  {
	  	d[i][j]=1e15;
	  }
	for (i=1;i<=m;i++)
	{
		scanf("%d%d%d",&a,&b,&c);
		d[a][b]=min(d[a][b],c);
		d[b][a]=min(d[b][a],c);
	}
	for (l=1;l<=n;l++)
	  for (i=1;i<=n;i++)
	    for (j=i+1;j<=n;j++)
	    {
	    	d[i][j]=min(d[i][j],d[i][l]+d[l][j]);
	    	d[j][i]=d[i][j];
		}
	for (j=0;j<(1<<k);j++) 
	  for (l=1;l<=k;l++)
	    f[j][l]=1e15;
	for (j=0;j<k;j++) f[1<<j][j+1]=0;
	for (j=1;j<(1<<k);j++)
	{
		for (a=0;a<k;a++)
		  if ((j&(1<<a))!=0)
		    for (b=0;b<k;b++)
		    {
		    	if ((j&(1<<b))==0)
		    	{
		    		f[j^(1<<b)][b+1]=min(f[j^(1<<b)][b+1],f[j][a+1]+d[r[a+1]][r[b+1]]);
				}
			}
	}
	int now=(1<<k)-1;
	long long ans=f[now][1];
	for (i=2;i<=k;i++) ans=min(ans,f[now][i]);
	printf("%lld\n",ans);
}

Measured memory_bytes: 512
import itertools
A, B, C, D, E, F = [int(_) for _ in input().split()]
W = [0] * (F+1)
S = [0] * (F+1)
for a, b in itertools.product(range(F // (100*A) + 1), range(F//(100*B) + 1)):
    if 100*A*a+100*B*b <= F:
        W[100*A*a+100*B*b] = min(E*(A*a+B*b), F-100*A*a-100*B*b)

for c, d in itertools.product(range(F // C + 1), range(F // D + 1)):
    if C*c+D*d <= F:
        S[C*c+D*d] = C*c+D*d
for i in range(F):
    if S[i+1] == 0:
        S[i+1] = S[i]
water = 100*A
sugar = 0
for i in range(1, F+1):
    if W[i] and S[W[i]]/i > sugar/water:
        sugar, water = S[W[i]], i
print(sugar+water, sugar)


Measured memory_bytes: 3188
import java.util.*;
public class Main{
	public static void main(String args[]){
		Scanner sc = new Scanner(System.in);
		char[] S = new char[3];
		String SS = sc.next();
		String ans = "Yes";
		for(int i = 0;i < 3;i++){
			S = SS.toCharArray();
		}
		if(S[0] == S[1] && S[1] == S[2]){
			ans = "No";
		}
		System.out.println(ans);
	}
}

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

void solve(long long N, long long A, long long B)
{
    cout << min(A * N, B) << endl;
}

// Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
int main()
{
    long long N;
    scanf("%lld", &N);
    long long A;
    scanf("%lld", &A);
    long long B;
    scanf("%lld", &B);
    solve(N, A, B);
    return 0;
}


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

int main(){
  int N;
  std::cin >> N;
  std::string S;
  std::cin >> S;
  int nPL = 0, nPR = 0;
  bool isClose = true;
  int tL = 0, tR = 0;
  for(int i = 0; i < S.size(); i++){
    if(S.at(i) == '('){
      if(isClose){
        isClose = false;
        nPR += tR;
        nPL += tL;
        tR = 0;
        tL = 1;
      }else tL++;
    }else{
      if(!isClose){
        isClose = true;
        tL--;
      }else{
        if(tL != 0) tL--;
        else if(nPL != 0) nPL--;
        else tR++;
      }
    }
  }
  nPL += tL;
  nPR += tR;
  std::string L(nPR, '(');
  std::string R(nPL, ')');
  std::cout << L << S << R << std::endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(x, to) for (int x = 0; x < (to); x++)
#define REP(x, a, to) for (int x = (a); x < (to); x++)
#define EPS (1e-14)
#define _PA(x,N) rep(i,N){cout<<x[i]<<" ";}cout<<endl;
#define _PA2(x,H,W) rep(i,(H)){rep(j,(W)){cout<<x[i][j]<<" ";}cout<<endl;}

using namespace std;

typedef long long ll;
typedef pair<int, int> PII;
typedef pair<ll, ll> PLL;
typedef complex<double> Complex;
typedef vector< vector<int> > Mat;

ll N, A;
ll x[55];

ll dp[55][55][2505];
ll ans;


void solve() {

	for (int i = 0; i < N; i++) {
		dp[i][0][0] = 1;
	}

	for (int i = 0; i < N; i++) {
		for (int j = 1; j <= i + 1; j++) {
			for (int k = 0; k < 2505; k++) {
				dp[i + 1][j][k] = dp[i][j][k];
				if (k - x[i] >= 0) {
					dp[i + 1][j][k] += dp[i][j - 1][k - x[i]];
				}
			}
		}
	}

	for (int i = 1; i <= N; i++) {
		ans += dp[N][i][A * i];
	}
	
	cout << ans << endl;
}

int main() {
	cin >> N >> A;
	for (int i = 0; i < N; i++) {
		cin >> x[i];
	}
	solve();
	return 0;
}




Measured memory_bytes: 25600
#include <iostream>
#include <vector>

using std::vector;

int main(int argc, char* argv[]) {
  using std::cin;
  using std::cout;

  int n;
  cin >> n;
  vector<int> b(n - 1);
  for (int i = 0; i < n - 1; ++i) {
    cin >> b[i];
  }

  // b_i >= max(a_i, a_i+1)
  // a_0 <= b_0
  // a_1 <= b_0 && a_1 <= b_1 => a_1 <= min(b_0, b_1)
  // ..
  // a_n-1 <= b_n-2

  int result;
  
  result = b[0];
  for (int i = 1; i < n - 1; ++i) {
    result += std::min(b[i - 1], b[i]);
  }
  result += b[n - 2];

  cout << result;
  
  return 0;
}


Measured memory_bytes: 256
import std.stdio, std.string, std.conv, std.math;

void main() {
	auto ip = readln.split.to!(int[]);
	if(0 <= (ip[1] - ip[2])){
		writeln("delicious");
	} else if(ip[0] >= abs(ip[1] - ip[2])){
		writeln("safe");
	} else {
		writeln("dangerous");
	}
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i,a,b) for(int i=int(a);i<int(b);++i)
#define SIZE 15
#define INF 1000000005LL
//#define INF 1e18
#define MOD 1000000007

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

ll d[SIZE][SIZE];
int V;

void warshall_floyd_init(){
  fill(d[0],d[SIZE],INF);
  rep(i,0,SIZE) d[i][i] = 0;
}

//trueなら負の閉路が存在,0_indexed
bool warshall_floyd(){
  rep(k,0,V) rep(i,0,V){
    if(d[i][k]==INF)continue;
    rep(j,0,V){
      if(d[k][j]==INF)continue;
      d[i][j] = min(d[i][j],d[i][k]+d[k][j]);
    }
  }
  rep(i,0,V) if(d[i][i] < 0) return true;
  return false;
}

void add_edge(int a,int b,ll c){
  d[a][b] = c;
}

int h,w;

int main(){
  V=10;
  cin >> h >> w;
  warshall_floyd_init();
  rep(i,0,10){
    rep(j,0,10){
      ll a;
      cin >> a;
      if(i!=j)add_edge(i,j,a);
    }
  }
  warshall_floyd();
  ll ans=0;
  rep(i,0,h) rep(j,0,w){
    int a;
    cin >> a;
    if(a!=1 && a!=-1){
      ans += d[a][1];
    }
  }
  cout << ans << endl;

  return 0;
}


Measured memory_bytes: 256
use std::io;
fn main() {
    let (h, waza) = {
        let mut i = String::new();
        io::stdin().read_line(&mut i).unwrap();
        let mut it = i.split_whitespace();
        let (h, n): (usize, usize) = {
            (
                it.next().unwrap().parse().unwrap(),
                it.next().unwrap().parse().unwrap(),
            )
        };
        let mut waza: Vec<(usize, usize)> = Vec::new();
        for _ in 0..n {
            let mut i = String::new();
            io::stdin().read_line(&mut i).unwrap();
            let mut it = i.split_whitespace();
            waza.push((
                it.next().unwrap().parse().unwrap(),
                it.next().unwrap().parse().unwrap(),
            ))
        }
        (h, waza)
    };
    /*
    println!("{}", h);
    for i in waza {
        println!("{},{}", i.0, i.1);
    }
    */
    let mut dp: Vec<usize> = Vec::new();
    dp.push(0);
    for i in 1..h + 1 {
        //println!("dp[{}] start", i);
        let mut min_mp = std::usize::MAX;
        for m in &waza {
            //println!("compare atk:{},mp:{}", m.1, m.0);
            let tmp_mp = if i > m.0 { dp[i - m.0] + m.1 } else { m.1 };
            //println!("tmp_mp is {}", tmp_mp);
            min_mp = std::cmp::min(min_mp, tmp_mp);
        }
        //println!("min_mp is {}", min_mp);
        dp.push(min_mp);
    }
    println!("{}", dp[h]);
}


Measured memory_bytes: 4352
#include <iostream>
#include <algorithm>
#include <cmath>
#include <vector>
#include <string>
#include <map>
#include <queue>
using ll = long long;

using namespace std;

int main() {
    ll T1,T2,A1,A2,B1,B2;
    cin >> T1 >> T2 >> A1 >> A2 >> B1 >> B2;
    ll vel1 = A1-B1;
    ll vel2 = A2-B2;
    if(T1 * vel1 + T2 * vel2 == 0){
        cout << "infinity" << endl;
    }else{
        ll deltaPerCycle = T1 * vel1 + T2 * vel2;
        ll edge = T1 * vel1;
        if((deltaPerCycle > 0 && edge > 0) || (deltaPerCycle < 0 && edge < 0)){
            cout << 0 << endl;
            return 0;
        }
        edge = abs(edge);
        deltaPerCycle = abs(deltaPerCycle);
        //cout << edge << "," << deltaPerCycle << endl;
        if(deltaPerCycle > edge){
            cout << 1 << endl;
        }else if(deltaPerCycle == edge){
            cout << 2 << endl;
        }else{
            int fix = 0;
            if(edge % deltaPerCycle == 0){
                fix = 1;
            }
            cout << (edge / deltaPerCycle) * 2 + 1 - fix << endl;
        }

    }

}

Measured memory_bytes: 256
n, k = gets.chomp.split.map(&:to_i)
a = gets.chomp.split.map(&:to_i)

([k, 41].min).times do
  dp = Array.new(n + 2, 0)
  1.step(n) do |i|
    dp[[i - a[i - 1], 0].max] += 1
    dp[[i + a[i - 1], n].min + 1] -= 1
  end

  0.step(n) do |i|
    if i > 0
      dp[i] += dp[i - 1]
      a[i - 1] = dp[i]
    end
  end
end

puts a.join(" ")

Measured memory_bytes: 83580
while(True):
	try:
		a,b,c,d,e,f = map(float,input().split(" "))
		z = a*e - b*d
		if(z!=0):
			x = (c*e-b*f)/z
			y = (a*f-c*d)/z
		print("{:.3f} {:.3f}".format(x+0,y+0))
	except:
		break

Measured memory_bytes: 5588
#include <bits/stdc++.h>
#include <boost/range/algorithm.hpp>
#include <boost/range/numeric.hpp>
#include <boost/range/irange.hpp>
#include <boost/range/adaptor/indexed.hpp>
#define FOR(i,k,n)  for(int i = (k);i < (n);++i)
#define REP(i,n)    FOR(i,0,n)
#define ALL(x) begin(x),end(x)

using namespace std;
using namespace boost::adaptors;
using namespace std::string_literals;
using ll = int64_t;
using vecint = vector<int>;
using vecll = vector<ll>;
using boost::irange;

int solve(vector<tuple<int,int,int,int>>& vt, int n, int m, int i, int mn, vecint& v) {
  if (i == n) {
    int score = 0;
    for (auto [a,b,c,d]:vt) {
      if (v[b] - v[a] == c) score += d;
    }
    return score;
  } else {
    int mx = 0;
    FOR(j,mn,m+1) {
      auto nx = v;
      nx.push_back(j);
      mx = max(mx, solve(vt, n, m, i+1, j, nx));
    }
    return mx;
  }
}

int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  int n,m,q;
  cin>>n>>m>>q;
  vector<tuple<int,int,int,int>> vt;
  REP(i,q) {
    int a,b,c,d;
    cin>>a>>b>>c>>d;
    --a;--b;
    vt.emplace_back(a,b,c,d);
  }
  vecint v;
  cout<<solve(vt,n,m,0,1,v)<<endl;
  return 0;
}


Measured memory_bytes: 3636
// comment
// 재귀적으로 생각하기.. ㅠㅠ

#include <bits/stdc++.h>

using namespace std;

#define SZ(v) ((int)(v).size())
#define ALL(v) (v).begin(),(v).end()
#define one first
#define two second
using ll = long long;
using pi = pair<int, int>;
const int INF = 0x3f3f3f3f;
const ll LINF = 1ll * INF * INF;

const int MAX_N = 20 + 1;

int L, P;
int tp;
vector<pi> Ans[MAX_N];
int main() {
	cin >> L;

	tp = L / 2; P = 1;
	while(tp > 0) tp >>= 1, P *= 2;
	vector<int> bits;
	tp = L;
	while(tp > 0) bits.push_back(tp%2), tp >>= 1;
	reverse(ALL(bits));

	int N = 1, M = 0;
	int now = 0;

	bool isFirst = true;
	for(int x: bits) {
		now *= 2;
		now += x;

		if (not isFirst) {
			++N;
			Ans[N-1].emplace_back(N, P);
			Ans[N-1].emplace_back(N, 0);
			M += 2;
		}
		isFirst = false;


		if(x == 1) {
			if(N != 1) {
				Ans[1].emplace_back(N, (now - 1) * P);
				M += 1;
			}
		}

		P >>= 1;
	}
	printf("%d %d\n", N, M);
	for(int i=1; i<=N; i++) {
		for(auto p: Ans[i]) {
			int x, y; tie(x, y) = p;
			printf("%d %d %d\n", i, x, y);
		}
	}

	return 0;
}


Measured memory_bytes: 3692
l = [int(input()) for _ in range(5)]
n = [10-l[x]%10 if (l[x]%10) else 0 for x in range(5)]
m = min([l[x]%10 if (l[x]%10) else 10 for x in range(5)])
print(sum(l+n)+(m-10 if (m) else 0))


Measured memory_bytes: 3060
#include <iostream>
#include <cstdio>
#include <algorithm>
using namespace std;
int n;
struct pro
{
	int l, r;
}s[101000];

bool cmp(pro a, pro b)
{
	return a.r < b.r;
}
int main()
{
	scanf("%d",&n);
	for(int i = 1; i <= n; i++)
	{
		int x, l;
		scanf("%d%d",&x,&l);
		s[i].l = x - l, s[i].r = x + l;
	}
	sort(s+1, s+1+n, cmp);
	int cnt = 1, L = s[1].r;
	for(int i = 2; i <= n; i++)
		if(s[i].l >= L)
		{
			L = s[i].r;
			cnt++;
		}
	printf("%d",cnt);
	return 0;
}

Measured memory_bytes: 1024
# -*- coding: utf-8 -*-
import sys
from collections import defaultdict
# sys.setrecursionlimit(10**6)
readline = sys.stdin.buffer.readline
# readline = sys.stdin.readline

INF = 1 << 63


def read_int():
    return int(readline())


def read_int_n():
    return list(map(int, readline().split()))


def read_float():
    return float(readline())


def read_float_n():
    return list(map(float, readline().split()))


def read_str():
    return readline().strip()


def read_str_n():
    return readline().strip().split()


def ep(*args):
    print(*args, file=sys.stderr)


def mt(f):
    import time

    def wrap(*args, **kwargs):
        s = time.perf_counter()
        ret = f(*args, **kwargs)
        e = time.perf_counter()

        ep(e - s, 'sec')
        return ret

    return wrap


class UnionFind():
    def __init__(self):
        self.__table = {}
        self.__size = defaultdict(lambda: 1)
        self.__rank = defaultdict(lambda: 1)

    def __root(self, x):
        if x not in self.__table:
            self.__table[x] = x
            return x
        else:
            a = x
            ul = []
            while a != self.__table[a]:
                ul.append(a)
                a = self.__table[a]
            for u in ul:
                self.__table[u] = a

        return self.__table[x]

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

    def union(self, x, y):
        x = self.__root(x)
        y = self.__root(y)
        if x == y:
            return False

        if self.__rank[x] < self.__rank[y]:
            self.__table[x] = y
            self.__size[y] += self.__size[x]
        else:
            self.__table[y] = x
            self.__size[x] += self.__size[y]
            if self.__rank[x] == self.__rank[y]:
                self.__rank[x] += 1
        return True

    def size(self, x):
        return self.__size[self.__root(x)]

    def num_of_group(self):
        g = 0
        for k, v in self.__table.items():
            if k == v:
                g += 1
        return g


@mt
def slv(N, XY):
    xyi = [(x, y, i) for i, (x, y) in enumerate(XY)]
    xyi.sort()

    l = []
    uf = UnionFind()
    for _, y, i in xyi:
        my = y
        while len(l) >= 1 and l[-1][0] < y:
            yy, j = l.pop()
            uf.union(i, j)
            my = min(my, yy)

        l.append((my, i))
    ans = [-1] * N
    for i in range(N):
        ans[i] = uf.size(i)
    return ans




def main():
    N = read_int()
    XY = [read_int_n() for _ in range(N)]
    print(*slv(N, XY), sep='\n')


if __name__ == '__main__':
    main()


Measured memory_bytes: 189460
#include <stdio.h>
int main (){

  int a[100][100],b[100],i,j,c[100]={0},n,m;

  scanf("%d%d",&n,&m);

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

  for(i=0;i<m;i++)scanf("%d",&b[i]);

  for(i=0;i<n;i++){
    for(j=0;j<m;j++){
      c[i]+=a[i][j]*b[j];
    }
  }


  for(i=0;i<n;i++)printf("%d\n",c[i]);

  return 0;
}

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

using namespace std;

int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    string s;
    cin >> s;
    if (s.length() == 1) {
        cout << "YES" << "\n";
        return 0;
    } else if (s.length() == 2 && s[0] != s[1]) {
        cout << "YES" << "\n";
        return 0;
    }
    set<char> st;
    unordered_map<char, int> cnt;
    for (auto &elem : s) {
        cnt[elem]++;
        st.insert(elem);
    }
    int maxv = max({cnt['a'], cnt['b'], cnt['c']});
    int minv = min({cnt['a'], cnt['b'], cnt['c']});
    cout << (maxv - minv + 1 >= st.size() ? "NO" : "YES") << "\n";
    return 0;
}


Measured memory_bytes: 512
#include <iostream>
using namespace std;
int main(){
    int N; cin >> N;
    int a_max=0, a_min=1000;
    for (int i=0;i<N;i++) {
        int a_i; cin >> a_i;
        if (a_max<a_i) a_max = a_i;
        if (a_i<a_min) a_min = a_i;
    }
    cout << a_max - a_min << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
 
using namespace std;
 
#define rep(i, n) for(int i=0; i<(n); i++)
#define FOR(i, m, n) for(int i=(m);i<(n);i++)
#define sz(x) ((int)(x).size())
#define all(x) (x).begin(),(x).end()
#define SORT(x) sort((x).begin(),(x).end())
#define RSORT(x) sort((x).rbegin(),(x).rend())
#define REVE(x) reverse((x).begin(),(x).end())
#define mp make_pair
#define pb push_back
#define chmax(x,y) x = max(x,y)

 
typedef vector<int> VI;
typedef vector<string> VS;
typedef vector<vector<int> > VVI;
typedef pair<int, int> PII;
typedef long long LL;
typedef vector<bool> VB;
typedef vector<LL> VL;
typedef vector<vector<long long>> VVLL;
typedef vector<set<int>> VSI;
const int MOD = 1e9+7;
const int INF = 1e9;
const LL LINF = 1e18;
int gcd(int a, int b)
{
   if (a%b == 0)
   {
       return(b);
   }
   else
   {
       return(gcd(b, a%b));
   }
}

int lcm(int a, int b)
{
   return a * b / gcd(a, b);
}
struct UnionFind {
    VI d;
    UnionFind(int n = 0): d(n,-1) {}
    int find(int x) {
        if(d[x] < 0) return x;
        return d[x] = find(d[x]);
    }
    bool unite(int x,int y) {
        x = find(x); y = find(y);
        if(x == y) return false;
        if(d[x] > d[y]) swap(x,y);
        d[x] += d[y];
        d[y] = x;
        return true;
    }
    bool same(int x,int y) { return find(x) == find(y); }
    int size(int x) { return -d[find(x)]; }
};
int deg[100005];
VI to[100005];

struct mint {
  LL x; // typedef long long ll;
  mint(LL x=0):x((x%MOD+MOD)%MOD){}
  mint operator-() const { return mint(-x);}
  mint& operator+=(const mint a) {
    if ((x += a.x) >= MOD) x -= MOD;
    return *this;
  }
  mint& operator-=(const mint a) {
    if ((x += MOD-a.x) >= MOD) x -= MOD;
    return *this;
  }
  mint& operator*=(const mint a) {
    (x *= a.x) %= MOD;
    return *this;
  }
  mint operator+(const mint a) const {
    mint res(*this);
    return res+=a;
  }
  mint operator-(const mint a) const {
    mint res(*this);
    return res-=a;
  }
  mint operator*(const mint a) const {
    mint res(*this);
    return res*=a;
  }
  mint pow(LL t) const {
    if (!t) return 1;
    mint a = pow(t>>1);
    a *= a;
    if (t&1) a *= *this;
    return a;
  }
 
  // for prime mod
  mint inv() const {
    return pow(MOD-2);
  }
  mint& operator/=(const mint a) {
    return (*this) *= a.inv();
  }
  mint operator/(const mint a) const {
    mint res(*this);
    return res/=a;
  }
};

mint f(int n) {
    if(n == 0) return 1;
    mint x = f(n/2);
    x *= x;
    if(n%2 == 1) x *= 2;
    return x;
}

mint choose(int n,int a) {
    mint x = 1, y = 1;
    rep(i,a) {
        x *= n-i;
        y *= i+1;
    }
    return x/y;
}

int main() {
    char a,b;
    cin >> a >> b;
    string ans1 = "";
    string ans2 = "";

    rep(i,b - '0') {
      ans1 = ans1 + a;
    }

    rep(i,a - '0') {
      ans2 = ans2 + b;
    }


    int a1,a2 = 0;
    a1 = atoi(ans1.c_str());
    a2 = atoi(ans2.c_str());

    if(a1>=a2) {
      cout << a1 << endl;
    } else {
      cout << a2 << endl;
    }




}


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

int main()
{
  int n;
  cin >> n;
  vector<int> h(n);
  for (auto&& e : h) cin >> e;
  int x = -1;
  int cnt = 0;
  for (auto&& e : h) {
    if (e >= x) {
      cnt++;
      x = e;
    }
  }
  cout << cnt << endl;
}


Measured memory_bytes: 256
#include "bits/stdc++.h"
using namespace std;
#define int long long
int mod=1e9+7;

signed main(){
  string s;
  cin>>s;
  int n;
  cin>>n;
  for(int i=0;i<n;i++){
    string t;
    cin>>t;
    int a,b;
    cin>>a>>b;
    if(t=="reverse")reverse(s.begin()+a,s.begin()+b+1);
    if(t=="replace"){
      string p;
      cin>>p;
      for(int j=a;j<=b;j++)s[j]=p[j-a];
    }
    if(t=="print"){
      for(int j=a;j<=b;j++)cout<<s[j];
      cout<<endl;
    }
  }
}



Measured memory_bytes: 3200
// C++ 14
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define loop(__x, __start, __end) for(ll __x = __start; __x < __end; __x++)

int ms(int n) {
  while (n/10 > 0) n/=10;
  return n;
}

int ls(int n) {
  return n % 10;
}

int main() {
  int n; cin >> n;
  int C[10][10];
  memset(C, 0, sizeof(C));
  loop(i,1,n+1) {
    C[ms(i)][ls(i)]++;
  }
  
  ll ans = 0;
  loop(i,0,10) loop(j,0,10) ans += C[i][j] * C[j][i];
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 3612
#include <iostream>
#include <iomanip>
#include <cstring>
#include <algorithm> 
#include <math.h>
#include <queue>
#include <functional>
#include <map>
#include <vector>
#include <string>
using namespace std;
typedef long long ll;
const ll MOD = 1000000007;
const int INF = 10000000;

int n, a, b;

int main(void){
    cin >> n >> a >> b;

    if (abs(a - b) % 2) cout << "Borys" << endl;
    else cout << "Alice" << endl;

}

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

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

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


int main(){
  long A;
  long B;
  cin >> A;
  cin >> B;
  long ans = lcm(A, B);

  cout << ans;
  return 0;
}

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

int main() {
  int N, K;
  cin >> N >> K;
  int ans = 0;
  for(int i = 0; i < N; i++) {
    int h;
    cin >> h;
    if(h >= K) {
      ans++;
    }
  }
  cout << ans << endl;
}

Measured memory_bytes: 256
#include <stdio.h>

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

  if(A >= K){
    printf("%d",K);
	}else if(A + B >= K){
      printf("%d",A);
    }else{
    printf("%d",2*A+B-K);
    }
  
  return 0;
}

Measured memory_bytes: 1728
using System;
using System.Text;
using System.Collections.Generic;
class Solve{
    int N,M,K;
    public Solve(){}
    StringBuilder sb;
    public static int Main(){
        new Solve().Run();
        return 0;
    }
    void Run(){
        sb = new StringBuilder();
        Read();
        Calc();
        Console.Write(sb.ToString());
    }
    void Calc(){
        Fact F = new Fact(N+M+K);
        long[] po = new long[M+K+1];
        po[0] = 1;
        for(int i=1;i<=M+K;i++){
            po[i] = po[i-1]*3%Define.mod;
        }
        long d = 1;
        long count = 0;
        for(int i=N;i<=N+M+K;i++){
            count = (count + (F.GetConv(i-1,N-1)*d)%Define.mod*po[N+M+K-i]%Define.mod) % Define.mod;
            d = d*2%Define.mod;
            if(i-N >= M){
                d = (d + Define.mod - F.GetConv(i-N,M))%Define.mod;
            }
            if(i-N >= K){
                d = (d + Define.mod - F.GetConv(i-N,K))%Define.mod;
            }
        }
        sb.Append(count+"\n");
    }
    void Read(){
        string[] str = Console.ReadLine().Split(' ');
        N = int.Parse(str[0]);
        M = int.Parse(str[1]);
        K = int.Parse(str[2]);
    }    
}
class Fact{
    public long[] f;
    public long[] rf;
    public Fact(int N){
        f = new long[N+1];
        rf = new long[N+1];
        for(int i=0;i<N+1;i++){
            if(i == 0){
                f[i] = 1;
            }
            else{
                f[i] = (f[i-1]*i)%Define.mod;
            }
        }
        for(int i=N;i>=0;i--){
            if(i == N){
                rf[i] = pow(f[N],Define.mod-2);
            }
            else{
                rf[i] = rf[i+1]*(i+1)%Define.mod;
            }
        }
    }
    public long pow(long N,long K){
        if(K == 0){
            return 1;
        }
        else if(K % 2 == 0){
            long t = pow(N,K/2);
            return t*t%Define.mod;
        }
        else{
            return N*pow(N,K-1)%Define.mod;
        }
    }
    public long GetFact(int N){
        return f[N];
    }
    public long GetConv(int N,int R){
        return ((f[N]*rf[R])%Define.mod*rf[N-R])%Define.mod;
    }
}
public static class Define{
    public const long mod = 1000000007;
}

Measured memory_bytes: 21464
#pragma GCC optimize(3, "Ofast", "inline")

#include <bits/stdc++.h>

#define start ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define ll long long
#define int ll
#define ls st<<1
#define rs st<<1|1
#define pii pair<int,int>
#define rep(z, x, y) for(int z=x;z<=y;++z)
#define com bool operator<(const node &b)
using namespace std;
mt19937 rnd(chrono::high_resolution_clock::now().time_since_epoch().count());
const int maxn = (ll) 3e5 + 5;
const int mod = 998244353;
const int inf = 0x3f3f3f3f;
int T = 1;

int ac, wa, tle, re;

void solve() {
    int n;
    cin >> n;
    while (n--) {
        string s;
        cin >> s;
        if (s == "AC")
            ++ac;
        else if (s == "WA")
            ++wa;
        else if (s == "TLE")
            ++tle;
        else if (s == "RE")
            ++re;
    }
    cout << "AC x " << ac << endl;
    cout << "WA x " << wa << endl;
    cout << "TLE x " << tle << endl;
    cout << "RE x " << re;
}

signed main() {
    start;
    while (T--)
        solve();
    return 0;
}

Measured memory_bytes: 3644