akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
#define rep(i, a) for (int i = (int)0; i < (int)a; ++i)
#define rrep(i, a) for (int i = (int)a - 1; i >= 0; --i)
#define REP(i, a, b) for (int i = (int)a; i < (int)b; ++i)
#define RREP(i, a, b) for (int i = (int)a - 1; i >= b; --i)
#define pb push_back
#define eb emplace_back
#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()
#define popcount __builtin_popcount
using ll = long long;
constexpr ll mod = 1e9 + 7;
constexpr ll INF = 1LL << 60;


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

ll gcd(ll n, ll m)
{
	ll tmp;
	while (m != 0)
	{
		tmp = n % m;
		n = m;
		m = tmp;
	}
	return n;
}

ll lcm(ll n, ll m)
{
	return abs(n) / gcd(n, m) * abs(m); //gl=xy
}

using namespace std;

void solve(){
	int n;
	cin>>n;
	string s;
	cin>>s;
	int q;
	cin>>q;
	vector<ll>cnt_m(n+1);
	rep(i,n){
		cnt_m[i+1]=cnt_m[i]+ll(s[i]=='M');
	}
	while(q--){
		int k;
		cin>>k;
		vector<vector<ll>>dp(2,vector<ll>(4));
		dp[0][0]=1;
		rep(i,k){
			rep(j,4){
				dp[(i+1)%2][j]+=dp[i%2][j];
			}
			if(s[i]=='D'){
				dp[(i+1)%2][1]+=dp[i%2][0];
			}
			else if(s[i]=='M'){
				dp[(i+1)%2][2]+=dp[i%2][1];
			}
			else if(s[i]=='C'){
				dp[(i+1)%2][3]+=dp[i%2][2];
			}
			rep(j,4)dp[i%2][j]=0;
		}
		for(int i=k;i<n;++i){
			if(s[i-k]=='D'){
				dp[i%2][2]-=(cnt_m[i]-cnt_m[i+1-k]);
				dp[i%2][1]--;
			}
			rep(j,4){
				dp[(i+1)%2][j]+=dp[i%2][j];
			}
			if(s[i]=='D'){
				dp[(i+1)%2][1]+=dp[i%2][0];
			}
			else if(s[i]=='M'){
				dp[(i+1)%2][2]+=dp[i%2][1];
			}
			else if(s[i]=='C'){
				dp[(i+1)%2][3]+=dp[i%2][2];
			}
			rep(j,4)dp[i%2][j]=0;
		}
		cout<<dp[n%2][3]<<"\n";
	}
	
}

int main()
{
	ios::sync_with_stdio(false);
	cin.tie(0);
	cout << fixed << setprecision(15);
	solve();
	return 0;
}


Measured memory_bytes: 12172
k,a,b = map(int,input().split())
ans = 1
cnt = 0
m = 0

if a-1 >= k:
    print(k+1)
