akhauriyash/Code-Regression huggingface dataset:
# -*- coding: utf-8 -*-
S = str(input())
box = ["A", "G", "C", "T"]
s = str()
ACGTbox = str()
for i in range(0, len(S)):
    for j in range(i, len(S)):
        if S[j] in box:
            s += S[j]
        else:
            break
    if len(s) > len(ACGTbox):
        
        ACGTbox = s 
    s = str()
print(len(ACGTbox))

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

int main() {
  ll a;
  cin>>a;
  ll b=0;
  double c=0;
  for(ll i=0;i<a;i++){
    double d;
    string e;
    cin>>d>>e;
    if(e=="JPY"){
      b+=d;
    }
    else{
      c+=d;
    }
  }
  cout<<fixed<<setprecision(8);
  cout<<c*380000+b<<endl;
  
      
    
  
  return 0;
}
                             
    


Measured memory_bytes: 3748
import java.util.*;
class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int D = sc.nextInt();
        int G = sc.nextInt();
        int min = Integer.MAX_VALUE;
        int[] p = new int[D];
        int[] c = new int[D];

        for(int i = 0; i<D; i++) {
            p[i] =sc.nextInt();
            c[i] =sc.nextInt();
        }

        for(int i = 0; i<Math.pow(2,D); i++) {
            int maxIndex = 0;
            int num = i;
            int cnt = 0;
            int val = 0;
            int tmp = 0;
            while(cnt<D) {
                if(num % 2 == 1) {
                    val = val + p[cnt]*(cnt+1)*100+c[cnt];
                    tmp += p[cnt];
                }else {
                    maxIndex++;
                }
                num /= 2;
                cnt++;
            }
            maxIndex--;
            //System.out.println(i+ " " + val + " " +tmp+ " maxIndex " + maxIndex);
            if(val<G) {
                for(int j = 0; j<p[maxIndex]-1; j++) {
                    val += (maxIndex+1)*100;
                    tmp++;
                    //if(i==24) System.out.println(val+" " + tmp);
                    if(val>=G) break;
                }

            }

            if(val<G) continue;
            //System.out.println(i+ " " + val +" " +tmp +" " + min);
            min = Math.min(tmp, min);
        }

        System.out.println(min);
    }
}

Measured memory_bytes: 23508
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String s = sc.next();
        if(Character.isLowerCase(s.charAt(0))){
            System.out.println("a");
        }else{
            System.out.println("A");
        }
    }
}


Measured memory_bytes: 35684
#include<iostream>
#include<algorithm>
#include<vector>
#include<cstdint>
#include<cstdlib>
template<typename T>
void fin(T const& t){ std::cout << t << std::endl; exit(0); }

int main() {
  std::cin.tie(0); std::ios::sync_with_stdio(false);
  int N; std::cin >> N;
  std::vector<int> A(N), B(N);
  for(int i = 0; i < N; ++i) std::cin >> A[i] >> B[i];
  if(N%2 == 1) {
    std::nth_element(A.begin(), A.begin()+N/2, A.end());
    std::nth_element(B.begin(), B.begin()+N/2, B.end());
    int gap = B[N/2] - A[N/2];
    fin(gap+1);
  }
  std::nth_element(A.begin(), A.begin()+N/2, A.end());
  std::nth_element(B.begin(), B.begin()+N/2, B.end());
  int gap = B[N/2] - A[N/2];
  std::nth_element(A.begin(), A.begin()+N/2-1, A.end());
  std::nth_element(B.begin(), B.begin()+N/2-1, B.end());
  gap += B[N/2-1] - A[N/2-1];
  fin(gap+1);
  return 0;
}


Measured memory_bytes: 5228
#include <stdio.h>

#define W -3
#define G -2
#define B -1
#define MAX 101

void dfs(void);
void visit(int);

int n;/*頂点数*/
int T[MAX][MAX];/*行＝要素、列＝繋ってる要素*/
int color[MAX];/*色分け用配列*/
int d[MAX];/*要素を最初に発見した発見時刻を記録する用配列*/
int f[MAX];/*要素の隣接リストを調べ終えた完了時刻を記録する用配列*/
int time;

int main()
{
  int i,j,youso,kazu,v;

  scanf("%d",&n);

  for(i=1;i<=n;i++)
    {
      scanf("%d%d",&youso,&kazu);

      for(j=0;j<kazu;j++)
	{
	  scanf("%d",&v);

	  T[i][v]=1;
	}
    }

  dfs();

  for(i=1;i<=n;i++)
    {
      printf("%d %d %d\n",i,d[i],f[i]);
    }
  return 0;
  
}

void dfs(void)
{
  int i;
  for(i=1;i<=n;i++)
    {
      color[i]=W;
    }
  for(i=1;i<=n;i++)
    {
      if(color[i]==W)visit(i);
    }
}
void visit(int u)
{
  int i;
  color[u]=G;
  d[u]=++time;
  for(i=1;i<=n;i++)
    {
      if(T[u][i]==1)
	{
	  if(color[i]==W)
	    {
	      visit(i);
	    }
	}
    }
  color[u]=B;
  
  f[u]=++time;
}
  



Measured memory_bytes: 2052
#include <iostream>

using namespace std;

int main() {
   int n,a,b,i;
   cin>>n>>a>>b;
   for(i=a;i<=b;i++)
   {
       if(i%n==0){ cout<<"OK\n";break;}
   }
   if(i==b+1) cout<<"NG\n";
}

Measured memory_bytes: 3632
#include<bits/stdc++.h>
#define fo(i, x, y) for(int i = x, _b = y; i <= _b; i ++)
#define ff(i, x, y) for(int i = x, _b = y; i <  _b; i ++)
#define fd(i, x, y) for(int i = x, _b = y; i >= _b; i --)
#define ll long long
#define pp printf
#define hh pp("\n")
using namespace std;

#define gc getchar

int get() {
	char c = ' ';
	while(c != '0' && c != '1') c = gc();
	return c - '0';
}

const int N = 2e6 + 5;

int n, m, k;
int a[N], b[N];

struct P {
	int x, y;
	P(int _x = 0, int _y = 0) {
		x = _x, y = _y;
	}
};

P z[N]; int z0;

void dg(int w, int k) {
	//pp("%d %d %d %d\n", w, k, z0, z[z0].x);
	if(z0 == 0 || z[z0].x - w > k) {
		z[++ z0] = P(w + k, 3);
		return;
	}
	int l = z0;
	int nk = k - (z[z0].x - w);
	while(l > 1 && z[l - 1].x == z[l].x + 1 && z[l - 1].y == z[l].y) l --;
	P x1 = z[l]; x1.x ++;
	P x2 = z[z0]; x2.y ^= 3;
	if(l > 1 && z[l - 1].x == z[l].x + 1) {
		z0 = l - 2;
		dg(z[l].x + 1, nk);
		z[++ z0] = x2;
	} else {
		z0 = l - 1;
		z[++ z0] = x1;
		z[++ z0] = x2;
	}
}

