akhauriyash/Code-Regression huggingface dataset:
s = str(input())
a = int(s[:2])
b = int(s[2:])
if 1 <= a <= 12 and 1 <= b <= 12:
  print("AMBIGUOUS")
elif 1 <= a <= 12 and (b == 0 or b > 12):
  print("MMYY")
elif 1 <= b <= 12 and (a == 0 or a > 12):
  print("YYMM")
else:
  print("NA")

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

using namespace std;

using ll = long long;

bool isMaximize(int i, int j, int n){
    int cnt = j-i+1;
    return (n - cnt) % 2 == 0;
}

ll _deque(vector<int>& s) {
    int n = s.size();
    vector<vector<ll>> dp(n, vector<ll>(n, 0));

    for (int i = 0; i < n; ++ i) {
        dp[i][i] = isMaximize(i,i,n) ? s[i] : -s[i]; 
    }
    for (int k = 2; k <= n; ++ k) {
        for (int j = 0; j + k - 1 < n; ++ j) {
            if (isMaximize(j, j+k-1, n)) {
                dp[j][j+k-1] = max(dp[j][j+k-2]+s[j+k-1], dp[j+1][j+k-1]+s[j] );
            }
            else {
                dp[j][j+k-1] = min(dp[j][j+k-2]-s[j+k-1], dp[j+1][j+k-1]-s[j]);
            }
        }
    }
    return dp[0][n-1];
}

int main() {
    int N; 
    cin>>N;
    vector<int> s(N);
    for (auto& e : s) { cin>>e; }
    cout<< _deque(s) <<endl;
    return 0;
}

Measured memory_bytes: 70656
#include <bits/stdc++.h>
#define int long long
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define all(x) (x).begin(),(x).end()
#define pb push_back
#define F first
#define S second

using namespace std;
using P = pair<int,int>;
using ivec = vector<int>;
using Graph = vector<vector<int>>;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }

const int MOD=1000000007;
int INF=100100100100100;
int add(int a,int b){
  return (a+b)%MOD;
}
int prod(int a,int b){
  return (a*b)%MOD;
}

int beki(int a,int b)
{
	if(b==0)return 1;
	int x=beki(a,b/2);
	if(b%2==0)return (x*x)%MOD;
	else return (((a*x)%MOD)*x)%MOD;
}

int inv(int a)
{
	return beki(a,MOD-2);
}

int kaijou(int a)
{
	int ans=1;
	for(int i=1;i<=a;i++)
	{
		ans=(ans*i)%MOD;
	}			
	return ans;
}

/*int combi(int a,int b)
{
	int ret=1;
	for(int i=1;i<=b;i++)
	{
		ret=(((ret*(a+1-i))%MOD)*inv(i))%MOD;
	}
	return ret;
}*/
/*
const int MAX_a=200010;
int cb[MAX_a+1]
void combi(int a,int b)
{
    int ret=1;
    cb[0]=1;
    for(int i=1;i<=b;i++)
    {
	ret=(((ret*(a+1-i))%MOD)*inv(i))%MOD;
        cb[i]=ret;
    }
	
}*/

vector<P> prime_factorize(int N)
{
	vector<P> res;
	for(int a=2;a*a<=N;a++)
	{
		if(N%a!=0)continue;
		int ex=0;
		while(N%a==0)
		{
			ex++;N/=a;
		}
		res.push_back(P(a,ex));
	}
	if(N!=1)res.push_back(P(N,1));
	return res;
}

//ここから書く
signed main(){
  int n,h,w;cin>>n>>h>>w;
  int ans=0;
  rep(i,n){
    int a,b;cin>>a>>b;
    if(a>=h && b>=w)ans++;
  }
  cout<<ans<<endl;
  return 0;
}

Measured memory_bytes: 3584
#include<bits/stdc++.h>
using namespace std;
#define f first
#define s second
#define p pair<int,int>
#define P pair<ll,ll>
#define pb push_back
#define ll long long
#define ull unsigned long long
#define db double
#define zero(a) memset(a,0,sizeof(a))
#define inff(a,n) fill(a,a+n+1,inf)
#define all(a) a.begin(),a.end()
#define sz(a) int((a).size())
#define read(x) scanf("%d",&x)
#define read2(x,y) scanf("%d%d",&x,&y)
#define write(x) printf("%d\n",x)

const int maxn=2e5+10;
const ll inf=1e9;
const int base1=31,base2=127;

int x,n,m,flag,sum1,sum2,flag1,flag2,ok,ans,ans1,ans2,a[maxn],b[maxn];

string s,s1,s2,t;
map<int,int>mp;

int main()
{
    read(n);
    for(int i=1;i<=n;i++)read(a[i]),mp[a[i]]++;
    read(n);
    for(int i=1;i<=n;i++)
    {
        read(x);
        if(mp[x]>0)
        {
            mp[x]--;
        }
        else
        {
            cout<<"NO";
            return 0;
        }
    }
    cout<<"YES";
    return 0;
}

Measured memory_bytes: 10368
import java.util.*;
public class Main {
	public static void main(String[] args) {
		Scanner scn=new Scanner(System.in);
		int n=scn.nextInt();
		int[] a=new int[n];
		int[] b=new int[n];
		int[] c=new int[n];
		for(int i=0;i<n;i++) {
			a[i]=scn.nextInt();
			b[i]=scn.nextInt();
			c[i]=scn.nextInt();
			
		}
		int[][] dp =new int[n][3];
		dp[0][0]=a[0];
		dp[0][1]=b[0];
		dp[0][2]=c[0];
		for(int i=1;i<n;i++) {
			dp[i][0]=a[i]+Math.max(dp[i-1][1], dp[i-1][2]);
			dp[i][1]=b[i]+Math.max(dp[i-1][0], dp[i-1][2]);
			dp[i][2]=c[i]+Math.max(dp[i-1][0],dp[i-1][1]);
			
		}
		System.out.println(Math.max(Math.max(dp[n-1][0], dp[n-1][1]), dp[n-1][2]));
		
		
	}

}


Measured memory_bytes: 61596
#include<iostream>
#include<cstdlib>
#include<string>
#include<vector>
#include<map>
#include<unordered_map>
#include<queue>
#include<algorithm>
#include<iomanip>
#include<typeinfo>
#include<complex>
using namespace std;
using ll = long long int;
const int mod = 1e9 + 7;
#define rep(i, a, b) for(ll i = a;i < b; i++)
const long double PI = (acos(-1));

int main() {

	long double a, b, h, m;
	cin >> a >> b >> h >> m;

	long double atheta, btheta, theta;

	atheta = 30 * h + 0.5 * m;
	btheta = m * 6;
	theta = btheta - atheta;
	theta = abs(theta);
	theta = theta * PI / 180;

	long double ans = a * a + b * b - 2 * a * b * cos(theta);
	
	ans = sqrt(ans);

	cout << fixed << setprecision(20) << ans << endl;

	return 0;
}

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