else:
    cnt += a-1
    ans += a-1
    if a+2 < b:
        m = k - cnt
        cnt += (m // 2) * 2
        ans += (b-a) * (m // 2)

        if cnt != k:
            ans += 1
        print(ans)
    else:
        print(k+1)


Measured memory_bytes: 3060
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < n; ++i)
#define FOR(i, a, b) for (int i = a; i < b; ++i)
#define ALL(vec) vec.begin(), vec.end()
#define rALL(vec) vec.rbegin(), vec.rend()
using namespace std;
using ll = long long;

int main() {
    int N;
    cin >> N;
    vector<string> vec(N);
    rep(i, N) cin >> vec[i];
    set<string> st(ALL(vec));
    cout << st.size() << endl;
    return 0;
}

Measured memory_bytes: 25116
#include <bits/stdc++.h>
typedef long long int ll;
typedef long double ld;
using namespace std;
int main(){
	ios_base::sync_with_stdio(false);  
	cin.tie(NULL);
	ll h,w,m;cin>>h>>w>>m;
	ll a[h]; ll b[w];
	memset(a,0,sizeof(a));
	memset(b,0,sizeof(b));
	ll m1=0; ll m2=0;
	map<pair<int,int>,bool> mp;
	for(int i=0;i<m;i++){
		int x,y;cin>>x>>y;
		a[x-1]++; b[y-1]++;
		m1 = max(m1,a[x-1]);
		m2 = max(m2,b[y-1]);
		mp[make_pair(x,y)] = true;
	}
	vector<int> v1; vector<int> v2;
	for(int i=0;i<h;i++){
		if(a[i]==m1){
			v1.push_back(i+1);
		}
	}
	for(int i=0;i<w;i++){
		if(b[i]==m2){
			v2.push_back(i+1);
		}
	}
	ll p = v1.size()*v2.size();
	int ans = m1+m2;
	if(p<=m){
		bool flag = false;
		for(int i=0;i<v1.size();i++){
			for(int j=0;j<v2.size();j++){
				if(mp[make_pair(v1[i],v2[j])]!=true){
					flag = true;
					break;
				}
			}
			if(flag==true){
				break;
			}
		}
		if(flag==false){
			ans--;
		}
	}
	cout<<ans<<endl;
}

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

using namespace std;

unsigned int gcd(unsigned int x, unsigned int y) {
    unsigned int temp =x%y;
    x = y;
    y = temp;
    
    if (y == 0) {
        return x;
    } else {
        return gcd(x, y);
    }
}

int main(int argc, char** argv) {
    unsigned int x, y = 0;
    
    cin >> x >> y;
    cout << gcd(x, y) << endl;
    
    return 0;
}

Measured memory_bytes: 1156
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp> 
#include <ext/pb_ds/tree_policy.hpp> 
using namespace std;
using namespace __gnu_pbds; 
#define lli long long int
#define fr(i,a,b) for(int i=a;i<b;i++)
#define bfr(i,a,b) for(int i=a;i>=b;i--)
#define fio ios_base::sync_with_stdio(false); cin.tie(NULL),cout.tie(NULL);
#define tc int t;cin>>t;while(t--)
#define mod 1000000007 
#define all(vec) vec.begin(),vec.end()  
#define ld long double
#define pb push_back

#define ordered_set tree<lli, null_type,less<lli>, rb_tree_tag,tree_order_statistics_node_update> 

/*
bool comp(pair<lli,lli> &a,pair<lli,lli> &b)
{
    if()
}*/




int main()
{
                       
         

        
                    
          fio
          

         lli k;
         lli n,sum=0;
         cin>>k>>n;
         lli a[n];
         fr(i,0,n)cin>>a[i];
         
         
         vector<lli> v;
         fr(i,1,n)v.push_back(a[i]-a[i-1]);
         v.pb(k-a[n-1]+a[0]);
         sort(all(v));
         fr(i,0,n-1)sum+=v[i];
         cout<<sum;
        
          
          
          

         










          





                     
return 0;}

Measured memory_bytes: 3956
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(k,i,n) for(ll i=k;i<n;++i)
#define push_back pb
int main(void){
    // Your code here!
    ll x,n;
    cin>>x>>n;
    vector<ll>a(n);
    rep(0,i,n){
        cin>>a[i];
    }
    sort(a.begin(),a.end());
    ll m=1e9,ans,c=0;
    rep(0,i,110){
        if(c<n&&a[c]==i){
            ++c;
            continue;
        }
        ll d=abs(i-x);
        if(d<m){
            m=d;
            ans=i;
        }
    }
    cout<<ans;
}

Measured memory_bytes: 3604
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> P;
const ll MOD = 1e9+7;
const ll INF = 1e18;
#define rep(i,m,n) for(ll i = (m); i <= (n); i++)
#define rrep(i,m,n) for(ll i = (m); i >= (n); i--)
#define print(x) cout << (x) << endl;
#define printa(x,m,n) for(ll i = (m); i <= n; i++){cout << (x[i]) << " ";} cout<<endl;

ll n;
string s;

int main(){
	cin.tie(0); ios::sync_with_stdio(false);
	
	cin >> s;
	n = s.size();
	if(s[n-1] == '1'){
		print(-1)
		return 0;
	}
	else{
		rep(i, 0, n/2){
			if(s[i] != s[n-2-i]){
				print(-1)
				return 0;
			}
		}
		if(s[0] == '0'){
			print(-1)
			return 0;
		}
		
		vector<P> ans;
		ans.push_back(P(1, 2));
		ll at = 2;
		ll cnt = 2;
		rep(i, 1, n/2){
			if(s[i] == '0'){
				ans.push_back(P(at, cnt+1));
				cnt++;
			}
			else{
				ans.push_back(P(at, cnt+1));
				cnt++;
				at = cnt;
			}
		}
		rep(i, cnt+1, n){
			ans.push_back(P(at, i));
		}
		for(ll i = 0; i < ans.size(); i++){
			cout << ans[i].first << " " << ans[i].second << endl;
		}
	}
	return 0;
}

Measured memory_bytes: 3264
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using V = vector<int>;
using Vll = vector<ll>;
using Vld = vector<ld>;
using Vbo = vector<bool>;
using VV = vector<V>;
using VVll = vector<Vll>;
using VVld = vector<Vld>;
using VVbo = vector<Vbo>;
using VVV = vector<VV>;
using VVVll = vector<VVll>;
using P = pair<int, int>;
using Pll = pair<ll, ll>;
using Pld = pair<ld, ld>;
#define rep2(i, m, n) for (int i = (m); i < (n); ++i)
#define drep2(i, m, n) for (int i = (m)-1; i >= (n); --i)
#define rep(i, n) rep2(i, 0, n)
#define drep(i, n) drep2(i, n, 0)
#define all(a) (a).begin(), (a).end()
struct fast_ios { fast_ios(){ cin.tie(nullptr); ios::sync_with_stdio(false); cout << fixed << setprecision(20); }; } fast_ios_;
template<typename T> inline int sz(T &x) { return x.size(); }
template<typename T> inline bool chmin(T &a, T b) { if (a > b) { a = b; return true; } return false; }
template<typename T> inline bool chmax(T &a, T b) { if (a < b) { a = b; return true; } return false; }
template<typename T1, typename T2> istream &operator>>(istream &is, pair<T1, T2> &p) { is >> p.first >> p.second; return is; }
template<typename T1, typename T2> ostream &operator<<(ostream &os, const pair<T1, T2> &p) { os << '(' << p.first << ", " << p.second << ')'; return os; }
template<typename T> istream &operator>>(istream &is, vector<T> &v) { for (auto &e : v) is >> e; return is; }
template<typename T> ostream &operator<<(ostream &os, const vector<T> &v) { for (auto &e : v) os << e << ' '; return os; }
template<typename T> inline int count_between(vector<T> &a, T l, T r) { return lower_bound(all(a), r) - lower_bound(all(a), l); } // [l, r)
inline int fLog2(const int x) { assert(x > 0); return 31-__builtin_clz(x); } // floor(log2(x))
inline int fLog2(const ll x) { assert(x > 0); return 63-__builtin_clzll(x); }
inline int cLog2(const int x) { assert(x > 0); return (x == 1) ? 0 : 32-__builtin_clz(x-1); } // ceil(log2(x))
inline int cLog2(const ll x) { assert(x > 0); return (x == 1) ? 0 : 64-__builtin_clzll(x-1); }
inline int popcount(const int x) { return __builtin_popcount(x); }
inline int popcount(const ll x) { return __builtin_popcountll(x); }
void fail() { puts("-1"); exit(0); }
// const int INF  = 1<<30;
// const ll INFll = 1ll<<62;
// const ld EPS   = 1e-10;
// const ld PI    = acos(-1.0);
// const int MOD  = int(1e9)+7;
// const int MOD  = 998244353;


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

  if (n >= 30) cout << "Yes\n";
  else cout << "No\n";
  return 0;
}


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

typedef long long ll;
using namespace std;

#define all(x) x.begin(), x.end()
#define f(i,a,b) for(int i = (a); i <= (b); i++)
#define fd(i,a,b) for(int i = (a); i >= (b); i--)
#define mp make_pair
#define faster_io() ios_base::sync_with_stdio(false)
#define pb push_back
#define pii pair<int,int>
#define SZ(x) ((int)x.size())
#define vii vector<pair<int,int>>

const int INF = 1000000005;
const ll INFLL = 1000000000000000002ll;
const ll MOD = 1000000007;

inline ll min(ll a, ll b, ll c){return min(min(a,b),c);}
inline ll min(ll a, ll b, ll c, ll d){return min(min(min(a,b),c),d);}
inline ll max(ll a, ll b, ll c){return max(max(a,b),c);}
inline ll max(ll a, ll b, ll c, ll d){return max(max(max(a,b),c),d);}

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

int N, Par[200005], L[200005], R[200005], In[200005];
pii A[200005];

int find(int n)
{
    if(Par[n] == n) return n;
    else return Par[n] = find(Par[n]);
}

void join(int a, int b)
{
    int ca = find(a), cb = find(b);
    L[ca] = min(L[ca],L[cb]);
    R[ca] = max(R[ca],R[cb]);
    Par[cb] = ca;
}

int main()
{
    cin >> N;
    f(i,1,N) scanf("%d", &A[i].first);
    f(i,1,N) A[i].second = i;
    sort(A+1,A+N+1,greater<pii>());

    f(i,1,N) L[i] = R[i] = i, Par[i] = i;
    ll ans = 0;

    f(p,1,N)
    {
        int x = A[p].first, i = A[p].second;
        if(In[i-1] && find(i-1) != find(i)) join(i-1,i);
        if(In[i+1] && find(i+1 != find(i))) join(i+1,i);

        int c = find(i);
        ll left = i - L[c] + 1;
        ll right = R[c] - i + 1;
        ans += left*right*x;

        In[i] = 1;
    }
    cout << ans;
}