int main() {
	scanf("%d %d %d", &n, &m, &k);
	fd(i, n, 1) a[i] = get(); 
	fd(i, m, 1) b[i] = get();
	fd(i, max(n, m), 1) {
		if(a[i] + b[i] == 1) {
			z[++ z0] = P(i, a[i] + b[i] * 2);
		} else
		if(a[i] + b[i] == 2) {
			dg(i, k);
		}
	}
	memset(a, 0, sizeof a);
	memset(b, 0, sizeof b);
	fo(i, 1, z0) a[z[i].x] = z[i].y & 1, b[z[i].x] = (z[i].y & 2) >> 1;
	int m1 = 0, m2 = 0;
	fo(i, 1, max(n, m) + k) {
		if(a[i]) m1 = i;
		if(b[i]) m2 = i;
	}
	fd(i, m1, 1) pp("%d", a[i]); hh;
	fd(i, m2, 1) pp("%d", b[i]); hh;
}


Measured memory_bytes: 35456
#include<iostream>
#include<algorithm>
#include<string>
#include<vector>
#include<queue>
#include<map>
#include<math.h>
#include<numeric>
#include<utility>
#include<unordered_map> //hash map

#define rep(i,a,n) for(int (i)=(a);(i)<(n);(i)++)
#define rrep(i,a,n) for(int (i)=(a);(i)>=(n);(i)--)

#define INF 1000000000
#define MOD 1000000007

typedef  long long ll;

using namespace std;

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

double euclid_distance(double a,double b){
    return sqrt(a*a+b*b);
}

ll gcd(ll  a,ll b){
    ll r;
    if(a < b){
        ll tmp;
        tmp = a;
        a = b;
        b = tmp;
    }
    while(r = a % b){
        a = b;
        b = r;
    }
    return b;
}
/*
ll Integer_factorization(ll n){
    ll num = 0;
    ll ndash = n;
    if(n == 1) return 1;
    ll a = 2;
    while(ndash >= a*a){
        if(n % a  == 0){
            count++;
            n/=a;

        if(count % b == 0){
            ans *= a;
        }
        }else{a++;count = 0;}
    }

    return num;
}
*/

ll r_fuct[2000];
ll fuct[2000];

//MOD逆元
void conb(ll n,ll k){
    fuct[0] = 1;
    for(int i = 1;i < k+1;i++){
        fuct[i] *= fuct[i-1]%MOD;
        
        ll b = MOD, u = 1, v = 0;
        ll value = fuct[i];
        while (b) {
            ll t = value / b;
            value -= t * b;
            swap(value, b);
            u -= t * v;
            swap(u, v);
        }
        u %= MOD;
        if (u < 0) u += MOD;
        r_fuct[i] = u;
    }
}

ll factrial(ll n){
    if(n == 0) return 1;
    ll p = factrial(n-1)*n%MOD;
    return p;
}

//MOD逆元
ll farmat(ll n,ll p){    
    if(p == 0) return 1;
    else if(p == 1) return n%MOD;
    ll d = farmat(n,p/2);
    if(p%2 == 0){
        return (d*d)%MOD;
    }else{
        return ((n*d)%MOD*d)%MOD;
    }
}

ll conbination(ll n,ll k){
    ll a = factrial(n);
    ll b = factrial(k);
    ll c = factrial(n-k);
    return (a*farmat(b,MOD-2)%MOD*farmat(c,MOD-2))%MOD;
}

int memo[10000000];

int fib(int i){
    if(i <= 1) return i;
    if(memo[i] != 0) return memo[i];
    return memo[i] = fib(i-1)+fib(i-2);
}

ll dig(ll n){
    ll d = 0;
    while(n != 0){
        n/=10;
        d++;
    }
    return d;
}

void solve() {
    int n,m,c;
    cin >> n >> m >> c;
    int b[m];
    for(int i = 0;i < m;i++) cin >> b[i];
    int a[n][m];
    for(int i = 0;i < n;i++){
        for(int j = 0;j < m;j++){
            cin >> a[i][j];
        }
    }
    int count = 0;
    for(int i = 0;i < n;i++){
        
        int tmp = 0;
        for(int j = 0;j < m;j++){
            tmp += a[i][j]*b[j];
        }
        if(tmp+c > 0) count++;
    }
    cout << count << endl;
}




int main() {

	cin.tie(0);
	ios::sync_with_stdio(false);
	solve();
	return 0;
}



Measured memory_bytes: 256
/*
        _            _                  _            _       _     _         _   _          _          _             _        
       / /\         / /\               / /\         / /\    / /\  /\ \      /\_\/\_\ _     /\ \       /\ \     _    /\ \      
      / /  \       / /  \             / /  \       / / /   / / /  \ \ \    / / / / //\_\   \ \ \     /  \ \   /\_\ /  \ \     
     / / /\ \__   / / /\ \           / / /\ \__   / /_/   / / /   /\ \_\  /\ \/ \ \/ / /   /\ \_\   / /\ \ \_/ / // /\ \_\    
    / / /\ \___\ / / /\ \ \         / / /\ \___\ / /\ \__/ / /   / /\/_/ /  \____\__/ /   / /\/_/  / / /\ \___/ // / /\/_/    
    \ \ \ \/___// / /  \ \ \        \ \ \ \/___// /\ \___\/ /   / / /   / /\/________/   / / /    / / /  \/____// / / ______  
     \ \ \     / / /___/ /\ \        \ \ \     / / /\/___/ /   / / /   / / /\/_// / /   / / /    / / /    / / // / / /\_____\ 
 _    \ \ \   / / /_____/ /\ \   _    \ \ \   / / /   / / /   / / /   / / /    / / /   / / /    / / /    / / // / /  \/____ / 
/_/\__/ / /  / /_________/\ \ \ /_/\__/ / /  / / /   / / /___/ / /__ / / /    / / /___/ / /__  / / /    / / // / /_____/ / /  
\ \/___/ /  / / /_       __\ \_\\ \/___/ /  / / /   / / //\__\/_/___\\/_/    / / //\__\/_/___\/ / /    / / // / /______\/ /   
 \_____\/   \_\___\     /____/_/ \_____\/   \/_/    \/_/ \/_________/        \/_/ \/_________/\/_/     \/_/ \/___________/    
                                                                                                                              
*/
#include<bits/stdc++.h>
using namespace std;
#define ALL(obj) (obj).begin(), (obj).end()
#define REP(i, n) for(int i = 0;i < (n);++i)

#define endl '\n'
#define pb emplace_back
#define mkp make_pair
#define p_q priority_queue
#define INF 2000000000
#define PI 3.1415926

const int dx[]={1,0,-1,0}, dy[]={0,-1,0,1};
const int dx_8[]={1,1,0,-1,-1,-1,0,1}, dy_8[]={0,-1,-1,-1,0,1,1,1};
const long long MOD = 1e9+7;