typedef long long int ll;
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<pair<int, int> > vii;
#define rrep(i, m, n) for(int (i)=(m); (i)<(n);  (i)++)
#define erep(i, m, n) for(int (i)=(m); (i)<=(n); (i)++)
#define  rep(i, n)    for(int (i)=0; (i)<(n);  (i)++)
#define  rev(i, n)    for(int (i)=(n)-1; (i)>=0; (i)--)
#define vrep(i, c)    for(__typeof((c).begin())i=(c).begin(); i!=(c).end(); i++)
#define  ALL(v)       (v).begin(), (v).end()
#define mp            make_pair
#define pb            push_back
template<class T1, class T2> inline void minup(T1& m, T2 x){ if(m>x) m=static_cast<T2>(x); }
template<class T1, class T2> inline void maxup(T1& m, T2 x){ if(m<x) m=static_cast<T2>(x); }

#define INF 1000000000
#define MOD 1000000007
#define EPS 1E-12

int N, K;
int x, y;

int main()
{
  cin >> N >> K;
  while(K--){
    cin >> x >> y;
    cout << min(min(x-1, N-x), min(y-1, N-y)) % 3 + 1 << endl;

  }

  return 0;
}

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

#define TYPE(c)   remove_reference_t<decltype(c)>
#define REP(i, n) for(TYPE(n) i = 0; i < n; i++)
#define FOR(v, c) for(TYPE(c.begin()) v = c.begin(); v != c.end(); v++)
#define ALL(c)    c.begin(), c.end()
#define SORT(c)   sort(ALL(c))
#define RSORT(c)  sort(ALL(c), greater<TYPE(c)::value_type>())
#define UNIQUE(c) c.erase(unique(ALL(c)), c.end())

using namespace std;
using ll = long long;

constexpr int MOD  = (int)1e9 + 7;
constexpr int INF  = (int)1e9 + 1;
constexpr ll  LINF = (ll)1e18 + 1;
template<typename T> constexpr bool chmax(T& a, const T& b)
{ if(a < b) { a = b; return true; } else { return false; } }
template<typename T> constexpr bool chmin(T& a, const T& b)
{ if(b < a) { a = b; return true; } else { return false; } }
template<typename S, typename T> ostream& operator<<(ostream &os, const pair<S, T>& p)
{ return os << "(" << p.first << "," << p.second << ")"; }
ostream& operator<<(ostream &os, const string& s)
{ FOR(v, s) os << *v; return os; }
template<typename T> auto operator<<(ostream& os, const T& t)
    -> typename conditional<true, ostream&, decltype(*t.begin())>::type
{ os << "["; FOR(v, t) { if(v != t.begin()) os << ","; os << *v; } os << "]"; return os; }

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

    int N;
    std::cin >> N;
    string S;
    std::cin >> S;

    string ans = "No";
    if(N % 2 == 0) {
        auto fh = S.substr(0, N / 2);
        auto sh = S.substr(N / 2);
        if(fh == sh) {
            ans = "Yes";
        }
    }
    std::cout << ans << std::endl;

    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#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 = m;i >= n;i--)
#define SORT(v, n) sort(v, v+n);
#define VSORT(v) sort(v.begin(), v.end());
#define llong long long
#define pb(a) push_back(a)
#define INF 999999999999
#define MOD 1000000007
 
using namespace std;
typedef pair<int, int> P;
typedef pair<llong, llong> LP;
typedef pair<int, P> PP;
typedef pair<llong, LP> LPP;
typedef vector<llong> LV;

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

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

    int a;
    vector<int> b(N,1);
    b[N-1]=0;
    REP(i,M){
        cin >> a;
        b[a-1]-=10;
        if(a>1) b[a-2]-=1;
        if(a<N) b[a] -= 1;
    }
    llong ans=1;
    LV dp(N+1);
    dp[0]=1;dp[1]=2;
    FOR(i,2,N+1){
        dp[i]=(dp[i-1]+dp[i-2]) % MOD;
    }
    int t=0;
    REP(i,N){
        if(b[i]<-9){
            cout << 0 << endl;
            return 0;
        }else if(b[i]==1){
            t++;
        }else{
            ans=ans*dp[t] % MOD; 
            t=0;
        }
    }
    cout << ans << endl;
    return 0;

}


// 00 : 1

// 010 : 2

// 0110:3

// 01110:5

// 011110:8
// 020110
// 020200
// 020120
// 011--- 3
// 0120-- 2


// 0n0 = 01(n-1)0 + 020(n-2)0
// an = a(n-1) + a(n-2)



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

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

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    int n;
    long long k;
    cin >> n >> k;
    long long a[n]; cin >> a[0];  
    long long g = a[0], ma = a[0]; 
    bool ok = false; 
    for(int i = 1; i < n; i++){
        cin >> a[i];
        g = gcd(g, a[i]);
        ma = max(ma, a[i]);
        if(k == a[i]) ok = true;
    }
    if(k%g == 0 && ma >= k) ok = true;
    if(ok) cout << "POSSIBLE" << endl;
    else cout << "IMPOSSIBLE" << endl;
    return 0;
}

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


int main(){
  int a, b;
  cin >> a >> b;
  if((b-1)%(a-1)>0){
    cout << (b-1)/(a-1)+1 << endl;
  }else{
    cout << (b-1)/(a-1) << endl;
  }

}

Measured memory_bytes: 384
from collections import deque
import math; floor,ceil = math.floor,math.ceil
import sys; input = lambda: sys.stdin.readline().rstrip()
aint = lambda: int(input()); ints = lambda: list(map(int, input().split()))
Yes = lambda boolean: print('Yes') if boolean else print('No')
YES = lambda boolean: print('YES') if boolean else print('NO')
is_even = lambda x: True if x%2==0 else False

def main():
    n = aint()
    a = ints();d = deque(a)
    buka = [0]*n
    for _ in range(n-1):
        buka[d.popleft()-1]+=1
    for num in buka:
        print(num)

if __name__ == '__main__':
    main()

Measured memory_bytes: 33532
import java.util.Scanner;

public class Main{

	public static void main(String[] args) {
		Scanner scn = new Scanner(System.in);
		int A = scn.nextInt();
		int B = scn.nextInt();
		int C = 0;
		if(A >12 ) {
			C = B;
		}else {
			if(A > 5) {
				C = B/2;
			}else {

			}
		}
		System.out.println(C);
	}

}


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

typedef long long ll;
typedef long double ld;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef pair<ld,ld> pdd;
typedef vector<ll> vll;
typedef vector<ld> vld;
typedef vector<pll> vpl;
typedef vector<vll> vvll;

#define ALL(a) a.begin(),a.end()
#define SZ(a) ((int)a.size())
#define FI first
#define SE second
#define REP(i,n) for(int i=0;i<((int)n);i++)
#define REP1(i,n) for(int i=1;i<((int)n);i++)
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define PB push_back
#define EB emplace_back
#define MP(a,b) make_pair(a,b)
#define SORT_UNIQUE(c) (sort(c.begin(),c.end()), c.resize(distance(c.begin(),unique(c.begin(),c.end()))))
#define GET_POS(c,x) (lower_bound(c.begin(),c.end(),x)-c.begin())
#define yes cout<<"Yes"<<endl
#define YES cout<<"YES"<<endl
#define no cout<<"No"<<endl
#define NO cout<<"NO"<<endl
#define Decimal fixed<<setprecision(20)
#define INF 1000000000
#define LLINF 1000000000000000000LL