Measured memory_bytes: 4992
#include <iostream>
#include <string>
#include <utility>
#include <algorithm>
#include <map>
#include <vector>
#include <cmath>
#include <cstdlib>
#include <queue>
#include <stack>

using namespace std;

#define REP(i, n) for(int i = 0;i < n;i++)
#define REPR(i, n) for(int i = n;i >= 0;i--)
#define FOR(i, m, n) for(int i = m;i < n;i++)
#define FORR(i, m, n) for(int i = n;i >= m;i--)
#define REPO(i, n) for(int i = 1;i <= n;i++)
#define ll long long
#define INF 1999999999
#define MINF -1999999999
#define ALL(n) n.begin(),n.end()

int main() {
	string a, b, c;
	cin >> a >> b >> c;
	cout << a[0] << b[0] << c[0] << endl;
}

Measured memory_bytes: 256
#include<cstdio>
#include<iostream>
#include<algorithm>
#include<vector>
#include<string>
#include<cstdlib>
#include<cmath>
#include<cstring>
#include<set>
#include<map>
#include<queue>
using namespace std;
#define rep(i,n) for(int (i)=0;(i)<(n);++i)
#define rrep(i,n) for(int (i)=(n)-1;(i)>=0;--i)
#define rep1(i,n) for(int (i)=1;(i)<=(n);++i)
#define rrep1(i,n) for(int (i)=(n);(i)>=1;--i)
#define pb push_back
#define fr first
#define sc second
typedef long long ll;
typedef pair<int,int> P;
typedef pair<double,double> DP;
typedef pair<long long,long long> LP;
typedef double db;
using namespace std;

ll x[4],y[4];
ll N[5];

int main()
{
  rep(i,3){
    cin>>x[i]>>y[i];
    N[x[i]]++;
    N[y[i]]++;

}
  bool b=0;
  b = (N[2]>0&&N[1]>0&&N[3]>0&&N[4]>0) && (N[4]!=3&&N[1]!=3&&N[2]!=3&&N[3]!=3);
  if(b) puts("YES");
  else puts("NO");
}


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

using namespace std;

using int64 = long long;

namespace FastFourierTransform
{
  using C = complex< double >;

  void DiscreteFourierTransform(vector< C > &F, bool rev)
  {
    const int N = (int) F.size();
    const double PI = (rev ? -1 : 1) * acos(-1);
    for(int i = 0, j = 1; j + 1 < N; j++) {
      for(int k = N >> 1; k > (i ^= k); k >>= 1);
      if(i > j) swap(F[i], F[j]);
    }
    C w, s, t;
    for(int i = 1; i < N; i <<= 1) {
      for(int k = 0; k < i; k++) {
        w = std::polar(1.0, PI / i * k);
        for(int j = 0; j < N; j += i * 2) {
          s = F[j + k], t = F[j + k + i] * w;
          F[j + k] = s + t, F[j + k + i] = s - t;
        }
      }
    }
    if(rev) {
      double temp = 1.0 / N;
      for(int i = 0; i < N; i++) F[i] *= temp;
    }
  }

  vector< long long > Multiply(const vector< int > &A, const vector< int > &B)
  {
    int sz = 1;
    while(sz <= A.size() + B.size()) sz <<= 1;
    vector< C > F(sz), G(sz);
    for(int i = 0; i < A.size(); i++) F[i] = A[i];
    for(int i = 0; i < B.size(); i++) G[i] = B[i];
    DiscreteFourierTransform(F, false);
    DiscreteFourierTransform(G, false);
    for(int i = 0; i < sz; i++) F[i] *= G[i];
    DiscreteFourierTransform(F, true);
    vector< long long > X(A.size() + B.size() - 1);
    for(int i = 0; i < A.size() + B.size() - 1; i++) X[i] = F[i].real() + 0.5;
    return (X);
  }
};

int main()
{
  int N, M, Q, A[40001], B[40001], C[100000];
  vector< int > F(200001), G(200001);

  scanf("%d %d %d", &N, &M, &Q);
  for(int i = 0; i < N; i++) scanf("%d", &A[i + 1]), A[i + 1] += A[i];
  for(int i = 0; i < M; i++) scanf("%d", &B[i + 1]), B[i + 1] += B[i];
  for(int i = 0; i < Q; i++) scanf("%d", &C[i]);

  for(int i = 1; i <= N; i++) {
    for(int j = 0; j < i; j++) {
      ++F[A[i] - A[j]];
    }
  }
  for(int i = 1; i <= M; i++) {
    for(int j = 0; j < i; j++) {
      ++G[B[i] - B[j]];
    }
  }
  reverse(begin(G), end(G));
  auto X = FastFourierTransform::Multiply(F, G);
  for(int i = 0; i < Q; i++) {
    if(C[i] == 0) printf("%lld\n", X[200000]);
    else printf("%lld\n", X[200000 - C[i]] + X[200000 + C[i]]);
  }
}

Measured memory_bytes: 25000
#include<iostream>
#include<string>
using namespace std;
int main() {
	int a, b, c, d, e, k;
	cin >> a >> b >> c >> d >> e >> k;
	string s = ":(";
	if (e - a <= k) {
		s = "Yay!";
	}
	cout << s << endl;
}

Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <cmath>
#include <cassert>
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define REP(i,n) FOR(i,0,n)
#define rep(i,n) FOR(i,0,n)
#define DEBUG(x) cout<<#x<<": "<<x<<endl
#define vint vector<int>
#define vdouble vector<double>
#define vstring vector<string>
using namespace std;

#include<map>
#include<set>
#include<queue>

typedef long long ll;
typedef unsigned long long ull;

const int MAX_N = 1000000;

int H, W;
char red[500][500];
char blue[500][500];
vstring inp;

int main() {

    // input
    cin >> H >> W;
    rep(y, H) {
        string s; cin >> s;
        inp.push_back(s);
    }

    // setting
    rep(y, H)
        rep(x, W) {
            red[y][x] = '.';
            blue[y][x] = '.';
        }

    rep(y, H)
        rep(x, W) {
            if(x == 0) red[y][x] = '#';
            else if(x == W-1) blue[y][x] = '#';
            else if(y%2 == 0) red[y][x] = '#';
            else blue[y][x] = '#';
        }

    rep(y, H)
        rep(x, W) {
            if(inp[y][x] == '#'){
                red[y][x] = '#';
                blue[y][x] = '#';
            }
        }

    // output
    rep(y, H){
        rep(x, W) {
            cout << red[y][x];
        }
        cout << endl;
    }
    cout << endl;
    rep(y, H){
        rep(x, W) {
            cout << blue[y][x];
        }
        cout << endl;
    }

}

Measured memory_bytes: 1536
/*input
19 99
*/

#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp> 
#include <ext/pb_ds/tree_policy.hpp> 

#define rep(i,j,n) for(i=j;i<n;i++)
#define repi(i,j,n) for(i=j;i>n;i--)
#define inf 100001
#define M 1000000007
#define ll long long
#define vll vector<long long>
#define vi vector<int>
#define pll pair<long long,long long>
#define pii pair<int,int>
#define vpii vector<pair<int,int> >
#define vpll vector<pair<long long,long long> >
#define pb push_back
#define pf pop_front
#define F first
#define S second
#define endl '\n'