// typedef long long ll;
#define int long long

template <typename T> inline T GCD(T a,T b){T c;while(b!=0){c=a%b;a=b;b=c;}return a;}
template <typename T> inline T LCM(T a,T b){T c=GCD(a,b);a/=c;return a*b;}
template <typename T> inline T nCr(T a,T b){T i,r=1;for(i=1;i<=b;i++){r*=(a+1-i);r/=i;}return r;}
template <typename T> inline T nHr(T a,T b){return nCr(a+b-1,b);}

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

  string s; cin >> s;
  int g = 0, p = 0, ans = 0;
  REP(i, s.size()){
    if(s[i] == 'g'){
      if(p+1 <= g){
        ans++; p++;
      } else g++;
    } else {
      if(p+1 <= g) p++;
      else{
        ans--; g++;
      }
    }
  }
  cout << ans << endl;

  return 0;
}

Measured memory_bytes: 512
def solve():
    a = [0]
    b = [0]
    for i in range(n):
        a.append(a[i]+deska[i])
    for j in range(m):
        b.append(b[j]+deskb[j])
    ans, j = 0, m
    for i in range(n+1):
        if a[i] > k:
            break
        while b[j] > k-a[i]:
            j -= 1
        ans = max(ans, i+j)
    return ans

if __name__ == '__main__':
    n, m, k = map(int, input().split())
    deska = list(map(int, input().split()))
    deskb = list(map(int, input().split()))
    print(solve())

Measured memory_bytes: 47612
#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;
template <typename T>
using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
#define int long long
#define ar array
#define db double
#define pow pw
const db pi = 3.14159265358979323846;
int pw(int a,int b){
    int ans=1;
    while(b){
    if (b%2) ans*=a;
    a*=a;
    b/=2;
    }
    return(ans);
}
const int mxn=1e3+7,INF=1e9+7;
int m,n,sx,sy,gx,gy,ans;
char a[mxn][mxn];
int dr[]={-1,0,1,0};
int dc[]={0,-1,0,1};
int vis[mxn][mxn];
//int vs[mxn][mxn];
vector<vector<int> > dis;
bool check(int u,int v)
{
    return(u>0&&u<=m&&v>0&&v<=n&&a[u][v]=='.');
}
void bfs(int U,int V)
{
    deque<ar<int,2> > q;
    q.push_front({U,V});
    dis[U][V]=0;
   // vs[U][V]=1;
    while(q.size())
    {
        int u=q.front()[0],v=q.front()[1];
        q.pop_front();
        if (vis[u][v]) continue;
        vis[u][v]=1;
        for (int i=0;i<4;i++)
        {
            int nu=u+dr[i];
            int nv=v+dc[i];
            if (check(nu,nv)&&!vis[nu][nv])
            {
                q.push_front({nu,nv});
                dis[nu][nv]=dis[u][v];
              // vs[nu][nv]=1;
            }
        }
        for (int i=u-2;i<=u+2;i++)
        {
            for (int j=v-2;j<=v+2;j++)
            {
                if (check(i,j)) 
                {
                    if (dis[i][j]>dis[u][v]+1)
                    {
                    dis[i][j]=dis[u][v]+1;
                    q.push_back({i,j});
                    }
                }
            }
        }
    }
}
signed main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    cin>>m>>n>>sx>>sy>>gx>>gy;
    for (int i=1;i<=m;i++)
    for (int j=1;j<=n;j++) cin>>a[i][j];
    dis.assign(m+1,vector<int>(n+1,INF));
    bfs(sx,sy);
    if (dis[gx][gy]!=INF) cout<<dis[gx][gy];
    else cout<<-1;
    return 0;
}

Measured memory_bytes: 20540
#include <iostream>
#include <vector>
#include <bitset>
#include <utility>
#include <string>
#include <queue>
#include <stack>
#include <algorithm>
#include <cmath>
#include <map>
#include <set>

using namespace std;
typedef long long ll;

int main(){

  int N;
  cin >> N;

  vector<int> a(N+1,0);
  
  for(int i=1;i<N+1;i++) cin >> a[i];

  int M=0;
  
  for(int i=N;0<i;i--){
    for(int j=2;i*j<N+1;j++){
      a[i]+=a[i*j];
    }
    a[i]%=2;
    M+=a[i];
  }

  cout << M << endl;
  for(int i=1;i<N+1;i++){
    if(a[i]==1) cout << i << " ";
  }
  cout << endl;

  
  return 0;

}


Measured memory_bytes: 1792
#include <bits/stdc++.h>
using namespace std;
long n,ans=1,mod=1000000007;
long modpow(long modpow_x,long modpow_y) {
  long modpow_return=1;
  for(long i=1;i<=modpow_y;i*=2) {
    if(modpow_y/i%2==1) modpow_return=modpow_return*modpow_x%mod;
    modpow_x=modpow_x*modpow_x%mod;
  }
  return modpow_return;
}
int main() {
  cin >> n;
  map<long,long> a;
  for(long i=2;i<=n;i++) {
    long aaa=i;
    for(long j=2;j<=1200;j++) {
      while(aaa%j==0) {
        a[j]++;
        aaa/=j;
      }
    }
  }
  for(auto itr=a.begin();itr!=a.end();itr++) {
    ans=(ans*(((*itr).second)+1))%mod;
  }
  cout << ans << endl;
}

Measured memory_bytes: 3668
#include <iostream>
using namespace std;
int main(void){
    // Your code here!
    int a,b,c;
    int count5=0, count7=0;
    while(cin>>a){
        if(a==5)
        count5++;
        if(a==7)
        count7++;
    }
    
    if(count5==2 && count7==1)
        cout<<"YES";
    else
        cout<<"NO";
}


Measured memory_bytes: 3104
n = int(input())
a_s = list(map(int, input().split()))
count_a = [0] * (n+1)

for a in a_s:
  count_a[a] += 1