const int inf = 1e9;
const ll linf = 1LL << 50;
const double eps = 1e-10;
const int MOD = 1e9 + 7;
const int dx[4] = {-1, 0, 1, 0};
const int dy[4] = {0, -1, 0, 1};

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

  ll n,k;
  cin>>n>>k;
  vll p(n),c(n);
  REP(i,n)cin>>p[i];
  REP(i,n)p[i]--;

  REP(i,n)cin>>c[i];


  ll ans=-LLINF;
  REP(i,n){
    //detect cycle
    vll v;
    ll all = 0;
    ll now = i;

    while(true){
      now=p[now];
      all+=c[now];
      v.push_back(now);
      if(now==i)
        break;
    }

    ll sum = 0;
    ll sz=v.size();
    for (ll i = 0; i < sz; i++)
    {
      sum += c[v[i]];
      ll g=max(all, 0LL);
      if(i+1<=k)
      ans = max(ans, sum + (k - 1 - i) / sz * g);
    }
  }

  cout<<ans<<endl;
}



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


    int N; cin >> N;
    int value[N];rep(i,0,N) cin >> value[i];
    int cost[N]; rep(i,0,N) cin >> cost[i];
    int ans = 0;

    rep(i,0,N){
       int diff = value[i] - cost[i];
       if(diff >= 0){
           ans += diff;
       }
   }

    cout << ans << endl;
    
}



Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main(){
  int x,y,ans = 0;
  
  cin >> x >> y;
  
  if(x == 1){
    ans += 300000;
  }else if(x == 2){
    ans += 200000;
  }else if(x == 3){
    ans += 100000;
  }
  if(y == 1){
    ans += 300000;
  }else if(y == 2){
    ans += 200000;
  }else if(y == 3){
    ans += 100000;
  }
  if(x == 1 && y == 1){
    ans += 400000;
  }
  
  cout << ans << endl;
}

Measured memory_bytes: 256
#include <cstdio>
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <iterator>
#include <array>
#include <limits>
#define _USE_MATH_DEFINES
#include <cmath>

using namespace std;
#define REP(i,n) FOR(i,0,n)
#define FOR(i,a,b) for(int i = (a); i < (b); i++)

int main() {
	string inputLine;
	const string CODEFES = "CODEFESTIVAL2016";
	cin >> inputLine;
	int failCnt = 0;
	REP(i, inputLine.length()) {
		if (CODEFES[i] != inputLine[i]) {
			failCnt++;
		}
	}
	cout << failCnt << endl;

	return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <cstring>
int main()
{
	int H,W,n;
	int mp[18][18];
	int check[18][18];
	
	while(std::cin>>W>>H,W|H){
		memset(mp,0,sizeof(mp));
		memset(check,0,sizeof(check));
		std::cin>>n;
		for(int i=0; i<n; i++){
			int x,y; std::cin>>x>>y;
			check[H-y+1][x] = -1;
		}
		mp[H][1] = 1;
		
		for(int i=H; i>0; i--){
			for(int j=1; j<=W; j++){
				if( check[i][j]==-1 )continue;
				mp[i][j] += mp[i+1][j] + mp[i][j-1];
			}
		}
		/*
		for(int i=0; i<H+1; i++){
			for(int j=0; j<W+1; j++)
				printf("%d ",mp[i][j]);
			puts("");
		}
		puts("");
		*/
		printf("%d\n",mp[1][W]);
	}
	return 0;
}

Measured memory_bytes: 0
#include <iostream>

using namespace std;

int main()
{
    int a, b, c;
    cin >> a >> b >> c;
    
    if((a==(b+c)) || (b==(a+c)) || (c==(a+b))){
        cout << "Yes" << endl;
    }else cout << "No" << endl;
    
}

Measured memory_bytes: 256
#ifndef __cplusplus
    cat << EOF
#endif
#include <bits/stdc++.h>
using namespace std;

#define rep(...) overload_rep(__VA_ARGS__, rep_1, rep_0)(__VA_ARGS__)
#define rep_0(i, end) for(int i = 0; i < (end); ++i)
#define rep_1(i, fr, ba) for(int i = (fr); i <= (ba); ++i)
#define overload_rep(arg0, arg1, arg2, name, ...) name
#define all(box) box.begin(), box.end()

template <class T, class U> inline bool chmax(T& lhs, const U& rhs) { if(lhs < rhs) { lhs = rhs; return 1; } return 0; }
template <class T, class U> inline bool chmin(T& lhs, const U& rhs) { if(lhs > rhs) { lhs = rhs; return 1; } return 0; }

int main() {

    int n;
    cin >> n;
    map<string, int> mp;
    rep(i, n) {
        string s;
        cin >> s;
        mp[s]++;
    }

    cout << mp["E869120"] << '\n';

}



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

int main() {
  int n; cin >> n;
  vector<int> d(n);
  for(int i = 0; i < n; ++i) cin >>d[i];
  int count = 1;
  sort(d.begin(), d.end());
  for(int i = 0; i+1 <n;++i){
    if(d.at(i) < d.at(i+1)) ++count;
  }
  cout << count << endl;
}



Measured memory_bytes: 256
#include <iostream>
#include <cmath>
#include <string>
#include <algorithm>
#include <set>
#include <vector>
#include <map>
#include <list>
#include <stack>
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <queue>
#define mkp make_pair
#define fi first
#define se second
#define pt(num) cout << num << "\n"
#define max(a, b) ((a)>(b) ? (a):(b))
#define min(a, b) ((a)<(b) ? (a):(b))
#define chmax(a, b) (a<b ? a=b : 0)
#define chmin(a, b) (a>b ? a=b : 0)
#define INF 1000000000000000000
#define MOD 1000000007LL
#define MAX 100010
using namespace std;
typedef long long ll;
typedef pair<ll, ll> P;
typedef map<ll, ll> Map;



int main(void) {
    ll N, T;
    cin >> N >> T;
    ll i;
    ll a[MAX];
    ll mn=INF;
    ll mxp=0;
    ll ans=0;
    for(i=0; i<N; i++)
        cin >> a[i];
    
    for(i=0; i<N; i++) {
        mn=min(mn, a[i]);
        mxp=max(mxp, a[i]-mn);
    }

    mn=INF;
    for(i=0; i<N; i++) {
        if(mxp==a[i]-mn) ans++;
        mn=min(mn, a[i]);
    }
    
    
    pt(ans);
    
}






Measured memory_bytes: 1024
#include<iostream>
#include<cmath>
#include<vector>
#include<set>
#include<algorithm>
#include<tuple>
#include<utility>
#include<cctype>
#include<climits>
#include<map>
#include<queue>
#include<functional>

using namespace std;
template<class T> void chmax(T& a, T b) {if(a < b){a=b;}}
template<class T> void chmin(T& a, T b) {if(a > b){a=b;}}

#define REP(i,a,n) for(int i=a;i<n;++i)
#define RUP(a,b) ((a+b-1)/(b))
#define ENT "\n"
#define REV(v) reverse(v.begin(),v.end())
#define SRTV(v) sort(v.begin(),v.end())
#define SRTA(a,n) sort(a,a+n)
#define MOD 1000000007

typedef long long ll;
typedef tuple<int,int,bool> Tb;

int atcoder(){
    //入力
    int a,b,c,x;
    cin >> a >> b >> c >> x;
    int ans = 0;
    REP(i,0,a+1){
        REP(j,0,b+1){
            REP(k,0,c+1){
                if(i*500+j*100+k*50==x) ans++;
            }
        }
    }
    //処理
    //出力
    cout << ans << ENT;
    return 0;
}

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


Measured memory_bytes: 256
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            StringBuilder sb = new StringBuilder();

            while (true)
            {
                int n = int.Parse(Console.ReadLine());

                if (n == 0) break;

                int[] c = new int[n];
                long[] wt = new long[n];

                for (int i = 0; i < n; i++)
                {
                    c[i] = int.Parse(Console.ReadLine());
                }

                Array.Sort(c);

                for (int i = 1; i < n; i++)
                {
                    wt[i] = wt[i - 1] + c[i - 1];
                }

                long sum = wt.Sum();

                sb.AppendLine(sum.ToString());
            }
            Console.Write(sb);
        }
    }
}