using namespace std;
using namespace __gnu_pbds; 

template<typename T>
using ordered_set=tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;


ll power(ll a,ll m,ll mod){
    ll ans=1;
    while(m){
        if(m%2){
            ans*=a;
            ans%=(mod);
        }
        a=(a*a)%(mod);
        m>>=1;
    }
    return ans;
}


void init(long long* a,long long n,long long val){
    for(long long i=0;i<n;i++)
        a[i]=val;
}



int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL); 
    ll t=1,i,j;
    ll a,b;
    cin>>a>>b;
    ll ans=-1;
    rep(i,1,10000){
    	if(floor(i*0.08)==a&&floor(i*0.1)==b){
    		ans=i;
    		break;
    	}
    }
	cout<<ans<<endl;
    return 0;
}




Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0; i<(n); i++)
#define FOR(i,a,b) for(int i=(a); i<(b); i++)
#define ALL(v) v.begin(), v.end()
#define RALL(v) v.rbegin(), v.rend()
typedef long long ll;
int main(){
    int n; cin >> n;
    vector<ll> a(n+1);
    FOR(i,1,n+1) cin >> a[i];
    vector<ll> s(n+1);
    s = a;
    rep(i,n) s[i+1] += s[i];
    ll ans = 1e16;
    vector<ll> sum(4);
    ll l = 1, r = 3;

    FOR(i,2,n-1){
        while(l < i && abs(s[l] - (s[i] - s[l])) >= abs(s[l+1] - (s[i] - s[l+1]))) l++;
        while(r < n && abs((s[r] - s[i]) - (s[n] - s[r])) >= abs((s[r+1] - s[i]) - (s[n] - s[r+1]))) r++;

        sum[0] = s[l];
        sum[1] = s[i] - s[l];
        sum[2] = s[r] - s[i];
        sum[3] = s[n] - s[r];
        sort(ALL(sum));
        ans = min(ans, sum[3] - sum[0]);
    }

    cout << ans << endl;
}

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

int main(){
    int array[10000];
    int n,i,j,count=0;

    scanf("%d",&n);
    for(i=0;i<n;i++){
        scanf("%d",&array[i]);
    }
    for(i=0;i<n;i++){
        if(array[i]==2 || array[i]==3){
                count++;
            }
        for(j=2;j<sqrt(array[i]);j++){
            if((array[i]%2)==0 || (array[i]%j)==0) break;
            if(j==(int)sqrt(array[i])){
                count++;
            }   
        }
    }
    printf("%d\n",count);
    return 0;
}


Measured memory_bytes: 2052
n,m=map(int,input().split())
h=list(map(int,input().split()))
l=[0]*n

for i in range(m):
    a,b=map(int,input().split())

    if h[a-1] > h[b-1]:
        l[b-1]=1

    if h[a-1] < h[b-1]:
        l[a-1]=1

    if h[a-1] == h[b-1]:
        l[a-1]=1
        l[b-1]=1

print(n-l.count(1))

Measured memory_bytes: 20056
#include <bits/stdc++.h>
using namespace std;
long long int mod = 998244353;
typedef long long int lli;
typedef pair<int,int> pii;
typedef vector<int> vi;
typedef vector<lli> vlli;
typedef vector<bool> vb;
long long int max(long long int a,long long int b){
  if(a>b)
    return a;
  else
    return b;
}
long long int min(long long int a,long long int b){
  if(a<b)
    return a;
  else
    return b;
}
long long int binpow(long long a, long long b, long long m) {
  a %= m;
  long long res = 1;
  while (b > 0) {
    if (b & 1)
      res = res * a % m;
      a = a * a % m;
      b >>= 1;
    }
  return res;
}
long long binpow(long long a, long long b) {
    if (b == 0)
        return 1;
    long long res = binpow(a, b / 2);
    if (b % 2)
        return res * res * a;
    else
        return res * res;
}
 
//############################ENDOFTEMPLATE############################
void solve(){
  int n;
  cin>>n;

  vector<vector<int>> dp(10,vector<int>(10));

  for(int i = 1;i<=n;i++){
    int f = i%10;
    int l;
    if(i<10)
      l = i;
    else{
      int cpy = i;
      while(cpy>=10){
        cpy/=10;
      }
      l = cpy;
    }
    dp[f][l]++;
  }

  lli ans = 0;
  for(int i = 1;i<=9;i++){
    for(int j = 1;j<=9;j++){
      ans = ans+(dp[i][j]*dp[j][i]);
    }
  }

  cout<<ans;
} 
 
 
 
int main(){
  ios::sync_with_stdio(0);
  cin.tie(0);
  //freopen("moobuzz.in","r",stdin);
  //freopen("moobuzz.out","w",stdout);
  int t = 1;
  //cin>>t;
  while(t--){
    solve();
  }
}

Measured memory_bytes: 3644
#include <iostream>
#include <cstdio>
#include <string>
#include <algorithm>
#include <utility>
#include <cmath>
#include <vector>
#include <queue>
#include <set>
#include <map>
#include <numeric>
#include <functional>
using namespace std;
typedef long long ll;
typedef vector<ll> vl;
typedef vector<vector<ll>> vvl;
typedef pair<ll, ll> P;
#define rep(i, n) for(ll i = 0; i < n; i++)
#define exrep(i, a, b) for(ll i = a; i <= b; i++)
#define out(x) cout << x << endl
#define exout(x) printf("%.10f\n", x)
#define chmax(x, y) x = max(x, y)
#define chmin(x, y) x = min(x, y)
#define all(a) a.begin(), a.end()
#define rall(a) a.rbegin(), a.rend()
#define pb push_back
#define re0 return 0
const ll mod = 1000000007;
const ll INF = 1e16;
const ll MAX_N = 100010;
 
int main() {
    ll n, p;
    cin >> n >> p;

    ll cnt1 = 0;
    rep(i, n) {
        ll a;
        cin >> a;
        if(a%2 == 1) {
            cnt1 = 1;
        }
    }

    ll x = 1;
    rep(i, n-1) {
        x *= 2;
    }

    if(cnt1 == 0) {
        if(p == 1) {
            out(0);
        }
        else {
            out(2*x);
        }
    }
    else {
        out(x);
    }
        
    re0;
}

Measured memory_bytes: 256
n,k = map(int,input().split())
r,s,p = map(int,input().split())
t = list(input())
dic = {"r":p,"s":r,"p":s}
ans = 0

for i in range(k):
    ans += dic[t[i]]

for i in range(k,n):
    if t[i] != t[i-k]:
        ans += dic[t[i]]
    else:
        t[i] = 0
print(ans)

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

// boost
#include <boost/multiprecision/cpp_int.hpp>
using boost::multiprecision::cpp_int;

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