choices = sum(map(lambda x: x*(x-1)//2, count_a))

for a in a_s:
  print(choices - (count_a[a]-1))

Measured memory_bytes: 26140
import java.util.Scanner;

class Main{
	public static void main(String args[]){
		int x, a, b, c;
		int n = 1;
		c = 1;
		Scanner sc = new Scanner(System.in);
		x = sc.nextInt();
		if(x == 1){
			System.out.print(1);
			return;
		}
		for(int i = 2; i <= 32; i++){
			b = i;
          	c = i;
			while(c * b <= x){
              c *= b;
			  if(n <= c){
				  n = c;
			  }
			}
		}
		System.out.print(n);
	}
}


Measured memory_bytes: 23764
#include<bits/stdc++.h>
#define ll long long
#define debug(a) cout<<a<<endl
#define pii pair<int,int>
#define maxn 100009
using namespace std;
int main(){
    ios::sync_with_stdio(false);
    int n,k;
    cin>>n>>k;
    string s;
    cin>>s;
    s[k-1]+=32;
    cout<<s<<endl;
    return 0;
}
///usar double sempre ou long double
///pensar em casos que coisas dao negativas
///N esquecer de limpar as coisas em quest de varios testes
///OLHAR A COMPLEXIDADE PRA VER SE N PASSA POR BRUTE FORCE OU BRUTE FORCE COM ALGUMAS OTIMIZACOES

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

int main() {
	int n;
	cin >> n;
	int t[4] = {};
	for (int i = 0; i < n; i++) {
		string s;
		cin >> s;
		if (s[0] == 'A') t[0]++;
		else if (s[0] == 'W') t[1]++;
		else if (s[0] == 'T') t[2]++;
		else if (s[0] == 'R') t[3]++;
	}
	cout << "AC x "  << t[0] << endl;
	cout << "WA x "  << t[1] << endl;
	cout << "TLE x "  << t[2] << endl;
	cout << "RE x "  << t[3] << endl;
	return 0;
}

Measured memory_bytes: 3640
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
const long long INF = 1e18;
# define len(x) ((int)(x).size())
# define rep(i, n) for(int i=0, i##_len=(n); i<i##_len; ++i)
# define reps(i, n) for(int i=1, i##_len=(n); i<=i##_len; ++i)
# define rrep(i, n) for(int i=((int)(n)-1); i>=0; --i)
# define rreps(i, n) for(int i=((int)(n)); i>0; --i)
# define foreps(i, m, n) for(int i = m;i < n;i++)
# define ALL(x) (x).begin(), (x).end()
# define rall(x) (x).rbegin(), (x).rend()
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; }

int main() {
    ll K, A, B; cin >> K >> A >> B;
    if (B - A <= 2 || K < A - 1) cout << K + 1 << endl;
    else {
        ll ans = A; K -= A - 1;
        if (K % 2 == 1) ++ans, --K;
        ans += (B - A) * (K / 2);
        cout << ans << endl;
    }
}

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

int main(){
    int n;
    string s;
    cin>>n>>s;
    int x=0,ans=0;
    for(int i=0;i<n;i++){
        if(s.at(i)=='I'){
            x++;
            if(x>ans) ans=x;
        } 
        else x--;
    }
    cout<<ans<<endl;
}

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

using namespace std;

int main(void){

    long long n;
    cin >> n;
    
    long long result = 1;
    for(int i=1; i<=n; i++) {
        result *= i;
        if(result > 1000000000+7) result %= (1000000000+7);
    }
    
    cout << result << endl;

    return 0;
    
}


Measured memory_bytes: 256
#include <algorithm>
#include <array>
#include <cmath>
#include <cstdlib>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <queue>
#include <sstream>
#include <stack>
#include <string>
#include <tuple>
#include <unordered_map>
#include <unordered_set>
#include <vector>

#define REP(X, Y, Z) for (ll(X) = (Y); (X) < (Z); (X)++)
#define REV(X, Y, Z) for (ll(X) = (Y); (X) > (Z); (X)--)

using namespace std;
using ll = long long;
using dll = deque<ll>;
using pll = pair<ll, ll>;
using qll = queue<ll>;
using usll = unordered_set<ll>;
using umll = unordered_map<ll, ll>;
using sll = stack<int>;
using vll = vector<ll>;
using vvll = vector<vll>;

constexpr ll kMod = 1e9 + 7;

ll gcd(ll a, ll b) {
  if (a < b) {
    return gcd(b, a);
  }
  ll c = a % b;
  while (c != 0) {
    a = b;
    b = c;
    c = a % b;
  }
  return b;
}

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

void init() {
  cin.tie(nullptr);
  ios_base::sync_with_stdio(false);
  cout << fixed << setprecision(15);
}

int main() {
  init();

  ll N, M;
  cin >> N >> M;
  vll H(N);
  REP(i, 0, N) {
    ll n;
    cin >> n;
    H[i] = n;
  }
  unordered_map<ll, vll> routes(N);
  REP(i, 0, M) {
    ll a, b;
    cin >> a >> b;
    if (routes.find(a - 1) != routes.end()) {
      routes[a - 1].emplace_back(b - 1);
    } else {
      vll x{b-1};
      routes.emplace(a - 1, x);
    }

    if (routes.find(b - 1) != routes.end()) {
      routes[b - 1].emplace_back(a - 1);
    } else {
      vll x{a-1};
      routes.emplace(b - 1, x);
    }
  }

  ll result = 0;
  REP(i, 0, N) {
    if (routes.find(i) != routes.end()) {
      bool is_good = true;
      REP(j, 0, routes[i].size()) {
        if (H[i] <= H[routes[i][j]]) {
          is_good = false;
        }
      }
      if (is_good) {
        result++;
      }
    } else {
      result++;
    }
  }
  cout << result << endl;

  return 0;
}


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

const int MAX_N = 5005;
int64_t N, K;
int64_t perm[MAX_N];
int64_t cost[MAX_N];
bool seen[MAX_N];

int64_t best_val(const std::vector<int>& loop) {
  int64_t sum = 0;
  for (int i = 0; i < loop.size(); ++i)
    sum += cost[loop[i]];
  // printf("sum: %lld\n", sum);
  int64_t best_rem = LONG_LONG_MIN;
  for (int i = 0; i < loop.size(); ++i) {
    int64_t rem = 0;
    for (int sz = 0; sz < K; ++sz) {
      if (sz > loop.size()) break;
      rem += cost[loop[(i+sz)%loop.size()]];
      // printf("currem: %lld, idx: %d\n", rem, loop[(i+sz)%loop.size()]);
      int64_t pos = rem;
      if (sum > 0) pos += ((K - (sz+1)) / loop.size()) * sum;
      best_rem = std::max(pos, best_rem);
    }
    // printf("loop\n");
  }
  // printf("rem: %lld\n", best_rem);
  return best_rem;
}

int main() {
  scanf("%lld %lld", &N, &K);
  for (int i = 0; i < N; ++i) {
    scanf("%lld", perm + i);
    perm[i]--;
  }
  for (int i = 0; i < N; ++i)
    scanf("%lld", cost + i);
  std::vector<std::vector<int>> groups;
  for (int i = 0; i < N; ++i) {
    if (seen[i]) continue;
    std::vector<int> group;
    int st = i;
    group.push_back(st);
    int cur = perm[i];
    while (cur != st) {
      seen[cur] = true;
      group.push_back(cur);
      cur = perm[cur];
    }
    groups.push_back(std::move(group));
  }
  int64_t best = LONG_LONG_MIN;
  for (const auto& g : groups) {
    // printf("group: ");
    // for (int v : g) printf("%d ", v);
      // printf("\n");
    int64_t ans = best_val(g);
    // printf("this group: %lld\n", ans);
    best = std::max(best, ans);
  }
  printf("%lld\n", best);
}


Measured memory_bytes: 3840
//_Krenil_Bhikadiya_

#include<bits/stdc++.h>
#define MAX_SPEED ios_base::sync_with_stdio(false); cin.tie(NULL);
#define max(a,b) (a<b?b:a) 
#define min(a,b) (a>b?b:a) 
#define ll long long
#define ld long double
#define llu unsigned long long int
#define vi vector<int>
#define vll vector<ll>
#define pi pair<int,int>
#define pll pair<ll,ll>
#define umap unordered_map
#define uset unordered_set
#define rep(i,a,n) for(int i=(int)a;i<(int)n;i++)
#define rev(i,n,a) for(int i=(int)n;i>=(int)a;i--)
#define pb push_back
#define ff first
#define ss second
#define sz(v) ((int)(v).size())
#define all(v) (v).begin(),(v).end()
#define rall(v) (v).rbegin(),(v).rend()
#define endl "\n"
const int INF  = 1e9;
const llu INFM = 1e18;
const int mod  = INF+7;
using namespace std;


int gcd(int A,int B)
{
	if(A==0) return B;

	return gcd(B%A,A);
}

int lcm(int A,int B)
{
	return ( A*B / gcd(A,B) );
}

ll mod_pwr(ll A,ll B,ll P)
{
	ll RES = 1; A %= P;

	while(B>0)
	{
		if(B&1) RES = RES * A % P;
		A = A * A % P;
		B >>= 1;
	}

	return RES;
}

llu pwr(llu A,llu B)
{
	llu RES=1;

	while(B>0)
	{
		if(B&1) RES*=A;
		A=A*A;
		B>>=1;
	}

	return RES;
}

ll modInv(ll A,ll M)
{
	return mod_pwr(A,M-2,M);
}

bool isPrime(int N)
{
	if(N==1) return false;

	for(int i=2;i*i<=N;i++)
	{
		if(N%i==0) return false;
	}

	return true;
}

int32_t main()
{
	#ifndef ONLINE_JUDGE
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
	#endif
	
	MAX_SPEED
	
	int test=1; //cin>>test;
	while(test--)
	{
		int n,fg; cin>>n;

		vi a(n),b(n),c(n);

		rep(i,0,n) cin>>a[i]>>b[i]>>c[i];

		int p=a[0],q=b[0],r=c[0];

		rep(i,1,n)
		{
			a[0]=a[i]+max(q,r);
			b[0]=b[i]+max(p,r);
			c[0]=c[i]+max(p,q);
			p=a[0],q=b[0],r=c[0];
		}
		cout<<max(a[0],max(b[0],c[0]))<<endl;
	}
}

Measured memory_bytes: 4432
#include<stdio.h>
#define MAX 100000
int A[MAX],n,a;
int Partition(int p,int r){
    int c,x,i,j;
    x=A[r];
    i=p-1;
    for(j=p;j<r;j++){
        if(A[j]<=x){
            i=i+1;
            c=A[i];
            A[i]=A[j];
            A[j]=c;
        }
    }
    c=A[i+1];
    A[i+1]=A[r];
    A[r]=c;
return i+1;
}
void Showdata(int n){
int i;
for(i=0;i<n;i++){
   if(i==a){
       printf("[");
       printf("%d",A[i]);
       printf("] ");
   }
   if(i!=a){
       if(i!=n-1){
       printf("%d ",A[i]);
       }
       else printf("%d",A[i]);
   }
}
printf("\n");
}
int main(){
    int i;
    scanf("%d",&n);
    for(i=0;i<n;i++){
        scanf("%d",&A[i]);
    }
    a=Partition(0,n-1);
    Showdata(n);
    return 0;
}


Measured memory_bytes: 2104
#include<bits/stdc++.h>
using namespace std;
#define For(i,m,n) for(int i=m;i<n;i++)
#define FOR(i,n) for(int i=0;i<n;i++)
#define ll long long
#define ull unsigned long long
#define lli long long int
#define pb push_back
ll mob=1000000007;

using namespace std;
int main()
{ 

int n,k;
cin>>n>>k;
int a[n];
FOR(i,n) cin>>a[i];
ll dp[100006];
FOR(i,n+1) dp[i]=1010000117;
dp[0]=0;
FOR(i,n)
{
for(int j=i+1;j<=i+k;j++)
    {
        if(j<n)
        {
            dp[j]=min(dp[j],dp[i]+abs(a[i]-a[j]));
            
        }
    }
    
}
cout<<dp[n-1];




return 0;
}










Measured memory_bytes: 1408
import Foundation

#if swift(>=4.0)
extension String {
    func split(by separator: String) -> [String] {
        return self.components(separatedBy: separator)
    }
    func toArray() -> [String] {
        return self.map{String($0)}
    }
}
func exponentiate(_ lhs: Int, _ rhs: Int) -> Int {
    return (0..<rhs).reduce(1){i,_ in i*lhs}
}
#else
extension String {
    func split(by separator: String) -> [String] {
        return self.componentsSeparatedByString(separator)
    }
    var count: Int {
        return self.characters.count
    }
    func toArray() -> [String] {
        return self.characters.map{String($0)}
    }
    func uppercased() -> String {
        return self.uppercaseString
    }
    func lowercased() -> String {
        return self.lowercaseString
    }
}
//extension Array where Element == String {
//    func joined(separator separator: String) -> String {
//        return self.joinWithSeparator(separator)
//    }
//}
extension Array where Element: Comparable {
    func max() -> Element {
        return self.maxElement()!
    }
    func min() -> Element {
        return self.minElement()!
    }
    func sorted() -> Array {
        return self.sort()
    }
    func reversed() -> Array {
        return self.reverse()
    }
    mutating func sort() {
        self.sortInPlace()
    }
}
extension Array {
    init(repeating: Element, count: Int) {
        self.init(count: count, repeatedValue: repeating)
    }
}
func stride<T: Strideable>(from start: T, to end: T, by stride: T.Stride) -> StrideTo<T> {
    return start.stride(to: end, by: stride)
}
func exponentiate(lhs: Int, _ rhs: Int) -> Int {
    return (0..<rhs).reduce(1){i,_ in i*lhs}
}
#endif
func readInt() -> Int? {
    return Int(readLine()!)
}
func readStringSplit(by separator: String) -> [String] {
    return readLine()!.split(by: separator)
}
func readIntSplit(by separator: String) -> [Int] {
    return readLine()!.split(by: separator).map{Int($0)!}
}

/*************** テストスペース ***************/

//var min, min2, count: Int!
//for i in 1...10 {
//    let x = readInt()!
//    if i == 1 {
//        min = x
//        count = 1
//    } else if x < min {
//        min2 = min
//        min = x
//        count = 1
//    } else if x == min && count == 1 {
//        min2 = x
//        count = 2
//    }
//}
//print(min2)

/*************** メインプログラム ***************/

let N = readInt()!
let input = readIntSplit(by: " ")
let (D, X) = (input[0], input[1])
let A = (0..<N).map{_ in readInt()!}
let ans = A.reduce(X){$0+(D-1)/$1+1}
print(ans)


Measured memory_bytes: 1152
#[allow(unused_macros)]
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
    ($($r:tt)*) => {
        let mut s = {
            use std::io::Read;
            let mut s = String::new();
            std::io::stdin().read_to_string(&mut s).unwrap();
            s
        };
        let mut iter = s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
}
#[allow(unused_macros)]
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)*}
    };
}