Measured memory_bytes: 10068
require 'bigdecimal'

N, K = gets.split.map(&:to_i)
array = [0]
array.append(gets.split.map(&:to_i)).flatten!
#p array

(N-K).times { |idx|
  #puts "idx:#{array[idx+1]} idx+K: #{array[idx + K + 1]}"
  puts array[idx+1] >= array[idx + K + 1] ? "No" : "Yes"
}



Measured memory_bytes: 33964
n,m=map(int,input().split())
li = []
h=list(map(int,input().split()))
for i in range(m):
    a,b=map(int,input().split())
    if h[a-1]<h[b-1]:
        li.append(a)
    elif h[a-1]==h[b-1]:
        li.append(a)
        li.append(b)
    else:
        li.append(b)
print(n-len(set(li)))

Measured memory_bytes: 91128
#include<iostream>
#include<string>
#include<vector>
#include<numeric>
#include<math.h>
#include<algorithm>
#include<iomanip>
using namespace std;

class Permutation {
// 公開関数
public:
	// コンストラクタ
	Permutation();
	// デストラクタ
	~Permutation();
	// 順列を計算するメイン関数
	const vector<vector<int>>& calc_main(int N);
// 内部関数
private:
	// 順列を計算するための再帰関数
	void calc_perm(vector<bool> jdg, vector<int> num);
// 内部変数
private:
	// 計算した順列を格納するvector配列
	vector<vector<int>> ans;
	// 計算する階乗を示す整数
	int N = 1;
};

// コンストラクタ
Permutation::Permutation() {
	// 答えを格納するメンバ変数のvector配列を初期化
	ans.clear();
}

// デストラクタ
Permutation::~Permutation() {
}

// 順列を計算するメイン関数
const vector<vector<int>>& Permutation::calc_main(int N) {
	// 計算する階乗を示す整数を内部変数に格納
	this->N = N;

	// 順列に含まれているかを確認するbool型のvector配列を宣言
	vector<bool> jdg(this->N, false);

	// 再帰関数を用いて順列を計算
	vector<int> num;
	// 初期化
	num.clear();
	calc_perm(jdg, num);

	// 順列が格納されたvector配列を戻り値として返す
	return ans;
}

// 順列を計算するための再帰関数
void Permutation::calc_perm(vector<bool> jdg, vector<int> num) {
	// すべての整数を使って順列を作成した場合
	if (jdg.end() == find(jdg.begin(), jdg.end(), false)) {
		// 答えを格納
		ans.push_back(num);
	}

	// 整数のループ
	for (size_t i = 1; i <= N; i++) {
		if (jdg[i - 1] == false) {
			vector<int> dnum = num;
			dnum.push_back(i);
			jdg[i - 1] = true;
			calc_perm(jdg, dnum);
			jdg[i - 1] = false;
		}
	}
}

// メイン関数
int main() {

	// 整数 N の読込
	int N;
	cin >> N;

	// 整数 N の順列を作成
	Permutation perm;
	const vector<vector<int>>& ans = perm.calc_main(N);

	// N の最大値は 8 であるから、順列を文字列で表現
	vector<string> p(ans.size(),"");
	for (size_t i = 0; i < ans.size(); i++) {
		for (size_t j = 0; j < ans[i].size(); j++) {
			p[i] += to_string(ans[i][j]);
		}
	}

	// ベクトル配列 p を辞書順に並び替え
	sort(p.begin(), p.end());

	// ２つの順列の読込
	string p_str = "";
	string q_str = "";
	int d = 0;
	// P の順列を読込
	for (size_t i = 0; i < N; i++) {
		cin >> d;
		p_str += to_string(d);
	}
	// Q の順列を読込
	for (size_t i = 0; i < N; i++) {
		cin >> d;
		q_str += to_string(d);
	}

	size_t val = abs(distance(find(p.begin(), p.end(), p_str), find(p.begin(), p.end(), q_str)));

	cout << val << endl;

	return 0;
}


Measured memory_bytes: 5300
#include <cstdio>
#include <iostream>
#include <algorithm>
#include <vector>
 
using namespace std;

#define PB push_back
#define MP make_pair
#define REP(i,n) for(int i=0;i<(n);i++)

int main() {
    int r;
    cin>>r;
    cout<<r*r<<endl;
}

Measured memory_bytes: 256
#include <stdio.h>
#include <string.h>

int main(void)
{
	int a,b,c,i,check=0;
	scanf("%d%d%d",&a,&b,&c);
	for(i;i<b;i++)
		{if(a*(b+i)%b==c){check=1; printf("YES"); break;}}
	if(check==0){printf("NO");}
	

	return 0;
}



Measured memory_bytes: 128
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for (int (i)=(0);(i)<(int)(n);++(i))
#define p(x) cout<<(x)<<endl;
#define pv(v) for(auto a: v){ cout << a << endl; }

int main() {
  // int n; cin >> n;
  vector <int> ls(3);
  rep(i, 3){
    cin >> ls[i];
  }

  sort(ls.begin(), ls.end());

  p(ls[0] + ls[1]);
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<ll, ll>;

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

    string S;
    cin >> S;

    vector<int> cnt(3, 0);
    for (auto &c : S) {
        cnt.at(c - 'a')++;
    }

    if (max(abs(cnt.at(0) - cnt.at(1)), max(abs(cnt.at(1) - cnt.at(2)), abs(cnt.at(2) - cnt.at(0)))) <= 1) {
        cout << "YES" << endl;
    } else {
        cout << "NO" << endl;
    }

    return 0;
}

Measured memory_bytes: 512
// -*- coding:utf-8-unix -*-

use proconio::input;

fn main() {
    input! {
        w: u64,
        h: u64,
        x: u64,
        y: u64,
    }

    if w == 2 * x && h == 2 * y {
        println!("{} 1", (w * h) as f64 / 2.0);
    } else {
        println!("{} 0", (w * h) as f64 / 2.0);
    }
}


Measured memory_bytes: 2216
#include<bits/stdc++.h>
#define L long long
#define MOD 1000000007
#define M 2005
using namespace std;

L pow_mod(L x,L k){
	L ans=1;
	while(k){
		if(k&1) ans=ans*x%MOD;
		x=x*x%MOD; k>>=1;
	}
	return ans;
}