using vi = vector<int>;
using vvi = vector<vi>;
using vll = vector<ll>;
using vvll = vector<vll>;
using vb = vector<bool>;
using vs = vector<string>;
using vld = vector<ld>;
using vvld = vector<vld>;

typedef pair<ll, ll> P;

#define bit(n) (1LL << (n))

//#define int long long

#define all(v) v.begin(), v.end()

#define rep(i, n) for (ll i = 0; i < n; i++)
#define REP(i, n) for (ll i = 1; i < n; i++)

#define FOR(i, a, b) for (ll i = (a); i < (b); i++)
#define FORm(i, m) for (auto i = m.begin(); i != m.end(); i++)

template <class T>
inline void chmax(T& a, T b) {
  a = std::max(a, b);
}
template <class T>
inline void chmin(T& a, T b) {
  a = std::min(a, b);
}

#define mod (ll)(1e9 + 7)
// #define mod (998244353ll)

const long long INF = 1LL << 60;

signed main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  cout << fixed << setprecision(20);

  ll n;
  cin >> n;
  vll a(n + 1);
  REP(i, n + 1) {
    cin >> a[i];
  }

  ll ans = 0;
  REP(i, n + 1) {
    if (a[i] % 2 && i % 2)
      ans++;
  }

  cout << ans << endl;

  return 0;
}


Measured memory_bytes: 3616
import java.util.Scanner;
public class Main {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ

		Scanner scan = new Scanner(System.in);

        int num = scan.nextInt();//配列の個数受け取り
        int[] array = new int[num];

        for(int i = 0; i < num; i++) {
         array[i] = scan.nextInt();

        }

         int v, j;
         	for(int i = 1; i <= num-1; i++) {
         		 v = array[i];
         		 j = i - 1;
         		 for(int a = 0; a < num; a++) {
         		System.out.print(array[a]);
if(a < num -1){
System.out.print(" ");
         		}
         		 }
         		 System.out.println();
         		while(j >= 0 && array[j] > v) {
         			array[j+1] = array[j];
         			j--;
         			array[j+1] = v;
         		}
         	}
                for(int a = 0; a < num; a++) {
         		System.out.print(array[a]);
if(a < num -1){
System.out.print(" ");
         		}
	    }
System.out.println();
}
}



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

using namespace std;

using ll = long long;
using ull = unsigned long long;

int main(int argc, char const *argv[]) {
	string a,b;
	std::cin >> a >> b;
	// 桁数比較
	if (a.size() > b.size()) {
		std::cout << "GREATER" << '\n';
		return 0;
	}
	if (a.size() < b.size()) {
		std::cout << "LESS" << '\n';
		return 0;
	}
	// 桁数が同じ
	// 上から順に数値を比較する
	for (size_t i = 0; i < a.size(); i++) {
		if (a[i] > b[i]) {
			std::cout << "GREATER" << '\n';
			return 0;
		}
		if (a[i] < b[i]) {
			std::cout << "LESS" << '\n';
			return 0;
		}
	}
	std::cout << "EQUAL" << '\n';
	return 0;
}


Measured memory_bytes: 256
object Main {
  trait Monoid[A]{
    def op(a1: A, a2: A): A
    def zero: A
  }

  class SegmentTree[A](val numOfNode: Int, val M: Monoid[A]){

    sealed trait Tree{ val value: A }
    case object Leaf extends Tree{ val value: A = M.zero }
    case class Node(value: A, left: Tree, right: Tree) extends Tree
    object Node {
        def apply(value: A) = new Node(value, Leaf, Leaf)
        def apply(l: Tree, r: Tree) = new Node(M.op(l.value,r.value),l,r)
    }

    private val empty: Node = Node(M.zero,Leaf,Leaf)
    private[this] var root: Tree = empty

    private def updateRec(id: Int, x:A, l: Int = 0, r: Int = numOfNode, t: Tree = root): Tree = {
        def branch(now: Node): Node = {
            val m = (l + r)>>1
            if(r-l<=1)Node(x)
            else if(id < m)Node(updateRec(id,x,l,m, now.left), now.right)
            else Node(now.left,updateRec(id,x,m,r,now.right))
        }
        t match {
            case now: Node => branch(now)
            case _ => branch(empty)
        }
    }

    def update(id: Int, x: A): Unit = {
        root = updateRec(id, x)
    }

    def query(a: Int, b: Int, l: Int = 0, r: Int = numOfNode, t: Tree = root): A = {
      val m = (l + r)>>1
      t match {
        case now: Node =>
          if(b<=l || r<=a)M.zero
          else if(a<=l && r<=b)now.value
          else M.op(query(a,b,l,m,now.left),query(a,b,m,r,now.right))
        case _ => M.zero
      }
    }
  }

  def main(args: Array[String]): Unit = {
    val line = scala.io.StdIn.readLine.split(" ").map(_.toInt)
    val n = line(0)
    val q = line(1)
    val m = new Monoid[Int]{
        def op(a1: Int, a2: Int): Int = a1 min a2
        def zero: Int = Int.MaxValue
    }

    val segtree = new SegmentTree[Int](n,m)

    for(i <- 1 to q){
        val input = scala.io.StdIn.readLine.split(" ").map(_.toInt)
        val x = input(1)
        val y = input(2)
        if(input(0)==0)segtree.update(x,y)
        else println(segtree.query(x,y+1))
    }
  }
}

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

char grid[100][100];
int ch[100][100];
int h,w;

int main() {
    cin >> h >> w;
    for(int i = 0; i < h; i++) {
        for(int j = 0; j < w; j++) {
            cin >> grid[i][j];
        }
    }
    
    for(int i = 0; i < h; i++)
        for(int j = 0; j < w; j++) {
            ch[i][j] = 0;
            if (grid[i][j] == '#')
                ch[i][j] = 0;
            else
                ch[i][j] = -1;
        }
    
    for(int i = 0; i < h; i++)
        for(int j = 0; j < w; j++) {
            if (j != 0 && grid[i][j-1] == '#' && grid[i][j] == '#')
                ch[i][j]++;
            if (j != w-1 && grid[i][j+1] == '#' && grid[i][j] == '#')
                ch[i][j]++;
            if (i != 0 && grid[i-1][j] == '#' && grid[i][j] == '#')
                ch[i][j]++;
            if (i != h-1 && grid[i+1][j] == '#' && grid[i][j] == '#')
                ch[i][j]++;
        }
        
    bool ans = 1;
    for(int i = 0; i < h; i++) {
        for(int j = 0; j < w; j++) {
            //cerr <<ch[i][j] << ' ';
            if (ch[i][j] != -1 && ch[i][j] < 1)
                ans = 0;
                
        }
        //cerr << endl;
    }
    if (ans)
        cout << "Yes" << endl;
    else
        cout << "No" << endl;
    return 0;
}


Measured memory_bytes: 256
import java.io.IOException;
import java.io.InputStream;
import java.util.NoSuchElementException;

public class Main {