#[allow(unused_macros)]
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!{
        a:usize, b: usize,
    }

    println!("{}", if a <=  b { a } else { a - 1 });
}


Measured memory_bytes: 4352
#define	_USE_MATH_DEFINES
#include <iostream>
#include <algorithm>
#include <functional>
#include <vector>
#include <cstdio>
#include <string>
#include <cmath>
#include <cfloat>
#include <map>
#include <queue>
#include <stack>
#include <list>
using namespace std;
int main(){

	int n,m;
	
	
	while(cin>>n>>m,n!=0||m!=0){
		int s1=0,s2=0;
		vector<int> x(n);
		vector<int> y(m);
		
	for(int i=0;i<n;i++){
		cin>>x[i];
		s1+=x[i];
	}
	
	for(int i=0;i<m;i++){
		cin>>y[i];
		s2+=y[i];
		
	}
		int f=0;
		int i,j;
		for(i=0;i<n;i++){
			for(j=0;j<m;j++){
				if(s1-x[i]+y[j]==s2-y[j]+x[i]){
					f=1;
					break;
				}
			
			}
			if(f==1)
				break;
		}
		if(f==1)
			cout<<x[i]<<" "<<y[j]<<endl;
		else
			cout<<"-1"<<endl;
	}
	
}

Measured memory_bytes: 1196
//#define local
#include <bits/stdc++.h>
using namespace std;
#define endl '\n'
#define rep(i,n); for(long long i = 0;i < (n);i++)
using ll = long long;
using P = pair<long long,long long>;
template <class T> using vec = vector<T>;
#ifdef local
#include "debug.cpp"
#else
#define debug(...)
#endif