int f[M*2][M*2]={0}; 
L a[M*M]={0},b[M*M]={0},n;
L fac[M*4]={0},invfac[M*4]={0};
L C(L n,L m){return fac[n]*invfac[m]%MOD*invfac[n-m]%MOD;}
signed main(){
	cin>>n;
	fac[0]=1; for(L i=1;i<M*4;i++) fac[i]=fac[i-1]*i%MOD;
	invfac[M*4-1]=pow_mod(fac[M*4-1],MOD-2);
	for(L i=M*4-2;~i;i--) invfac[i]=invfac[i+1]*(i+1)%MOD;
	for(L i=1;i<=n;i++){
		scanf("%lld%lld",a+i,b+i);
		f[M-a[i]][M-b[i]]++;
	}
	for(L i=1;i<M*2;i++)
	for(L j=1;j<M*2;j++)
	f[i][j]=(f[i][j]+f[i-1][j]+f[i][j-1])%MOD;
	L ans=0;
	for(L i=1;i<=n;i++)
		ans=(ans+f[a[i]+M][b[i]+M]-C((a[i]+b[i])<<1,a[i]<<1)+MOD)%MOD;
	cout<<ans*invfac[2]%MOD<<endl;
}

Measured memory_bytes: 70400
#include <iostream>
#include <vector>
#include <algorithm>

using vector = std::vector<long long int>;
using iterator = vector::iterator;

auto print_vector = [](iterator begin, iterator end){
                      while (begin != end)
                        {
                          if (begin+1 < end) std::cout << *begin << " ";
                          else std::cout << *begin << std::endl;
                          ++begin;
                        }
                    };

long long int merge(iterator begin, iterator mid, iterator end)
{
  auto itr = begin;

  vector left, right;

  for (auto tmp=begin; tmp<mid; ++tmp) left.push_back(*tmp);
  for (auto tmp=mid; tmp<end; ++tmp) right.push_back(*tmp);
  left.push_back(10000000001);
  right.push_back(10000000001);

  auto itr_left = left.begin();
  auto itr_right = right.begin();

  // std::cout << "Merging...\n";
  // print_vector(left.begin(), left.end());
  // print_vector(right.begin(), right.end());


  long long int ninv = 0;
  long long int nR = 0;
  while (itr != end)
    {
      if (*itr_left <= *itr_right)
        {
          *itr = *itr_left;
          ++itr_left;

          ninv += nR;
        }
      else
        {
          *itr = *itr_right;
          ++itr_right;

          ++nR;
        }
      ++itr;
      // std::cout << "ninv = " << ninv << std::endl;
    }
  // std::cout << "...finish\n";
  // print_vector(begin, end);

  return ninv;
}

long long int mergeSort(iterator begin, iterator end)
{
  if ((begin+1) == end)
    {
      return 0;
    }

  auto n = std::distance(begin, end);
  auto mid = begin + n/2;

  long long int ninv;
  ninv = mergeSort(begin, mid);
  ninv += mergeSort(mid, end);
  ninv += merge(begin, mid, end);

  return ninv;
}


int main ()
{
  int n;
  std::cin >> n;
  vector seq;

  for (int i=0; i<n; i++)
    {
      int tmp;
      std::cin >> tmp;
      seq.push_back(tmp);
    }

  auto ncomp = mergeSort(seq.begin(), seq.end());

  // print_vector(seq.begin(), seq.end());
  std::cout << ncomp << std::endl;
}



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

int main() {
    int m, n_min, n_max;

    while(1) {
        cin >> m >> n_min >> n_max;
        if(m + n_min + n_max == 0) break;

        vector<int> P(m);
        for(int i = 0; i < m; i++) {
            cin >> P[i];
        }

        int ans = 0;
        int gap = 0;
        for(int i = n_max; i >= n_min; i--) {
            if(gap < P[i-1] - P[i]) {
                ans = i;
                gap = P[i-1] - P[i];
            }
        }

        cout << ans << endl; 
    }

    return 0;
}


Measured memory_bytes: 3084
#include<iostream>
#include<cmath>

using namespace std;

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

  if(a < b) {
    cout << (a < c && c < b ? "Yes" : "No") << endl;
  } else {
    cout << (b < c && c < a ? "Yes" : "No") << endl;
  }
}

Measured memory_bytes: 256
n=int(input())
arr1=[]
arr2=[]
for i in range(n):
    h,m=list(map(int,input().split()))
    arr1.append(h)
    arr2.append(m)
    
l1, l2 ,l3, l4 = [], [], [], []
for i in range(len(arr1)):
    l1 += [arr1[i]+arr2[i]]
    l2 += [arr1[i]-arr2[i]]
    l3 += [-arr1[i]+arr2[i]]
    l4 += [-arr1[i]-arr2[i]]
res = []
res += [max(l1)-min(l1)]
res += [max(l2) -min(l2)]
res += [max(l3)-min(l3)]
res += [max(l4)-min(l4)]
print(max(res))