	public static void main(String[] args) {

		FastScanner sc = new FastScanner();
		int N = sc.nextInt();
		int[] H = new int[N];
		for (int i = 0; i < N; i++)
			H[i] = sc.nextInt();
		int count = 0;
		int a = H[0];
		for (int i = 0; i < N; i++) {
			a = Math.max(a, H[i]);
			if (H[i] >= a)
				count++;
		}
		System.out.println(count);
	}
}

class FastScanner {
	private final InputStream in = System.in;
	private final byte[] buffer = new byte[1024];
	private int ptr = 0;
	private int buflen = 0;

	private boolean hasNextByte() {
		if (ptr < buflen) {
			return true;
		} else {
			ptr = 0;
			try {
				buflen = in.read(buffer);
			} catch (IOException e) {
				e.printStackTrace();
			}
			if (buflen <= 0) {
				return false;
			}
		}
		return true;
	}

	private int readByte() {
		if (hasNextByte())
			return buffer[ptr++];
		else
			return -1;
	}

	private static boolean isPrintableChar(int c) {
		return 33 <= c && c <= 126;
	}

	public boolean hasNext() {
		while (hasNextByte() && !isPrintableChar(buffer[ptr]))
			ptr++;
		return hasNextByte();
	}

	public String next() {
		if (!hasNext())
			throw new NoSuchElementException();
		StringBuilder sb = new StringBuilder();
		int b = readByte();
		while (isPrintableChar(b)) {
			sb.appendCodePoint(b);
			b = readByte();
		}
		return sb.toString();
	}

	public long nextLong() {
		if (!hasNext())
			throw new NoSuchElementException();
		long n = 0;
		boolean minus = false;
		int b = readByte();
		if (b == '-') {
			minus = true;
			b = readByte();
		}
		if (b < '0' || '9' < b) {
			throw new NumberFormatException();
		}
		while (true) {
			if ('0' <= b && b <= '9') {
				n *= 10;
				n += b - '0';
			} else if (b == -1 || !isPrintableChar(b)) {
				return minus ? -n : n;
			} else {
				throw new NumberFormatException();
			}
			b = readByte();
		}
	}

	public int nextInt() {
		long nl = nextLong();
		if (nl < Integer.MIN_VALUE || nl > Integer.MAX_VALUE)
			throw new NumberFormatException();
		return (int) nl;
	}

	public double nextDouble() {
		return Double.parseDouble(next());
	}
}


Measured memory_bytes: 20948
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <functional>
#include <numeric>
#include <stack>
#include <queue>
#include <map>
#include <set>
#include <utility>
#include <sstream>
#include <complex>
#include <fstream>
#include <bitset>
#include <time.h>
#include <tuple>
#include <iomanip>

using namespace std;

typedef long long ll;
typedef pair<ll, ll> P;
typedef vector<ll> V;
typedef complex<double> Point;

#define PI acos(-1.0)
#define EPS 1e-10
const ll INF = 1e12;
const ll MOD = 1e9 + 7;

#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define rep(i,N) for(int i=0;i<(N);i++)
#define ALL(s) (s).begin(),(s).end()
#define EQ(a,b) (abs((a)-(b))<EPS)
#define EQV(a,b) ( EQ((a).real(), (b).real()) && EQ((a).imag(), (b).imag()) )
#define fi first
#define se second
#define N_SIZE (1LL << 20)
#define NIL -1
#define MAX_N 100100

ll sq(ll num) { return num*num; }
ll mod_pow(ll x, ll n) {
	if (n == 0)return 1;
	if (n == 1)return x%MOD;
	ll res = sq(mod_pow(x, n / 2));
	res %= MOD;
	if (n % 2 == 1) {
		res *= x;
		res %= MOD;
	}
	return res;
}
ll mod_add(ll a, ll b) { return (a + b) % MOD; }
ll mod_sub(ll a, ll b) { return (a - b + MOD) % MOD; }
ll mod_mul(ll a, ll b) { return a*b % MOD; }

int m;
int n[10];

ll changes(string s) {
	ll res = 0;
	rep(i, s.size()) {
		res *= 16;
		if (s[i] >= '0'&&s[i] <= '9')res += s[i] - '0';
		else res += s[i] - 'a' + 10;
	}
	return res;
}

int main() {
	cin >> m;
	rep(i, m) {
		ll n[10] = {};
		string s;
		rep(j, 8) {
			cin >> s;
			n[j] = changes(s);
		}
		cin >> s;
		n[8] = changes(s);
		ll K = 0;
		rep(j, 32) {
			ll nn = 0;
			rep(k, 8)nn += (n[k] ^ K);
			if (((n[8] ^ K)&(1LL << j)) != (nn&(1LL << j))) {
				K |= (1LL << j);
			}
		}
		printf("%x\n", K);
	}
}


Measured memory_bytes: 3356
#include <iostream>
#include <cstdio>
#include <vector>
#include <algorithm>
#include <complex>
#include <cstring>
#include <cstdlib>
#include <string>
#include <cmath>
#include <queue>
using namespace std;

#define REP(i,n) for(int i=0;i<(int)n;++i)
#define FOR(i,c) for(__typeof((c).begin())i=(c).begin();i!=(c).end();++i)
#define ALL(c) (c).begin(), (c).end()
const double EPS = 1e-8;
const double INF = 1e12;
typedef complex<double> P;
namespace std {
  bool operator < (const P& a, const P& b) {
    return real(a) != real(b) ? real(a) < real(b) : imag(a) < imag(b);
  }
}
double cross(const P& a, const P& b) {
  return imag(conj(a)*b);
}
double dot(const P& a, const P& b) {
  return real(conj(a)*b);
}

struct L : public vector<P> {
  L(){}
  L(const P &a, const P &b) {
    push_back(a); push_back(b);
  }
};
int ccw(P a, P b, P c) {
  b -= a; c -= a;
  if (cross(b, c) > 0)   return +1;       // counter clockwise
  if (cross(b, c) < 0)   return -1;       // clockwise
  if (dot(b, c) < 0)     return +2;       // c--a--b on line
  if (norm(b) < norm(c)) return -2;       // a--b--c on line
  return 0;
}
bool intersectSS(const L &s, const L &t) {
  return ccw(s[0],s[1],t[0])*ccw(s[0],s[1],t[1]) <= 0 &&
         ccw(t[0],t[1],s[0])*ccw(t[0],t[1],s[1]) <= 0;
}
bool sameline(const L &l, const L &m) {
  double A = cross(l[1] - l[0], m[1] - m[0]);
  double B = cross(l[1] - l[0], l[1] - m[0]);
  return (abs(A) < EPS && abs(B) < EPS) ; // same line
}
P crosspoint(const L &l, const L &m) {
  double A = cross(l[1] - l[0], m[1] - m[0]);
  double B = cross(l[1] - l[0], l[1] - m[0]);
  if (abs(A) < EPS && abs(B) < EPS) return m[0]; // same line
  return m[0] + B / A * (m[1] - m[0]);
}