int main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    //cout << fixed << setprecision(10);
    double r; cin >> r;
    debug(x);
    cout << 2 * r * acos(-1) << endl;
}

Measured memory_bytes: 3744
#include <iostream>

using namespace std;

int main() {
    int a,b,c,d;
    cin >> a >> b >> c >> d;
    int ab = a + b;
    int cd = c + d;
    if (ab > cd) {
        cout << "Left" << endl;
    } else if (ab < cd) {
        cout << "Right" << endl;
    } else {
        cout << "Balanced" << endl;
    }
}

Measured memory_bytes: 256
#include <bits/stdc++.h> 
#include <chrono>
using namespace std;
 
template<class T> inline string toString(T x) {ostringstream sout;sout<<x;return sout.str();}
 
 
//typedef
//------------------------------------------
typedef pair<int, int> PII;
typedef long long LL;
typedef pair<LL, LL> PLL;
 
//container util
//------------------------------------------
#define PB emplace_back
#define MP make_pair 
#define SZ(a) int((a).size())
//repetition
//------------------------------------------
#define FOR(i,a,b) for(LL i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)
#define SORT(c) sort((c).begin(),(c).end())
#define ALL(a)  (a).begin(),(a).end()
//constant
//--------------------------------------------
//clear memory
#define CLR(a) memset((a), 0 ,sizeof(a))

int main(){
    string S,T;
    cin>>S>>T;
    int cnt=0;
    REP(i,SZ(S))if(S[i]!=T[i])cnt++;
    cout<<cnt<<endl;
    return 0;
}


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

int main()
{
  int N, r, f=0;
  cin >> N;
  r=N;
  while(r!=0)
  {
    f += (r % 10);
    r /= 10;
  }
  if(N%f==0)cout << "Yes" << endl;
  else cout << "No" << endl;
}
  
  
    
  


Measured memory_bytes: 256
#include <iostream>
#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
#define PI  3.14159265358979323846
#define M   1000000007
ll fast(ll n,ll a,ll m)
{
    if(n==0)
        return 1;
    else if(n==1)
        return a;
    else
    {
        ll r=fast(n/2,a,m);
        if(n%2==0)
        {
            return (((r%m)*(r%m))%m);
        }
        else
        {
            return (((((r%m)*a)%m)*r)%m);
        }
    }
}
ll lcm(ll a,ll b)
{
    ll p=a*b;
    p/=__gcd(a,b);
    return p;
}
ll solve(ll z,ll p,ll q,ll n)
{
    ll g=n/z;
    if(g<p)
    {
        return -1;
    }
    else
    {
       g-=p;
       if(g%q==0)
       {
           g/=q;
           return (z+g);
       }
       else
       {
           return -1;
       }
    }
}
int main()
{
    int n;
    cin>>n;
    cout<<(n/2)+(n%2);


}


Measured memory_bytes: 256
n = int(input())
arr = [int(i) for i in input().split()]

arr[0] -= 1

result = 'Yes'

for i in range(1, n):
    if(arr[i] >= arr[i-1] + 1):
        arr[i] -= 1
    elif(arr[i] < arr[i-1]):
        result = 'No'
        break

print(result)