Measured memory_bytes: 142476
def main():
    N, M = map(int, input().split())
    t = N // 2
    if N % 2 == 1:
        m = N // 2
    else:
        m = -1 + (N // 2)
    l = []
    x = m
    for i in range((m//2)+1):
        l.append((i+1, x-i+1))
    for i in range(m//2):
        l.append((N-i, N-x+1+i))
    i = 0
    f = 0
    while f < M:
        if l[i][0] == l[i][1]:
            i += 1
            continue
        print(l[i][0], l[i][1])
        i += 1
        f += 1
main()


Measured memory_bytes: 81060
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned long long;
using vi = vector<int>;
using vvi = vector<vi>;
using vl = vector<ll>;
using vvl = vector<vl>;

void ABC169A()
{
	int A, B;
	cin >> A >> B;
	cout << A * B << endl;
}

int main()
{
	ABC169A();
	return 0;
}


Measured memory_bytes: 3596
#include <iostream>
using namespace std;
#define INF 10000000

int main(){
     int e;
     while(cin>>e,e){
	  int ans=INF;
	  for(int z=0;z*z*z<=e;z++){
	       for(int y=0;y*y<=e-z*z*z;y++){
		    int x=e-y*y-z*z*z;
		    ans=min(ans,x+y+z);
	       }
	  }
	  cout<<ans<<endl;
     }
     return 0;
}

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

using namespace std;
using ll = long long int;
using ullong = unsigned long long;
#define rep(i,n) for(int i = 0; i < n; i++)
#define FOR(i, a, b)  for(int i = (a); i < (b) ; i++)
#define pb push_back
#define SORT(v,n) sort(v, v+n)
#define ALL(x) (x).begin(),(x).end()
#define debug(x) cerr << #x << ": " << x << '\n'
#define int ll
int INF = 1e9;
const int MOD = (int)1e9 + 7;
const double EPS = 1e-9;
typedef pair<int, int> Vec2;
const int dx[8] = { 1, 0, -1, 0, 1, -1, -1, 1 };
const int dy[8] = { 0, 1, 0, -1, 1, 1, -1, -1 };

signed main() {
	ios::sync_with_stdio(false);
	
	int k,x;
	cin >> k >> x;
	if (k * 500 >= x) cout << "Yes" << endl;
	else
		cout << "No" << endl;

	return 0;
}


Measured memory_bytes: 256
#include<stdio.h>
int main(void){
  int n,flag=0;
  scanf("%d",&n);
  int a[n];
  for(int i=0;i<n;i++){
    scanf("%d",&a[i]);
    if(a[i]%2==0){
      if((a[i]%3!=0)&&(a[i]%5!=0)){
        flag=1;
      }
    }
  }
  if(flag==0){
    puts("APPROVED");
  }else{
    puts("DENIED");
  }

  return 0;
}


Measured memory_bytes: 128
#include <iostream>
#include <iomanip>
#include <string>
#include <vector>
#include <cmath>
#include <algorithm>
#include <limits>
#include <sstream>
#include <fstream>
#include <climits>
#include <map>
#include <numeric>
#include <functional>
#include <utility>

using namespace std;

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

struct Edge {
  int to, id;
};

vector<vector<Edge> > g;
vector<int> ans;

void dfs(int node, int p = -1, int e = -1) {
  int k = 1;
  rep(i, g[node].size()) {
    if (g[node][i].to == p) continue;
    if (k == e) k++;
    ans[g[node][i].id] = k++;
    dfs(g[node][i].to, node, k - 1);
  }
}

int main(void) {
  int n;
  cin >> n;
  g.resize(n);
  rep(i, n - 1) {
    int a, b;
    cin >> a >> b;
    --a; --b;
    g[a].push_back(Edge{ b, i });
    g[b].push_back(Edge{ a, i });
  }
  ans.resize(n - 1);

  dfs(0);

  int mx = 0;
  rep(i, n) mx = max(mx, (int)g[i].size());
  cout << mx << endl;
  rep(i, n - 1) {
    cout << ans[i] << endl;
  }
  return 0;
}


Measured memory_bytes: 8320
import math
A,B,H,M=map(int,input().split())
ak=30*H+30*(M/60)
bk=6*M
k=min(abs(ak-bk),360-abs(ak-bk))
print(math.sqrt(A**2+B**2-2*A*B*math.cos(math.radians(k))))

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

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

using namespace std;
using lint=long long;

int main(){
	string s; cin>>s;
	s=">"+s+"<";
	int n=s.length();

	vector<int> pos;
	rep(i,n-1) if(s[i]=='>' && s[i+1]=='<') pos.emplace_back(i+1);

	vector<int> a(n+1);
	for(int p:pos){
		for(int i=p-1;i>=0;i--){
			if(s[i]=='<') break;
			a[i]=max(a[i],a[i+1]+1);
		}
		for(int i=p;i<n;i++){
			if(s[i]=='>') break;
			a[i+1]=max(a[i+1],a[i]+1);
		}
	}

	lint ans=0;
	for(int i=1;i<n;i++) ans+=a[i];
	cout<<ans<<endl;

	return 0;
}


Measured memory_bytes: 3736
S = input()
size = len(S)
patterns = []
ans = 0

def flagfun(flag):
    if len(flag) == size:
        patterns.append(flag+"1")
        return
    
    flagfun(flag+'0')
    flagfun(flag+'1')

flagfun('')

for pattern in patterns:
    lastKey = 0
    for k, v in enumerate(pattern):
        if v == "1":
            if len(S[lastKey:k]) != 0:
                ans += int(S[lastKey:k])
                lastKey = k

print(int(ans/2))

Measured memory_bytes: 9152
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include<math.h>

int main()
{
	int N,i;
	int check = 0;
	int p[55];
	scanf("%d", &N);
	for (i = 1;i <= N;i++)
	{
		scanf("%d", &p[i]);
		if (i != p[i])check++;
	}
	if (check==2||check==0)printf("YES\n");
	else printf("NO\n");
	return 0;
}

Measured memory_bytes: 128
#include <stdio.h>
 
int main(void) {
    int a[100000];
    int sum;
    int max;
    int n,k;
    int i;
    while(1) {
        scanf("%d %d",&n,&k);
        if(n==0 && k==0)break;
        for(i=0;i<n;i++)scanf("%d",&a[i]);
        sum=0;
        for(i=0;i<k;i++)sum+=a[i];
        max=sum;
        for(i=0;i<n-k;i++) {
            sum-=a[i];
            sum+=a[i+k];
            if(sum>max)max=sum;
        }
        printf("%d\n",max);
    }
    return 0;
}


Measured memory_bytes: 2128
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
    ($($r:tt)*) => {
        let s = {
            use std::io::Read;
            let mut s = String::new();
            std::io::stdin().read_to_string(&mut s).unwrap();
            s
        };
        let mut iter = s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
}

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

macro_rules! read_value {
    ($iter:expr, ( $($t:tt),* )) => {
        ( $(read_value!($iter, $t)),* )
    };
    ($iter:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($iter, $t)).collect::<Vec<_>>()
    };
    ($iter:expr, chars) => {
        read_value!($iter, String).chars().collect::<Vec<char>>()
    };
    ($iter:expr, usize1) => {
        read_value!($iter, usize) - 1
    };
    ($iter:expr, $t:ty) => {
        $iter.next().unwrap().parse::<$t>().expect("Parse error")
    };
}

fn main() {
    input! {
        x: u32,
        a: u32
    }
    if x < a {
        println!("{}", 0);
    } else {
        println!("{}", 10);
    }
}


Measured memory_bytes: 4352
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i,a,b) for(ll i=a;i<b;i++)
#define per(i,a,b) for(ll i=b-1;i>=a;i--)
const ll maxn=1e5+5, mod=1e9+7;
ll n,k,ans[maxn],sol;
ll binpow(ll b, ll e) {
    ll ans=1;
    for(b%=mod;e;b=b*b%mod,e/=2) if(e&1) ans=ans*b%mod;
    return ans;
}
int main() {
    cin.tie(0);
    ios_base::sync_with_stdio(0);
    cin>>n>>k;
    rep(i,1,k+1) ans[i]=binpow(k/i,n);
    per(i,1,k+1)
        for(ll j=2*i;j<k+1;j+=i)
            ans[i]=(ans[i]-ans[j]+mod)%mod;
    rep(i,1,k+1) sol=(sol+ans[i]*i)%mod;
    cout<<sol<<"\n";
}


Measured memory_bytes: 4388
#include <iostream>
#include <bits/stdc++.h>
using namespace std;
#define int         long long   
#define double      long double
#define endl        "\n"
#define pb          push_back
#define PI          3.1415926535897932384626433832795l
#define F           first
#define S           second
#define mp          make_pair
#define f(i,n)      for(int i=0;i<n;i++)
#define fastio      ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define all(v)      (v).begin(),(v).end()
#define sort(v)     sort((v).begin(),(v).end())
#define rall(v)     (v).rbegin(),(v).rend()
#define rsort(v)     sort((v).rbegin(),(v).rend())
#define gcd(a,b)    __gcd((a),(b))
#define minn(v)     *min_element(v.begin(), v.end());
#define maxx(v)     *max_element(v.begin(), v.end());
#define print(x)    cout<<(x)<<endl;
typedef pair<int,int> pii;  
typedef vector<int> vi;
//x.substr(start, length);
/*
// Create a vector containing n 
//vectors of size m.  
    vector<vector<int> > vec( n , vector<int> (m, 0));  
*/
struct type{
    int k, i, j;
};
//to check if a no is prime or not?
bool isPrime(int n) 
{ 
    if (n <= 1) 
        return false; 
    if (n <= 3) 
        return true; 
    if (n % 2 == 0 || n % 3 == 0) 
        return false; 
  
    for (int i = 5; i * i <= n; i = i + 6) 
        if (n % i == 0 || n % (i + 2) == 0) 
            return false; 
  
    return true; 
}

// minimum subaaray sum of size k-sliding window approach
int findSubarray(int arr[], int n, int k)
{
	int window_sum = 0;
	int min_window = INT_MAX;
	int last = 0;
	for (int i = 0; i < n; i++)
	{
		window_sum += arr[i];
		if (i + 1 >= k)
		{
			if (min_window > window_sum)
			{
				min_window = window_sum;
				last = i;
			}
			window_sum -= arr[i + 1 - k];
		}
	}
	int sum=0;
	for(int i=last-k+1;i<=last;i++)
	{
	    sum+=arr[i];
	}
	return sum;
}
//finds the next permutation to given sequence of nos
int nextpermutation(vi v)
{
    vi t=v;
    sort(t);
    int x=0;
    while(true)
    {
        x++;
        if(t==v)
        {
            return x;
        }
        next_permutation(all(t));
    }
}
signed main() 
{
    fastio;
    //cout << fixed << setprecision(0);
    int n,m;
    cin>>n>>m;
    vi a(n);
    set<int> s;
    f(i,n)
    {
        cin>>a[i];
    }
    int lcm=2;
    for(int i=0;i<n;i++)
    {
        int cur=0;
        int x=a[i];
        while(x%2==0)
        {
            x/=2;
            cur++;
        }
        s.insert(cur);
        lcm=(lcm*a[i])/(gcd(a[i],lcm));
        if(lcm>2*m)
        {
            cout<<0;
            return 0;
        }
    }
    if(s.size()==1)cout<<(2*m/lcm+1)/2<<endl;
    else cout<<0<<endl;
    
}


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

void solve(long long N, std::vector<long long> a, std::vector<long long> b, std::vector<long long> c)
{

    vector<vec> dp(3, vec(N + 1));
    dp[0][0] = dp[1][0] = dp[2][0] = 0;

    for (ll i = 1; i <= N; i++)
    {
        dp[0][i] = max(dp[0][i], a[i - 1] + max(dp[1][i - 1], dp[2][i - 1]));
        dp[1][i] = max(dp[1][i], b[i - 1] + max(dp[0][i - 1], dp[2][i - 1]));
        dp[2][i] = max(dp[2][i], c[i - 1] + max(dp[1][i - 1], dp[0][i - 1]));
    }
    ll ans = max(dp[0][N], dp[1][N]);
    ans = max(ans, dp[2][N]);
    cout << ans << endl;
}

signed main()
{
    long long N;
    scanf("%lld", &N);
    std::vector<long long> a(N);
    std::vector<long long> b(N);
    std::vector<long long> c(N);
    for (int i = 0; i < N; i++)
    {
        scanf("%lld", &a[i]);
        scanf("%lld", &b[i]);
        scanf("%lld", &c[i]);
    }
    solve(N, std::move(a), std::move(b), std::move(c));
    return 0;
}


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

	public static void main(String[] args) {
		
		Scanner sc = new Scanner(System.in);
		
		int x = sc.nextInt();
		int t = sc.nextInt();
		
		if(x <= t ) {
			System.out.println(0);
			
		}
		if(x > t) {
			System.out.println(x - t);
		}
		

	}

}


Measured memory_bytes: 23508
#ifdef _DEBUG
#include ".vscode/debug_print.hpp"
#else
#define debug(...)
#endif
#include <bits/stdc++.h>

using ll = long long;
using ld = long double;
using namespace std;
constexpr int INF32       = 1050000000;
constexpr long long INF64 = 4000000000000000000;
constexpr int MOD7        = 1000000007;
constexpr int MOD53       = 998244353;
constexpr long double PI  = 3.14159265358979323846;
template <class T> inline bool chmin(T &a, T b) {
    if (a > b) {
        a = b;
        return true;
    }
    return false;
}
template <class T> inline bool chmax(T &a, T b) {
    if (a < b) {
        a = b;
        return true;
    }
    return false;
}
void print() { std::cout << '\n'; }
template <class H, class... T> void print(H &&head, T &&... args) {
    std::cout << head;
    sizeof...(args) == 0 ? std::cout << "" : std::cout << ' ';
    print(std::forward<T>(args)...);
}
template <class T> void print(std::vector<T> &v) {
    for (int i = 0; i < v.size(); i++) {
        std::cout << v[i];
        i == v.size() - 1 ? std::cout << '\n' : std::cout << ' ';
    }
}
template <class T> void print(std::vector<std::vector<T>> &v) {
    for (int i = 0; i < v.size(); i++) {
        for (int j = 0; j < v[i].size(); j++) {
            std::cout << v[i][j];
            j == v[i].size() - 1 ? std::cout << '\n' : std::cout << ' ';
        }
    }
}
void scan() {}
template <class H, class... T> void scan(H &&head, T &&... args) {
    std::cin >> head;
    scan(std::forward<T>(args)...);
}
template <class T> void scan(std::vector<T> &v) {
    for (auto &&i : v) {
        scan(i);
    }
}

void vprint() { std::cout << '\n'; }
template <class H, class... T> void vprint(H &&head, T &&... args) {
    std::cout << head;
    sizeof...(args) == 0 ? std::cout << "" : std::cout << '\n';
    vprint(std::forward<T>(args)...);
}
template <class T> void vprint(std::vector<T> &v) {
    for (auto &&i : v) {
        std::cout << i << '\n';
    }
}

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

    vector<int> v(5);
    scan(v);
    for (size_t i = 0; i < 5; i++) {
        if (v[i] == 0) {
            print(i + 1);
        }
    }

    return 0;
}