int main() {
  while(1) {
    L ls[3];
    bool fff = 0;
    REP(i,3) {
      int x1,y1,x2,y2;
      cin >> x1 >> y1 >> x2 >> y2;
      if (!x1&&!y1&&!x2&&!y2) {
        fff = 1;
        break;
      }
      ls[i] = L(P(x1,y1), P(x2,y2));
    }
    if (fff) break;
    
    if (!intersectSS(ls[0], ls[1]) || !intersectSS(ls[1], ls[2]) || !intersectSS(ls[2],ls[0])
        ||sameline(ls[0], ls[1]) ||sameline(ls[1], ls[2]) || sameline(ls[2], ls[0])) {
      cout << "kyo" << endl;
      continue;
    }
    P cp[3];
    REP(i,3) {
      cp[i] = crosspoint(ls[i], ls[(i+1)%3]);
//      cout << cp[i] << endl;
    }
    double S = abs(cross(cp[2]-cp[0], cp[1]-cp[0])) / 2;

//    cout << S << endl;
    if (S >= 1900000) cout << "dai-kichi" << endl;
    else if (S >= 1000000) cout << "chu-kichi" << endl;
    else if (S >= 100000) cout << "kichi" << endl;
    else if (S > EPS) cout << "syo-kichi" << endl;
    else cout << "kyo" << endl;
  }
}

Measured memory_bytes: 0
#include <iostream>
#include <string.h>
#include <stdio.h>
#include <map>
#include <vector>
#include <math.h>
using namespace std;

#define rep(i,a) for(int i=0; i<a; i++)
#define rrep(i,a) for(int i=a; i>=0; i--)
#define triplerep(i,j,k,a) for(int i=0; i<a; i++)for(int j=0; j<a; j++)if(i!=j)for(int k=0; k<a; k++)if(i!=k&&j!=k)
#define loop4(i,j,k,l,a) for(int i=0; i<a; i++)for(int j=0; j<a; j++)if(i!=j)for(int k=0; k<a; k++)if(i!=k&&j!=k)for(int l=0; l<a; l++)if(i!=l&&j!=l&&k!=l)
#define rep1(i,a) for(int i=1; i<=a; i++)

#define scnd1(a) scanf("%d", &a)
#define scnd2(a,b) scanf("%d%d", &a,&b)
#define scnd3(a,b,c) scanf("%d%d%d", &a,&b,&c)
#define scnd4(a,b,c,d) scanf("%d%d%d%d", &a,&b,&c,&d)

#define prtd1(a) printf("%d\n", a)
#define prtd2(a,b) printf("%d %d\n", a,b)
#define prtd3(a,b,c) printf("%d %d %d\n", a,b,c)
#define prtd4(a,b,c,d) printf("%d %d %d %d\n", a,b,c,d)

#define mem(a,n) memset( a, n, sizeof(a))

typedef long long ll;

int N;
bool prime[55559];
vector<int>  nums;

int main() {
    
    cin >> N;
    
    mem( prime, true);
    
    for ( int i = 2; i*i <= 55555; i++ ) {
        int v = i*2;
        while( v <= 55555) {
            prime[v] = false;
            v += i;
        }
    }
    
    int now = 1;
    while( true ) {
        if( prime[++now] && (now%5)==1) {
            nums.push_back(now);
            if (nums.size()>=N) break;
        }
    }
    
    rep(i,N) {
        if (i) cout << " ";
        cout << nums[i];
    }
    cout << endl;
}


Measured memory_bytes: 256
#include <stdio.h>
#include <iostream>
#include <sstream>
#include <algorithm>
#include <functional>
#include <queue>
#include <string.h>
#define FOR(x, z, y) for(int x = (z); y; x++)
#define rep(x, y) for(int x = 0; x < (y); x++)
#define REP(x, z, y) for(int x = (z); x < (y); x++)
#define all(x) x.begin(), x.end()
#define len(x) (sizeof(x) / sizeof(x[0]))
#define split_str(str, sp_word) istringstream stream(str); string res; FOR(cnt, 0, getline(stream,res,sp_word))
#define scanln(x) fgets(x, sizeof x, stdin)
#define down_queue(x) priority_queue<x>
#define up_queue(x) priority_queue<x, vector<x>, greater<x>>
#define i_str(x) atoi(x.c_str())
typedef long long ll;
using namespace std;

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

  if(A + B >= 24) printf("%d",(A + B) - 24); 
  else printf("%d",A + B);

  return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <iomanip>
using namespace std;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }

// 入力
int N;
vector<double> p;

// DP テーブル
double dp[3100][3100];

int main() {
    cin >> N;
    p.resize(N);
    for (int i = 0; i < N; ++i) cin >> p[i];

    // 初期条件
    dp[0][0] = 1.0;

    // DP ループ
    for (int i = 0; i < N; ++i) {
        for (int j = 0; j <= i; ++j) {
            dp[i+1][j+1] += dp[i][j] * p[i];
            dp[i+1][j] += dp[i][j] * (1.0 - p[i]);
        }
    }

    // 答え
    double res = 0.0;
    for (int j = N/2 + 1; j <= N; ++j) res += dp[N][j];
    cout << fixed << setprecision(10) << res << endl;
}

Measured memory_bytes: 50236
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(n);++i)
#define rrep(i,n) for(int i=1;i<(n);++i)
#define all(a) (a).begin(),(a).end()
#define rall(a) (a).rbegin(),(a).rend()
#define maxs(a, b) a = max(a, b)
#define mins(a, b) a = min(a, b)
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
const ll linf = (1ll << 61);
const int inf = 1001001001;
const int mod = 1000000007;

int main() {
	ios::sync_with_stdio(false);
	cin.tie(0);
	int n;
	cin >> n;
	vector<int> col(9);
	rep(i, n) {
		int a;
		cin >> a;
		if (a >= 3200) a = 3200;
		col[int(a / 400)]++;
	}
	int ans = 0;
	rep(i, 8) ans += (col[i] >= 1);
	if (ans == 0) {
		printf("%d %d\n", col[8] >= 1, col[8]);
		return 0;
	}
	printf("%d ", ans);
	ans += col[8];
	printf("%d\n", ans);
	return 0;
}


Measured memory_bytes: 256
#include<stdio.h>

int main(){
    int w,h,x,y,r;
    
    scanf("%d%d%d%d%d",&w,&h,&x,&y,&r);
    if(x<0||y<0||x+r>w||x-r<0||y+r>h||y-r<0){
        printf("No\n");
    }else{
        printf("Yes\n");
    }
    return 0;
}