Measured memory_bytes: 14252
#include <vector>
#include <iostream>
#include <utility>
#include <algorithm>
#include <string>
#include <deque>
#include <queue>
#include <tuple>
#include <queue>
#include <functional>
#include <cmath>
#include <iomanip>
#include <map>
#include <set>
#include <numeric>
#include <unordered_map>
#include <unordered_set>
#include <complex>
#include <iterator>
#include <array>
#include <memory>
#include <stack>
#define vi vector<int>
#define vvi vector<vector<int> >
#define ll long long int
#define vl vector<ll>
#define vvl vector<vector<ll>>
#define vb vector<bool>
#define vc vector<char>
#define vs vector<string>
#define ld long double
#define INF 1e9
#define EPS 0.0000000001
#define rep(i,n) for(int i=0;i<n;i++)
#define loop(i,s,n) for(int i=s;i<n;i++)
#define all(in) in.begin(), in.end()
template<class T, class S> void cmin(T &a, const S &b) { if (a > b)a = b; }
template<class T, class S> void cmax(T &a, const S &b) { if (a < b)a = b; }
#define MAX 9999999
using namespace std;;
typedef pair<double,double>pdd;
typedef pair<ll,ll>pll;
#define int ll
typedef pair<int, int> pii;
signed main(){
    int n; cin>>n;
    pii ans=pii(0,0);
    rep(i,n){
        int a,b; cin>>a>>b;
        int power=max((int)1,max((ans.first+a-1)/a,(ans.second+b-1)/b));
        ans=pii(a*power,b*power);
    }
    cout<<ans.first+ans.second<<endl;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main(void){
  int i,j,N,count=0,ans=0;
  cin >> N;
  for(i=105;i<=N;i=i+2){
    count=0;
    for(j=1;j<=i;j++){
      if(i%j==0){
        count++;
      }
    }
    if(count==8){
      ans++;
    }
  }
  cout << ans << endl;
}

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

int main(){
  long long int n,a,A,count=1;
  cin>>n;
  vector<long long int> p(n),P;
  vector<string> s(n),S(n);
  for(int i=0;i<n;i++){
    cin>>s[i]>>p[i];
    S[i]=s[i];
  }
  sort(S.begin(),S.end());
  for(int i=0;i<n;i++){
    if(count==1){
    count=0;
    for(int j=0;j<n;j++){
      if(S[i]==s[j]){
        P.push_back(p[j]);
        count++;
      }
    }
    sort(P.begin(),P.end());
    reverse(P.begin(),P.end());
    for(int j=0;j<count;j++){
      for(int k=0;k<n;k++){
        if(P[j]==p[k]){
          cout<<k+1<<endl;
        }
      }
    }
    for(int j=0;j<count;j++){
      P.pop_back();
    }
    }
    else{count--;}
  }
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define ll long long
using namespace std;
ll n,i,ans,a[500001],hh;
int main(){
	scanf("%lld",&n);
	for(i=1;i<=n;i++){
	 scanf("%lld",&a[i]);
	 a[i]-=i;
 }
   sort(a+1,a+n+1);
   hh=a[(n+1)/2];
   for(i=1;i<=n;i++)ans+=abs(hh-a[i]);
   printf("%lld",ans);
}

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

#define REP(i, n, N) for(ll i=(n); i<(N); i++)
#define RREP(i, n, N) for(ll i=(N-1); i>=(n); i--)
#define LREP(lst,itr) for(auto itr = lst.begin(); itr != lst.end(); ++itr)
#define CK(n, a, b) ((a)<=(n)&&(n)<(b))
#define ALL(v) (v).begin(),(v).end()
#define MCP(a, b) memcpy(b,a,sizeof(b))
#define P(s) cout<<(s)<<endl
#define P2(a, b) cout<<(a)<<" "<<(b)<<endl
#define P3(a, b, c) cout<<(a)<<" "<<(b)<<" "<<(c)<<endl
#define V2(T) vector<vector<T>>
typedef long long ll;
using namespace std;
const ll MOD = 1e9 + 7;
const ll INF = 1e18;

int main(){
    int n;
    string S;
    cin >> n >> S;
    int ans=0;
    REP(i,0,S.size()-2){
        if(S[i]=='A' && S[i+1]=='B' && S[i+2]=='C'){
            ans++;
        }
    }
    P(ans);
}

Measured memory_bytes: 256
/**
 * code generated by JHelper
 * More info: https://github.com/AlexeyDmitriev/JHelper
 * @author aryssoncf
 */



// Taken from: https://github.com/bqi343/USACO/blob/master/Implementations/content/contest/templateShort.cpp

#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<ull> vul;
typedef vector<ll> vl;
typedef vector<pii> vpii;

#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define F0R(i, a) FOR(i,0,a)
#define ROF(i, a, b) for (int i = (b)-1; i >= (a); --i)
#define R0F(i, a) ROF(i,0,a)
#define trav(a, x) for (auto& a: x)

#define sz(x) (int)x.size()
#define all(x) begin(x), end(x)
#define rsz resize

#define mp make_pair
#define pb push_back
#define f first
#define s second

const int MOD = 1e9 + 7; // 998244353; // = (119<<23)+1
const int MX = 2e5 + 5;

template<class T>
bool ckmin(T &a, const T &b) {
    return a > b ? a = b, 1 : 0;
}

template<class T>
bool ckmax(T &a, const T &b) {
    return a < b ? a = b, 1 : 0;
}

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


//
// Created by aryssoncf on 28/10/2019.
//

#include <type_traits>


#include <iterator>
#include <utility>

template<typename T>
constexpr auto hasBegin(int) -> decltype(std::begin(std::declval<T>()), true) {
    return true;
}

constexpr bool hasBegin(...) {
    return false;
}

template<typename T>
using IsContainer = std::integral_constant<bool, hasBegin<T>(0)>;


#ifndef JHELPER_EXAMPLE_PROJECT_IO_HPP
#define JHELPER_EXAMPLE_PROJECT_IO_HPP

#endif //JHELPER_EXAMPLE_PROJECT_IO_HPP

template<typename T>
std::istream &operator>>(std::istream &is, std::vector<T> &vec) {
    for (T &element: vec) {
        is >> element;
    }
    return is;
}

template<typename T, typename U>
std::istream &operator>>(std::istream &is, std::pair<T, U> &p) {
    is >> p.first;
    is >> p.second;
    return is;
}

template<class X, class Y>
std::ostream &operator<<(std::ostream &os, std::pair<X, Y> const &p) {
    return os << p.first << " " << p.second;
}

template<class Ch, class Tr, class Container>
std::basic_ostream<Ch, Tr> &operator<<(std::basic_ostream<Ch, Tr> &os, Container const &x) {
    bool first = true;
    for (auto &y : x) {
        if (first) {
            first = false;
        } else {
            os << " ";
        }
        os << y;
    }
    return os;
}

using namespace std;

class CExceptionHandling {
public:
    void solve(std::istream &in, std::ostream &out) {
        int n;
        in >> n;
        vi A(n);
        in >> A;
        vi B = A;
        sort(all(B));
        int x = B[n - 1], y = B[n - 2];
        trav(a, A) {
            int res = a == x ? y : x;
            out << res << '\n';
        }
    }

    void setup() {}
};


int main() {
    std::ios_base::sync_with_stdio(false);
    CExceptionHandling solver;
    solver.setup();
    std::istream &in(std::cin);
    std::ostream &out(std::cout);
    in.tie(nullptr);
    out << std::fixed;
    out.precision(20);
    solver.solve(in, out);
    return 0;
}


Measured memory_bytes: 4776
s = input()
r = s[::-1]
s1 = s[:int((len(s)-1)/2)]
s1r = s1[::-1]
s2 = s[int((len(s)+3)/2-1):]
s2r = s2[::-1]
if s==r and s1==s1r and s2==s2r:
    print('Yes')
else:
    print('No')

Measured memory_bytes: 3060
#include<algorithm>
#include<cmath>
#include<cstdio>
#include<iostream>
#include<map>
#include<numeric>
#include<queue>
#include<sstream>
#include<stack>
#include<string>
#include<unordered_set>
#include<vector>

#define ll long long
#define P pair<int,int>
#define FOR(i,N) for(int i=0;i<(int)N;i++)
#define FORIN(i,a,b) for(int i=a;i<(int)b;i++)
#define ALL(x) (x).begin(),(x).end()
#define LAST(x) (x)[(x).size()-1]
#define GI(name) int (name);scanf("%d",&(name))
#define GI2(name1,name2) int (name1),(name2);scanf("%d %d",&(name1),&(name2))
#define GI3(name1,name2,name3) int (name1),(name2),(name3);scanf("%d %d %d",&(name1),&(name2),&(name3))
#define GVI(name,size) vector<int> (name)(size);FOR(i,(size))scanf("%d",&(name)[i])
#define MOD 1000000007

using namespace std;

string to_hex(int x){
    stringstream ss;
    ss<<hex<<x;
    return ss.str();
}

inline int get_int(){
    int ret;
    scanf("%d",&ret);
    return ret;
}

inline vector<int> get_ints(int n){
    vector<int> ret(n);
    FOR(i,n){
        scanf("%d",&ret[i]);
    }
    return ret;
}

inline string get_str(){
    string ret;
    cin>>ret;
    return ret;
}

bool is_prime(int n){
    int s=sqrt(n)+1;
    for(int i=2;i<=s;++i){
        if(n%i==0){
            return 0;
        }
    }
    return 1;
}

vector<P> prime_division(int n){
    vector<P> ret;
    int s=sqrt(n)+1;
    int c=0;
    for(int i=2;i<=n;++i){
        if(n%i==0){
            c=0;
            do{
                ++c;
                n/=i;
            }while(n%i==0);
            ret.push_back(P(i,c));
        }
    }
    return ret;
}

string to_string(string s){
    return s;
}

template<class T>
string to_string(vector<T> v){
    string ret="{";
    FOR(i,v.size()-1){
        ret+=to_string(v[i])+",";
    }
    if(v.size()>0){
        ret+=to_string(LAST(v));
    }
    ret+="}";
    return ret;
}

void debug_print(){
    cerr<<endl;
}

template<class Head,class... Tail>
void debug_print(Head head,Tail... tail){
    cerr<<to_string(head)<<" ";
    debug_print(tail...);
}

template<class... T>
void debug(T... args){
    cerr<<"["<<__LINE__<<"]: ";
    debug_print(args...);
}

void print(){
    cout<<endl;
}

template<class Head,class... Tail>
void print(Head head,Tail... tail){
    cout<<to_string(head);
    print(tail...);
}

int main(){
    GI2(N,M);
    vector<int> list(N,0);
    FOR(i,M){
        GI2(a,b);
        list[a-1]++;
        list[b-1]++;
    }
    FOR(i,N){
        print(list[i]);
    }
    return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define FIO ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
int main()
{
    FIO;
    int n,i,j;
    string s;
    cin>>n>>s;
    if(n&1)
    {
        cout<<"No"<<endl;
        return 0;
    }
    for(i=0,j=n/2; i<n/2; i++,j++)
        if(s[i]!=s[j])
        {
            cout<<"No"<<endl;
            return 0;
        }
    cout<<"Yes"<<endl;
}


Measured memory_bytes: 256
import java.util.*;
import java.lang.*;

class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
            int r = sc.nextInt();
            int D = sc.nextInt();
            int x2k = sc.nextInt();
        sc.close();

        int tmp = 0;
        int ans = 0;
        int var = x2k;
        for(int i = 0 ; i < 10 ; i++){
            ans = r * var - D;
            System.out.println(ans);
            var = ans;
        }
   }
}


Measured memory_bytes: 21844
/*
ID: wangjun30
TASK:
LANG: C++
*/
#include<iostream>
using namespace std;
int main(){
	int n,cur;
	cin>>n>>cur;
	for(int i=1;i<n;i++){
		int x;
		cin>>x;
		if(x<cur-1){
			cout<<"No";
			return 0;
		}
		cur=max(x,cur);
	}
	cout<<"Yes";
	return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include<algorithm>
#include<cmath>
#include<cstring>
#define pb              push_back
#define pi              acos(-1.0)
#define loop(i,a,n)     for(int i=a;i<n;i++)
#define rloop(i,n,a)    for(int i=n;i>=a;i--)
#define ll              long long int
#define ff              first
#define ss              second
#define pii             pair<ll,ll>
#define sc1(a)          scanf("%d",&a)
#define sc2(a,b)        scanf("%d %d",&a,&b)
#define sc3(a,b,c)      scanf("%d %d %d",&a,&b,&c)
#define all(v)          v.begin(),v.end()
#define ms(a,b)         memset(a,b,sizeof a)
#define FastIO          ios_base::sync_with_stdio(0);cin.tie(0),cout.tie(0)
#define fileout         freopen("output.txt","w",stdout)
#define filein          freopen("input.txt","r",stdin)
#define inf             2e9+5
#define Q               int q;cin>>q;while(q--)
#define check           cout<<"HI"<<endl;

//int x[]= {-1,0,0,1};
//int y[]= {0,-1,1,0};

using namespace std;

int main()
{
    int n;
    ll ans=0;
    cin >> n;
    int a[n+5];
    loop(i,0,n)
    {
        cin >> (a[i]);
        ans^=a[i];
    }
    loop(i,0,n)
    {int x = ans^a[i];
        cout<<x<<" ";
    }


}












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

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

    map<int, int> A;
    int a;
    long long res = 0;
    for (int i = 0; i < N; i++)
    {
        cin >> a;
        res += a;
        auto itr = A.find(a);
        if (itr != A.end())
        {
            A[a]++;
        }
        else
        {
            A[a] = 1;
        }
    }

    int Q;
    cin >> Q;

    int B, C;
    for (int i = 0; i < Q; i++)
    {
        cin >> B >> C;
        auto iter = A.find(B);
        if (iter == A.end())
        {
            cout << res << endl;
            continue;
        }
        //
        auto iterC = A.find(C);
        if (iterC != A.end())
        {
            A[C] += A[B];
        }
        else
        {
            A[C] = A[B];
        }
        res += (C - B) * A[B];
        cout << res << endl;
        A.erase(B);
    }
}


Measured memory_bytes: 6512
"use strict";
const main = arg => {
  let Nums = arg.split(" ");
  let X = -1,Y = -1,Z = -1;
  for(let i = 0; i <=Nums[0]; i++) {
    for(let j = 0; j <=Nums[0]; j++) {
		let k = Nums[0] - i - j;
      	if( k>=0 && (i*10000 + j*5000+ k*1000 == Nums[1])){
        	X = i;
          	Y = j;
          	Z = k;
        	break;
        }
    }  	
  }
  console.log(X + " "+ Y + " "+  Z);
}

main(require('fs').readFileSync('/dev/stdin', 'utf8'));


Measured memory_bytes: 9548
#include <bits/stdc++.h> 
 
#define INF (1<<31) - 1 //INT_MAX/2
#define MOD 1000000007
#define PI  acos(-1)

using ll  = long long;
using ull = unsigned long long;
using P = std::pair<int, int>;

int main(int argc, char *argv[])
{
    int A, B, C, D;
    std::cin >> A >> B >> C >> D;

    std::cout << std::max(A*B, C*D) << std::endl;
    return 0;
}

Measured memory_bytes: 256