Measured memory_bytes: 3572
#include<bits/stdc++.h>
typedef long long int ll;
typedef unsigned long long int ull;
#define BIG_NUM 2000000000
#define HUGE_NUM 1000000000000000000
#define MOD 1000000007
#define EPS 0.000000001
using namespace std;


map<string,int> MAP;

int main(){

	int num_query;
	scanf("%d",&num_query);

	int command,x;

	for(int loop = 0; loop < num_query; loop++){

		scanf("%d",&command);

		string tmp_str;
		string L,R;

		if(command == 0){

			cin >> tmp_str >> x;
			MAP[tmp_str] = x;

		}else if(command == 1){

			cin >> tmp_str;
			auto at = MAP.find(tmp_str);

			if(at == MAP.end()){

				printf("0\n");
			}else{

				printf("%d\n",MAP[tmp_str]);
			}

		}else if(command == 2){

			cin >> tmp_str;
			MAP.erase(tmp_str);

		}else{

			cin >> L >> R;

			auto at = MAP.lower_bound(L);
			auto right = MAP.upper_bound(R);

			while(at != right){

				printf("%s %d\n",at->first.c_str(),at->second);
				at++;
			}
		}
	}

	return 0;
}



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

int main() {
  int n;cin>>n;
  vector<int> a(n);
  vector<int> b(n);
  for(int i=0;i<n;i++) {
    cin>>a.at(i);
  }
  for(int i=0;i<n;i++) {
    cin>>b.at(i);
  }
  vector<int> sa(n);
  vector<int> sb(n);
  for(int i=0;i<n;i++) {
    if(i==0) {
      sa.at(i)=a.at(i);
    }
    else {
      sa.at(i)=sa.at(i-1) + a.at(i);
    }
  }
  for(int i=0;i<n;i++) {
    if(i==0) {
      sb.at(n-1-i)=b.at(n-1-i);
    }
    else {
      sb.at(n-1-i)=sb.at(n-i) + b.at(n-1-i);
    }
  }
  int ans=0;
  for(int i=0;i<n;i++) {
    ans=max(ans,sa.at(i)+sb.at(i));
  }
  cout << ans << endl;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main()
{
    int n,t,r=0,x=INT_MAX;
    cin>>n>>t;
    for(int i=0; i<n; i++)
    {
        int a,b;
        cin>>a>>b;
        if(b <= t && x>=a)
        {

            r = a;
            x = a;
        }
    }
    if(r)
        cout<<r<<endl;
    else
        cout<<"TLE"<<endl;

    return 0;
}


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

public class Main {

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

		int n = sc.nextInt();
		int a[] = new int[n];
		for (int i = 0; i < n; i++) {
			a[i] = sc.nextInt();
		}
		sc.close();

		int alice = 0;
		int bob = 0;

//		System.out.println(Arrays.toString(a));
		Arrays.sort(a);
//		System.out.println(Arrays.toString(a));
		for (int i = 0; i < n; i++) {
			if (i % 2 == 0) {
				alice += a[i];
			}
			if (i % 2 == 1) {
				bob += a[i];
			}
		}
		if (alice >= bob) {
			System.out.println(alice - bob);
		} else {
			System.out.println(bob - alice);
		}
	}

}