Measured memory_bytes: 584
#include<bits/stdc++.h>
#define ll long long
#define ull unsigned long long
#define FIO ios_base::sync_with_stdio(false);cin.tie(NULL);
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define mt make_tuple
#define ff first
#define ss second
#define vll vector<ll>
#define pll pair<ll,ll>
#define vpll vector<pll>
#define vvll vector<vll>
#define all(v) v.begin(),v.end()
#define itr(r,v) for(auto r=v.begin();r!=v.end();r++)
#define W while
#define FOR(i,n) for(ll i=0;i<n;i++)
#define ffor(i,a,b) for(ll i=a;i<=b;i++)
#define rfor(i,a,b) for(ll i=a;i>=b;i--)
#define space cout<<"\n\n";
#define endl "\n"
#define pqmx priority_queue<ll>
#define pqmn priority_queue<ll,vll,greater<ll>>
#define fps(x,y) fixed<<setprecision(y)<<x
#define merg(a,b,c) set_union(a.begin(),a.end(),b.begin(),b.end(),inserter(c,c.begin()))
#define set_ar(arr,v) memset(arr,v,sizeof(arr))
#define ctime auto start = high_resolution_clock::now()
#define etime auto stop = high_resolution_clock::now()
#define ptime auto z1z = duration_cast<microseconds>(stop-start); cout<<"Time elapsed : "<<z1z.count()<<" microseconds\n"
#define go_t ll testcases; cin>>testcases; while(testcases--)
#define dbg1(x)             cout <<#x<<": "<<x<<'\n';
#define dbg2(x, y)          cout <<#x<<": "<<x<<" | "<<#y<<": "<<y<<'\n';
#define dbg3(x, y, z)       cout <<#x<<": "<<x<<" | "<<#y<<": "<<y<<" | "<<#z<<": "<<z<<'\n';
#define dbg4(a, b, c, d)    cout <<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<'\n';
#define dbg5(a, b, c, d, e) cout <<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<" | "<<#e<<": "<<e<<'\n';
using namespace std;
using namespace std::chrono;

const ll MOD = 1e9 + 7;
const ll N = 2005;
const ll maxN = 1e5 + 5;
const ll MAX_SIZE = 1e8 + 8;

ll power(ll x, ll y, ll M = MOD) // default argument
{ll v = 1; x = x % M; while (y > 0) {if (y & 1)v = (v * x) % M; y = y >> 1; x = (x * x) % M;} return v;}

int main()
{

#ifndef ONLINE_JUDGE
	freopen("input2.txt", "r", stdin);
	freopen("output2.txt", "w", stdout);
#endif
	// WHILE(!(SUCCEED == TRY()));
	// BEFORE WRITING MAKE SURE YOU HAVE ANALYSED THE CONSTRAINTS
	// AND THINK THROUGH THE LOGIC ONCE MORE
	FIO
	ll n; cin >> n;
	ll ar[n];
	ll xoxo = 0;
	FOR(i, n) {
		cin >> ar[i];
		xoxo = xoxo ^ ar[i];
	}
	FOR(i, n) cout << ( xoxo ^ ar[i] ) << " ";
	return 0;
}


Measured memory_bytes: 5164
"use strict";
function main(input) {
    let line = input.split(/\r?\n/g);
    let arr = line[0].split(" ");
    const N = parseInt(arr[0]), R = parseInt(arr[1]);
    console.log(10 <= N ? R : R + 100 * (10 - N));
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));

Measured memory_bytes: 7372
#include <stdio.h>
int main(void)
{
        int c1, c5, c10, c50, c100, c500;
        int a, b, c, d, e, f, x;
        scanf("%d %d %d %d %d %d",&c1, &c5, &c10, &c50, &c100, &c500);
        a=1*c1;
        b=5*c5;
        c=10*c10;
        d=50*c50;
        e=100*c100;
        f=500*c500;
        x=a+b+c+d+e+f;
        if(x>=1000)
                printf("%d\n",1);
        else
                printf("%d\n",0);
        return 0;
}

Measured memory_bytes: 2740
#include "bits/stdc++.h"
using namespace std;

int main() {
	int x,y;
	while(true){
		cin>>x>>y;
		if (x==0&&y==0) {
			return 0;
		} else if(x<y){
			cout<<x<<" "<<y<<endl;
		}else{
			cout<<y<<" "<<x<<endl;
		}
	}
}

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

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

using ll = long long;

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

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

int main() {
  int N;
  cin>>N;
  string s;
  cin>>s;
  int cnt = 0;
  int mi = 0;
  for(int i = 0; i < N; i++) {
    if(s[i]=='(') cnt++;
    if(s[i]==')') {
      cnt--;
      chmin(mi,cnt);
    }
  }
  for(int i = 0; i < abs(mi);i++){
    cout<<'(';
  }
  cout<<s;
  for(int i = 0; i < cnt+abs(mi); i++){
    cout<<')';
  }
}

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

int pow_int(int x, int n) {
    if (n == 0) {
        return 1;
    }else {
        int y = x;
        for (int i = 0; i < n-1; i++) {
            x *= y;
        }
        return x;
    }
}

int main() {
    int n, m;
    cin >> n >> m;
    vector<int> s(m);
    vector<int> c(m);
    rep(i, m) cin >> s[i] >> c[i];
    bool flag1 = false;
    for (int i = 0; i < m-1; i++) {
        rep(j, m) {
            if (i != j && s[i] == s[j] && c[i] != c[j]) flag1 = true;
        }
    }
    rep(i, m) {
        if ((s[i] == 1 && c[i] == 0 && n != 1) || (s[i] > n)) flag1 = true;
    }
    if (flag1) {
        cout << -1 << endl;
    }else {
        vector<int> x(n, 0);
        rep(i, m) x[s[i] - 1] = c[i];
        if (n == 3 && x[0] == 0) x[0] = 1;
        if (n == 2 && x[0] == 0) x[0] = 1;
        int ans = 0;
        rep(i, n) {
            ans += x[i] * pow_int(10, n-(1+i));
        }
        cout << ans << endl;
    }
}

Measured memory_bytes: 256
import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        // Your code here!
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int[] array = new int[n];
        for (int i = 0; i < n; i++) {
            array[i] = sc.nextInt();
        }
        
        Arrays.sort(array);
        
        int answer = 0;
        for (int i = 0; i < n - 1; i++) {
            for (int j = i + 1; j < n; j++) {
                int sum = array[i] + array[j];
                int a = lowerBound(array, sum) - 1;
                answer += a - j;
            }
        }
        System.out.println(answer);
    }
    
    public static int lowerBound(int[] array, int target) {
        // 初めてのtarget以上のindexを返す
        // {1, 3, 3, 7} target: 3 -> 1
        
        int left = 0;
        int right = array.length;
        
        while (left < right) {
            int center = (left + right) / 2;
            if (array[center] < target) {
                left = center + 1;
            } else {
                right = center;
            }
        }
        
        return left;
    }
    
    public static int upperBound(int[] array, int target) {
        // 初めてのtarget超過のindexを返す
        // {1, 3, 3, 7} target: 3 -> 3
        
        int left = 0;
        int right = array.length;
        
        while (left < right) {
            int center = (left + right) / 2;
            if (array[center] <= target) {
                left = center + 1;
            } else {
                right = center;
            }
        }
        
        return left;
    }
}


Measured memory_bytes: 26924