Measured memory_bytes: 21844
#include <bits/stdc++.h>
#define mem(dp,a) memset(dp,a,sizeof(dp))
#define pb(x) push_back(x)
#define m_p(x,y) make_pair(x,y)
#define rep(i,a,b) for(ll i=a;i<b;i++)
#define repush_back(i,a,b) for(ll i=a;i>=b;i--)
#define f(n) for(ll i=0;i<n;i++)
#define r(n) for(ll j=0;j<n;j++)
#define F first
#define S second
#define pi 3.14159265359
#define hs ios_base::sync_with_stdio(false);cin.tie(NULL);
using namespace std;
typedef long long int ll;
ll HRX=1e18;
ll INF=1e9+7;


int main()
{
 hs;
 ll n;
 cin>>n;
 ll a[n];
 vector<ll>ans;
 f(n)
 {
    cin>>a[i];
    ans.pb(a[i]);
 }
 ll cnt=0;
 sort(ans.begin(),ans.end());
 f(n)
 {
  if(a[i]!=ans[i])
    cnt++;
 }
 if(cnt<=2)
    cout<<"YES"<<endl;
 else
    cout<<"NO"<<endl;
 ans.clear();
 return 0;
}


Measured memory_bytes: 256
#include <stdio.h>
#include <string>
#include <cstring>
#include <stdlib.h>
#include <math.h>
#include <algorithm>
#include <vector>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <list>
#include <iterator>
#include <assert.h>
#pragma warning(disable:4996) 

typedef long long ll;
#define MIN(a, b) ((a)>(b)? (b): (a))
#define MAX(a, b) ((a)<(b)? (b): (a))
#define LINF 9223300000000000000
#define INF 2140000000
const long long MOD = 1000000007;
//const long long MOD = 998244353;

using namespace std;

ll d[300][300];

void solve()
{
	int n;
	scanf("%d", &n);
	vector<pair<int, pair<int, int> > > z;
	int i, j;
	for (i = 0; i < n; i++) {
		for (j = 0; j < n; j++) {
			scanf("%d", &d[i][j]);
			if(i<j) z.push_back(make_pair(d[i][j], make_pair(i, j)));
		}
	}
	sort(z.begin(), z.end());

	ll sum = 0;
	for (i = 0; i < (int)z.size(); i++) {
		int dist=z[i].first;
		int p = z[i].second.first;
		int q = z[i].second.second;
		ll min = LINF;
		for (j = 0; j < n; j++) {
			if (j == p || j == q) continue;
			if (d[p][j] + d[j][q] < dist) {
				printf("-1\n"); return;
			}
			min = MIN(min, d[p][j] + d[j][q]);
		}
		if (min > dist) {
			sum += dist;
		}
	}
	printf("%lld", sum);
	return;
}


int main(int argc, char* argv[])
{
#if 1
	solve();
#else
	int T; scanf("%d", &T);
	while (T--) {
		solve();
	}
#endif
	return 0;
}


Measured memory_bytes: 1532
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll mod=1000000007;
#define rep(i,n) for(int i=0;i<n;i++)
#define Rep(i,a,b) for(int i=a;i<b+1;i++)
#define Per(i,b,a) for(int i=b;i>=a;i--)

ll binary_method(ll a,ll b){
    if(b==0) return (ll)1;
    ll temp = binary_method(a,b>>1);
    if(b%2) return (((temp*temp)%mod)*a)%mod;
    else return (temp*temp)%mod;
}
ll inv(ll a){
    return binary_method(a,mod-2);
}

ll solve(ll *fact,ll *inv_fact, ll k, ll n){
    return (fact[n-1]*inv_fact[k]%mod)*inv_fact[n-1-k]%mod;
}

int main(){
    ll n,k;
    cin>>n>>k;
    ll fact[200001];
    ll inv_fact[200001];
    fact[0]=1;
    Rep(i,1,n) fact[i] = (fact[i-1]*i)%mod;
    rep(i,n+1) inv_fact[i] = inv(fact[i]);
    ll max_num = min(n-1,k);
    ll ans = 0;
    for(ll i=0;i<=max_num;i++){
        ans += ((solve(fact,inv_fact,i,n)*fact[n]%mod) *inv_fact[i]%mod) * inv_fact[n-i]%mod;
        ans %= mod;
    }
    cout<<ans<<endl;

    return 0;


}

Measured memory_bytes: 3328
#include <bits/stdc++.h>
#include<cstdio>
#include<cstdlib>
#include<string>
#include<iostream>
using namespace std;
#define MAX 1000000
typedef long long ll;

int  main(){
  ll A,B,C;
  cin>>A>>B>>C;
  cout<<B+min(C,A+B+1)<<endl;
}


Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <map>
#include <unordered_map>
#include <queue>
#include <set>
#include <algorithm>
#include <string>
#include <math.h>
#include <limits.h>
#include <stack>
#include <complex>
#include <stdlib.h>
#include <stdio.h>
#include <functional>
#include <cfloat>
#include <math.h>
#include <numeric>
#include <string.h>
#include <sys/time.h>
#include <random>


#define fs first
#define sc second

using namespace std;

typedef long long ll;
typedef pair<ll, ll> P;

int main(){
    string s;   cin >> s;
    int res = 0;
    for(int i = 0; i < s.length() / 2; i++){
        if(s[i] != s[s.length()-i-1]){
            res++;
        }
    }

    cout << res << endl;


    return 0;
}




Measured memory_bytes: 256
#include <algorithm>
#include <iostream>
#include <map>
#include <numeric>
#include <set>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <vector>
#include <queue>
#define MOD (1000000007l)
#define rep(i, n) for(long i = 0; i < n; i++)

using namespace std;

void solve() {
  long N;
  cin >> N;
  vector<long> a(N);
  rep (i, N) cin >> a[i];

  long current = -1;
  long result = 0;

  rep (i, N) {
    if (a[i] == current) {
      result++;
      current = -1;
    } else current = a[i];
  }

  cout << result << endl;
}

int main(void) {
  cin.tie(0);
  ios::sync_with_stdio(false);
  cout.precision(12);
  solve();
  return 0;
}


Measured memory_bytes: 256