akhauriyash/Code-Regression huggingface dataset:
import bisect,collections,copy,heapq,itertools,math,string
import sys
def S(): return sys.stdin.readline().rstrip()
def M(): return map(int,sys.stdin.readline().rstrip().split())
def I(): return int(sys.stdin.readline().rstrip())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))
def LS(): return list(sys.stdin.readline().rstrip().split())
a = I()
s = S()
if a >= 3200:
    print(s)
else:
    print('red')

Measured memory_bytes: 3888
#include<bits/stdc++.h>
using namespace std;
int main()
{
	int n,d;
	cin>>n>>d;
	int count=0;
	vector<int> v;
	for(int i=1;i<=n;i++)
	{
		v.push_back(i);
	}
	int i=1;
	while(1)
	{
		if(i>n)
			break;
		i=i+2*d;
		i++;
		count++;
	}
	cout<<count;
	return 0;
}

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

int main(){

int fruits[1001] , pickFruits , N ;
  
cin >> N ;
cin >> pickFruits ;
 
for(int i=0; i<N ; i++){
	cin >> fruits[i] ;
}
  
sort(fruits , fruits+N);
int sum=0;  
for(int i=0; i<pickFruits;i++){
sum += fruits[i];
}
 cout << sum ;
return 0 ;


}


Measured memory_bytes: 3652
N = int(input())
#A = [int(a) for a in input().split()]
#A = input().split()
A = list(map(int,input().split()))

ans = 1

if 0 in A:
	print(0)
else:
	for a in range(N):
		ans = ans * A[a]

		if ans > (10 ** 18):
			ans = -1
			break
	print(ans)

Measured memory_bytes: 84876
from heapq import heappush, heappop, heapify
from collections import deque, defaultdict, Counter
import itertools
from itertools import permutations, combinations, accumulate
import sys
import bisect
import string
import math
import time


def I(): return int(input())


def MI(): return map(int, input().split())


def S(): return input()


def MS(): return map(str, input().split())


def LI(): return [int(i) for i in input().split()]


def LI_(): return [int(i)-1 for i in input().split()]


def StoI(): return [ord(i)-97 for i in input()]


def ItoS(nn): return chr(nn+97)


def input(): return sys.stdin.readline().rstrip()


def show(*inp, end='\n'):
    if show_flg:
        print(*inp, end=end)


def print_matrix(mat):
    for i in range(len(mat)):
        print(*mat[i])


YNL = {False: 'No', True: 'Yes'}
YNU = {False: 'NO', True: 'YES'}
MOD = 10**9+7
inf = float('inf')
IINF = 10**10
l_alp = string.ascii_lowercase
u_alp = string.ascii_uppercase
ts = time.time()
# sys.setrecursionlimit(10**6)
nums = ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10']


# show_flg = True
show_flg = False


def factorization(n):
    if n <= 1:
        return []

    ret = []
    while n > 2 and n % 2 == 0:
        ret.append(2)
        n //= 2
    i = 3
    while i <= math.sqrt(n):
        if n % i == 0:
            ret.append(i)
            n //= i
        else:
            i += 2
    ret.append(n)
    return ret


def main():
  s = S()
  t = S()
  s = ''.join(sorted([i for i in s]))
  t = ''.join(sorted([i for i in t], reverse=True))

  print(YNL[s < t])


if __name__ == '__main__':
    main()


Measured memory_bytes: 38512
#include <bits/stdc++.h>
using namespace std;
#define ll          long long int
#define pb          push_back
#define pll         pair<ll,ll>
#define speed_up    ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define mod         1000000007
#define inf         1000000000000000000LL
#define vl          vector<ll>
#define F           first
#define S           second
#define db          long double
#define sz(x)       (ll)x.size()
#define fix(n)      cout<<fixed<<setprecision(n)
#define rep(i,a,b)  for(ll i=a;i<b;i++)
#define all(x)      x.begin(),x.end()
#define pi          3.14159265358979323

ll h, w, dis[101][101], white;
string s[101];

void solve()
{
       cin>>h>>w;
       rep(i,0,h)
       {
              cin>>s[i];
              rep(j,0,w) if(s[i][j]=='.') white++;
       }
       rep(i,0,h) rep(j,0,w)  dis[i][j] = 1<<30;
       queue<pair<ll,ll>>Q;
       Q.push({0,0});
       dis[0][0]=1;
       while(!Q.empty())
       {
              ll x = Q.front().F;
              ll y = Q.front().S;
              Q.pop();
              ll dx[4] = {1, 0, -1, 0}, dy[4] = {0, 1, 0, -1};
              rep(i,0,4)
              {
                     ll nx = x + dx[i], ny = y + dy[i];
                     if(nx<0 || ny<0 || nx >= h || ny >= w || dis[nx][ny] <= dis[x][y] + 1 || s[nx][ny]=='#') continue; // if cur path is longer or point already covered by this path, then continue
                     Q.push({nx, ny});
                     dis[nx][ny] = dis[x][y] + 1;
              }
       }
       if(dis[h-1][w-1] == (1<<30)) cout<<-1<<endl;
       else cout << white - dis[h-1][w-1] << endl;
}

int main()
{
       speed_up;
       ll T=1;
       //cin>>T;
       while(T--) solve();
	return 0;
}


Measured memory_bytes: 256
/*
 *  Lang    : C++
 *  Author  : little_angel
 */
#include <bits/stdc++.h>

using namespace std;

signed main() {
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    cout.tie(nullptr);

    int H, W, K;
    cin >> H >> W >> K;
    vector<pair<int, int>> del = {
            {1,  0},
            {-1, 0},
            {0,  1},
            {0,  -1}
    };

    const int inf = 1e9;
    vector<vector<int>> stroke(H, vector<int>(W, inf));
    vector<string> g(H);
    int sx, sy, ex, ey, dx, dy, mx, my, x, y;
    cin >> sx >> sy >> ex >> ey;
    for (auto &i:g)cin >> i;
    queue<pair<int, int>> q;
    q.push({sx - 1, sy - 1});
    stroke[sx - 1][sy - 1] = 0;

    while (not q.empty()) {
        tie(x, y) = q.front();
        q.pop();
        for (auto diff:del) {
            tie(dx, dy) = diff;
            for (int k = 1; k <= K; ++k) {
                mx = x + k * dx;
                my = y + k * dy;
                if (mx < 0 or H <= mx or my < 0 or W <= my or g[mx][my] == '@' or
                    1 + stroke[x][y] > stroke[mx][my])
                    break;
                if (stroke[mx][my] > 1 + stroke[x][y]) {
                    stroke[mx][my] = 1 + stroke[x][y];
                    if (mx == ex - 1 and my == ey - 1) {
                        cout << stroke[mx][my] << endl;
                        return 0;
                    }
                    q.push({mx, my});
                }
            }
        }
    }

    cout << -1 << endl;
}

Measured memory_bytes: 11116
import math
n = int(input())
w = math.sqrt(n)


def f(a, b):
    return max(len(str(a)), len(str(b)))


ans = 10**4
for i in range(1, int(w)+2):
    if n % i != 0:
        continue
    j = n//i
    ans = min(f(i, j), ans)
print(ans)


Measured memory_bytes: 3064
#include <cmath>
#include <vector>
#include <cstdio>
#include <iostream>
#include <algorithm>

using namespace std;

typedef pair<int, int> ii;
typedef vector<ii> vii;




int main() {

    int a, b, c;
    scanf("%d %d %d", &a, &b, &c);
    printf("%d\n", a + b + c - max(max(a,b),c));

    
    return 0;
}


Measured memory_bytes: 256
while 0 == 0:
    a,b = map(int,input().split())
    if a == b == 0:
        break
    for i in range(a):
        for j in range(b):
            if i%2 == j%2:
                print("#",end = "")
            else:
                print(".",end = "")
        print()
    print()


Measured memory_bytes: 7004
n = int(input())
s = input()
ans = 0

lchrs = [0]*26
rchrs = [0]*26
flag = [False]*26
for c in s:
    lchrs[ord(c)-ord("a")] += 1

for c in s:
    i = ord(c)-ord("a")
    lchrs[i] -= 1
    rchrs[i] += 1
    if lchrs[i] and rchrs[i]:
        flag[i] = True
    else:
        flag[i] = False
    ans = max(ans, len([_ for _ in flag if _]))
print(ans)


Measured memory_bytes: 9196
#include<stdio.h>
int a[(int)1e5+1],n,k;

int main(){
	scanf("%d%d",&n,&k);
	for(int i=1;i<=n;++i)scanf("%d",&a[i]);
	int ans=(n-1+k-2)/(k-1);
	printf("%d\n",ans);
}

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

#define dv(i) for (int c=0; c<(int)(i).size(); c++) cout<<(i)[c]<<(c==(int)(i).size()-1?"\n":" ")
#define dm(i) for (auto f: i) cout<<f.first<<" "<<f.second<<"\n"
#define FOR(i, a, b) for (int i=a; i<(b); i++)
#define F0R(i, a) for (int i=0; i<(a); i++)
#define FORd(i,a,b) for (int i = (b)-1; i >= a; i--)
#define F0Rd(i,a) for (int i = (a)-1; i >= 0; i--)

typedef long long ll;
typedef long double ld;
typedef complex<ld> cd;

typedef pair<int, int> pi;
typedef pair<ll,ll> pl;
typedef pair<ld,ld> pd;

typedef vector<int> vi;
typedef vector<string> vs;
typedef vector<ld> vd;
typedef vector<ll> vl;
typedef vector<pi> vpi;
typedef vector<pl> vpl;
typedef vector<cd> vcd;

#define sz(x) (int)(x).size()
#define mp make_pair
#define pb push_back
#define f first
#define s second
#define lb lower_bound
#define ub upper_bound
#define all(x) x.begin(), x.end()
#define alp(i) (i),(i)+sizeof((i))/sizeof((i)[0])

const int MOD = 1000000007;

int main() {
    ios_base::sync_with_stdio(false); cin.tie(0);
    int A,B; cin>>A>>B;
    int ar[3]={A+B,A-B,A*B};
    sort(alp(ar));
    cout<<ar[2]<<'\n';
    return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
//#include<string>
using namespace std;
int main(){
  int n;
  cin>>n;
  string s;
  cin>>s;
  int l=1;
  for(int i=1;i<s.length();i++){
    if(s[i]!=s[i-1])
      l=l+1;
  }
  cout<<l<<"\n";
  return 0;
}


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

int main() {
  int N, M;
  cin >> N >> M;
  vector<int> V;
  for (int i = 0; i < N; i++) {
    V.push_back(0);
  }
  for (int i = 0; i < M; i++) {
    V.push_back(1);
  }
  int ans = 0;
  for (int i = 0; i < N + M; i++) {
    for (int j = 0; j < i; j++) {
      if ((V.at(i) + V.at(j)) % 2 == 0) ans++;
    }
  }
  cout << ans << "\n";
}

Measured memory_bytes: 3624
#  --*-coding:utf-8-*--

import heapq


def g(Q, n):
    x = 0

    for i in range(n):
        if len(Q) == 0:
            break

        x += -heapq.heappop(Q)

    return x


def f(AB, M):
    lastA = None
    Q = []
    sumOfB = 0

    for a,b in AB:
        if a > M:
            break

        if a != lastA:
            if lastA != None:
                sumOfB += g(Q, a-lastA)

            lastA = a

        heapq.heappush(Q, -b)
            
    if lastA != None:
        sumOfB += g(Q, M-lastA+1)

    return sumOfB


def main():
    N,M = map(int, input().split())
    AB = sorted(list(map(int, input().split())) for i in range(N))

    print(f(AB, M))


if __name__ == '__main__':
    main()


Measured memory_bytes: 31604
#include <stdio.h>

#define VerticesNum 100
typedef unsigned int uint;



int main(void){
    uint Graph[VerticesNum][VerticesNum] = {};
    
    uint uVertices;
    scanf("%u", &uVertices);
    
    for(uint i = 0; i < uVertices; i++)
    {
        uint uVertexIdx;
        uint OutDegree;
        scanf("%u", &uVertexIdx);
        scanf("%u", &OutDegree);
        for(uint j = 0; j < OutDegree; j++)
        {
            uint AdjacentVertex;
            scanf("%u", &AdjacentVertex);
            Graph[uVertexIdx - 1][AdjacentVertex - 1] = 1; 
        }
    }
    
    for(uint i = 0; i < uVertices; i++)
    {
        for(uint j = 0; j < uVertices; j++)
        {
            printf("%u", Graph[i][j]);
            (j < (uVertices - 1))
                ? printf(" ")
                : printf("\n");
        }
    }
    
    return 0;
}


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

int main() {
    int w, h, n;
    cin >> w >> h >> n;
    vector<vector<int>> c(w, vector<int>(h));
    for (int i=0; i<w; i++)
        for (int j=0; j<h; j++)
            c[i][j] = 0;


    for (int i=0; i<n; i++) {
        int x, y, a;
        cin >> x >> y >> a;

        if (a == 1) {
            for (int j=0; j<x; j++)
                for (int k=0; k<h; k++)
                    c[j][k] = 1;
        } else if (a == 2) {
            for (int j=x; j<w; j++)
                for (int k=0; k<h; k++)
                    c[j][k] = 1;
        } else if (a == 3) {
            for (int j=0; j<w; j++)
                for (int k=0; k<y; k++)
                    c[j][k] = 1;
        } else if (a == 4) {
            for (int j=0; j<w; j++)
                for (int k=y; k<h; k++)
                    c[j][k] = 1;
        }
    }

    int count = 0;
    for (int i=0; i<w; i++)
        for (int j=0; j<h; j++)
            if (c[i][j] == 0) count++;

    cout << count << endl;

    return 0;
}


Measured memory_bytes: 256
#include <iostream>

using namespace std;

int main()
{
	int a, b, c, d;
	cin >> a >> b >> c >> d;
	if (abs(a-b) <= d && abs(b-c) <= d || abs(a-c) <= d) 
		cout << "Yes" << endl;
	else 
		cout << "No" << endl;
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define REP(i, n) for (int i = 0; i < n; i++)
#define FOR(i, m, n) for (int i = m; i < n; i++)
#define ll long long int
const int INF = 2147483647;

using namespace std;
struct edge
{
  int to, cost;
};
typedef std::vector<std::vector<edge>> graph;

graph prim(const graph &g, const int size, const int init)
{
  int mincost[size] = {};
  bool used[size] = {};

  REP(i, size)
  {
    mincost[i] = INF;
  }

  mincost[init] = 0;
  graph res(size);
  priority_queue<pair<int, pair<int, int>>, vector<pair<int, pair<int, int>>>, greater<pair<int, pair<int, int>>>> q;
  for (auto v : g[init])
  {
    q.push(make_pair(v.cost, make_pair(init, v.to)));
  }
  used[init] = true;

  while (!q.empty())
  {
    auto p = q.top();
    q.pop();
    auto e = p.second;

    if (used[e.second])
      continue;

    res[e.first].push_back({e.second, p.first});
    res[e.second].push_back({e.first, p.first});

    for (auto v : g[e.second])
    {
      q.push(make_pair(v.cost, make_pair(e.second, v.to)));
    }
    used[e.second] = true;
  }
  return res;
}
int main()
{
  int v, e;
  cin >> v >> e;
  graph g(v);
  REP(i, e)
  {
    int s, t, w;
    cin >> s >> t >> w;
    g[s].push_back({t, w});
    g[t].push_back({s, w});
  }

  graph res = prim(g, v, 0);

  int ans = 0;
  REP(i, v)
  {
    for (auto vi : res[i])
    {
      ans += vi.cost;
    }
  }
  cout << ans / 2 << endl;
}



Measured memory_bytes: 9224
"use strict"
function main(arg) {
    arg = arg.trim().split("\n")
    var N = Number(arg.shift())
    var data = arg.map((e1) => {
        return e1.split(" ").map(Number)
    })
    var pq = getPq(data)
    var p = pq[0]
    var q = pq[1]
    var tmp = []
    for (var i = 0; i < data.length; i++) {
        for (var j = 0; j < data.length; j++) {
            if (i === j) continue
            var _p = data[i][0] - data[j][0]
            var _q = data[i][1] - data[j][1]
            if (p === _p && q === _q) {
                // console.log(i)
                tmp.push(i)
            }
        }
    }
    var b = tmp.filter(function (x, i, self) {
        return self.indexOf(x) === i;
    });
    console.log(data.length - b.length)
    // console.log(pq)
    return
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));


function getPq(data) {
    var pq = []
    for (var i = 0; i < data.length; i++) {
        for (var j = 0; j < data.length; j++) {
            if (i === j) continue
            var keyStr = [
                data[i][0] - data[j][0],
                data[i][1] - data[j][1]
            ].join(',')
            pq.push(keyStr)
            // console.log(keyStr)
        }
    }
    pq.sort()
    var pqcount = {}
    for (var i = 0; i < pq.length; i++) {
        var key = pq[i]
        if (pqcount[key] == null) {
            pqcount[key] = 0
        }
        pqcount[key] += 1
    }
    var result = ""
    var resultValue = 0
    for (var key in pqcount) {
        if (resultValue < pqcount[key]) {
            resultValue = pqcount[key]
            result = key
        }
    }
    // console.log(data.length - resultValue)
    return result.split(",").map(Number)
}


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

int main()
{
    int n,h,i,ans=0;
    cin >> n >> h;
    int a[n],b[n];
    for(i=0;i<n;i++)
        cin >> a[i] >> b[i];
    sort(a,a+n);
    sort(b,b+n);
    for(i=n-1;i>=0;i--)
    {
        if(b[i]>=a[n-1] && h>0)
        {
            h=h-b[i];
            ans++;
        }
    }
    if(h>0)
    {
        ans = ans + (h/a[n-1]);
        if(h%a[n-1]!=0)
        {
            ans++;
        }
    }
    cout << ans << endl;
}


Measured memory_bytes: 1024
#include <cstdio>
#include <iostream>

using namespace std;

int main() {

  int64_t A, B;
  cin >> A >> B;

  if(A == 1)
    A = 14;
  if(B == 1)
    B = 14;

  if(A == B)
    cout << "Draw" << endl;
  else if(A > B)
    cout << "Alice" << endl;
  else
    cout << "Bob" << endl;

  return 0;
}


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

int main() {
    int N, M;
    cin >> N >> M;
    int A[N];
    int sum = 0;
    for (int i = 0; i < N; ++i) {
        cin >> A[i];
        sum += A[i];
    }
    int cnt = 0;
    for (int i = 0; i < N; ++i) {
        if (A[i] < sum / (4.0 * M)) {
            continue;
        }
        else {
            ++cnt;
        }
    }
    if (cnt >= M) cout << "Yes" << endl;
    else cout << "No" << endl;
}


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

namespace I
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = int.Parse(Console.ReadLine());
            int[,] inp = new int[n, 2];
            HashSet<int> hash = new HashSet<int>();
            for (int i = 0; i < n; i++)
            {
                int[] x = Console.ReadLine().Split().Select(int.Parse).ToArray();
                hash.Add(x[0]); hash.Add(x[1]);
                inp[i, 0] = x[0]; inp[i, 1] = x[1];
            }
            int[] arr = hash.ToArray();
            Array.Sort(arr);
            int[] sum = new int[arr.Length + 1];
            for (int i = 0; i < n; i++)
            {
                sum[Array.BinarySearch(arr, inp[i, 0])]++;
                sum[Array.BinarySearch(arr, inp[i, 1]) + 1]--;
            }
            for (int i = 1; i < sum.Length; i++)
            {
                sum[i] += sum[i - 1];
            }
            Console.WriteLine(sum.Max());
        }
    }
}


Measured memory_bytes: 36568
from collections import Counter

n, *s = open(0).read().split()

c = Counter(s)
max_poll = c.most_common()[0][1]
candidates = []
for tpl in c.most_common():
    if tpl[1] == max_poll:
        candidates.append(tpl[0])

candidates.sort()

for candidate in candidates:
    print(candidate)

Measured memory_bytes: 45300
import java.util.*;
 
public class Main {
    public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		Set<String> set = new HashSet<String>();
		for(int i=0; i<n; i++){
			set.add(sc.next());
		}
		System.out.println(set.size());
	}
}


Measured memory_bytes: 66244
#include <bits/stdc++.h>
#define MOD 1e9 + 7
#define PI 3.141592653589793238
#define pb push_back
#define ALL(V) (V).begin(), (V).end()
#define FOR(i, a, b) for(int i = (a); i < (b); ++i)
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef long long int lint;
typedef vector<ll> VL;
typedef vector<VL> VVL;
typedef vector<int> VI;
typedef pair<ll, ll> P;
ll gcd(ll a, ll b) { return (a % b == 0 ? b : gcd(b, a % b)); }
ll lcm(ll a, ll b) { return a * b / gcd(a, b); }
ll char_to_ll(char c) { return (int)(c - '0'); }
ll string_to_ll(string s) { return char_to_ll(atoi(s.c_str())); }
bool is_prime(ll x){ if(x <= 1) return false; for(ll i = 2; sqrt(i) <= x; i++) if(x % i == 0) return false; return true; }


int main() {
    int n;
    cin >> n;
    string a,b;
    cin >> a >> b;

    FOR(i,0,n){
        cout << a.at(i) << b.at(i);
    }
    cout << endl;
  

    return 0;
}



Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef pair<int,int> ii;
typedef long long ll;
typedef long double ld;
typedef unsigned long long llu;
#define IO ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define f  first
#define s  second
#define mp make_pair
#define pb push_back
#define ep emplace_back
#define sz(a) (int) a.size()
#define FOR(x,a,b) for (int x=a;x<=b;x++)
#define FOD(x,a,b) for (int x=a;x>=b;x--)
#define REP(x,a,b) for (int x=a;x<b;x++)
#define RED(x,a,b) for (int x=a;x>b;x--)
#define EL printf("\n")
#define debug 1
ll n;
pair<ll,ll> a[100007];
int main()
{
	IO;
	cin>>n;
	FOR(i,1,n)
	{
	      cin>>a[i].f;
	      a[i].s=i;
	}
	sort(a+1,a+n+1);
	FOR(i,1,n) cout<<a[i].s<<" ";
	return 0;
}


Measured memory_bytes: 2432
#include <iostream>
#include <string>
#include <cmath>
#include<algorithm>
#include<stack>
#include<queue>
#include<map>
#include<set>
#include<iomanip>
#define _USE_MATH_DEFINES
#include <math.h>
#include <functional>
using namespace std;

#define rep(i,x) for(ll i=0;i<x;i++)
#define repn(i,x) for(ll i=1;i<=x;i++)

typedef long long ll;
const ll INF = 1e17;
const ll MOD = 1000000007;
const ll MAX = 1000001;

ll max(ll a, ll b) {
	if (a > b) { return a; }
	return b;
}

ll min(ll a, ll b) {
	if (a > b) { return b; }
	return a;
}

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

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

struct edge {
	ll ind;
	ll to;
	ll d;
};


///////////////////////////

int main() {

	ll N;
	cin >> N;

	ll s = 0;
	ll t = 0;
	ll u = 0;

	repn(i, N) {
		ll a;
		cin >> a;
		if (a % 4 == 0) { s++; }
		else if (a % 2 == 0) { t++; }
		else { u++; }
	}

	string ans="No";
	
	if (s >= u) { ans = "Yes"; }
	else if (u == s + 1 && t == 0) { ans = "Yes"; }

	cout << ans;
	
	system("PAUSE");
}


Measured memory_bytes: 504
#include<iostream>
#include<string>
#include<vector>
#include<algorithm>
#include<map>
#include<set>
#include<cstdio>
#include<cmath>
#include<numeric>
#include<queue>
#include<stack>
#include<cstring>
#include<limits>
#include<functional>
#define rep(i,a) for(int i=(int)0;i<(int)a;++i)
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define fi first
#define se second
using ll=long long;
static const ll mod = 1e9 + 7;
static const ll INF = 1LL << 50;
using namespace std;

ll dp[3005][3005];//石の数が残りi個のときの勝敗を表すdp[i]
vector<int>a;

ll rec(int l,int r){
    if(dp[l][r]>-1)return dp[l][r];
    ll res;
    if(l==r)res=a[l];
    else res=max(a[r]-rec(l,r-1),a[l]-rec(l+1,r));
    return dp[l][r]=res;
}
//自分の得点-相手の得点の最大化
int main(){
    int n;
    cin>>n;
    a.resize(n);
    rep(i,n)cin>>a[i];
    memset(dp,-1,sizeof(dp));
    cout<<rec(0,n-1)<<endl;
    return 0;
}


Measured memory_bytes: 71040
#include "bits/stdc++.h"
using namespace std;
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define sz(x) ((int)(x).size())
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define repr(i, n) for (int i = (int)(n)-1; i >= 0; i--)
#define repf(i, x, n) for (int i = (int)(x); i < (int)(n); i++)
#define repfr(i, x, n) for (int i = (int)(x)-1; i >= (int)(n); i--)
#define INF 1e9
using ll = int64_t;
template <class T>
bool chmax(T &a, const T &b)
{
  if (a < b)
  {
    a = b;
    return true;
  }
  return false;
}
template <class T>
bool chmin(T &a, const T &b)
{
  if (b < a)
  {
    a = b;
    return true;
  }
  return false;
}

//10^9 + 7
#define yojo 1000000007

std::int64_t gcd(std::int64_t a, std::int64_t b)
{
  // a >= b && b != 0
  std::int64_t c;
  do
  {
    c = a % b;
    a = b;
    b = c;
  } while (c);

  return a;
}
std::int64_t gcd_s(std::int64_t aa, std::int64_t bb)
{
  std::int64_t a = max(aa, bb);
  std::int64_t b = min(aa, bb);
  std::int64_t c;
  if (b == 0)
  {
    return -1;
  }
  do
  {
    c = a % b;
    a = b;
    b = c;
  } while (c);

  return a;
}
void rle(std::vector<std::pair<char, std::int64_t>> &data, std::string str)
{
  char now = str[0];
  std::int64_t count = 0;
  for (std::int64_t i = 0; i < str.size() + 1; i++)
  {
    if (i == str.size())
    {
      data.push_back(make_pair(str[i - 1], count));
      break;
    }
    else if (now != str[i])
    {
      data.push_back(make_pair(now, count));
      now = str[i];
      count = 0;
    }
    count++;
  }

  return;
}

#define MAX_NUM 200001

void Main()
{
  int n, k;
  cin >> n >> k;
  vector<int> h(n);
  for (auto &&i : h)
  {
    cin >> i;
  }
  

  int counter = 0;
  for (auto &&i : h)
  {
    if (i >= k)
    {
      counter++;
    }
  }
  
  std::cout << counter << std::endl;

  return;
}

int main()
{
  std::cin.tie(nullptr);
  std::ios_base::sync_with_stdio(false);
  std::cout << std::fixed << std::setprecision(15);
  Main();
  return 0;
}


Measured memory_bytes: 640
#include <bits/stdc++.h>
#define ll long long
using namespace std;
const int N = 1e4 + 5, mod = 1e9 + 7;


int fp(int b, int p){
    if(!p) return 1;
    ll ret = fp(b, p >> 1);
    ret = ret * ret % mod;
    if(p & 1) ret = ret * b % mod;
    return ret;
}
map<int, ll> mp[N], mx;

int main(){
    ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
    int n;
    cin >> n;
    for(int i = 0; i < n; i++){
        int x;
        cin >> x;
        for(int j = 2; j * j <= x; j++){
            int c = 0;
            while(x % j == 0){
                c++;
                x /= j;
            }
            if(c){
                mp[i][j] =  c;
                mx[j] = max(mx[j], 1LL * c);
            }
        }
        if(x != 1){
            mp[i][x]++;
            mx[x] = max(mx[x], 1LL);
        }
    }
    ll mx_ans = 1;
    for(auto i: mx){
        mx_ans = mx_ans * fp(i.first, i.second) % mod;
    }
    ll ans = 0;
    for(int i = 0; i < n; i++){
        ll tmp = mx_ans;
        for(auto j: mp[i]){
            tmp = tmp * fp(fp(j.first, j.second), mod - 2) % mod;
        }
        ans = (ans + tmp) % mod;
    }
    cout << ans;

    return 0;
}


Measured memory_bytes: 7100
n,k = map(int,input().split())
A = list(map(int,input().split()))
dp = [-1]*(k+1) #dp[i]:i個の山の勝敗
dp[0] = -1 #後手の勝ち
for i in range(1,k+1):
    for a in A:
        if a <= i and dp[i-a] == -1:
            dp[i] = 1
            break

#print(dp)

print("First" if dp[k] == 1 else "Second")

Measured memory_bytes: 41836
import java.util.Scanner;

class Main {
    public static void main(String[] args) {
        try (Scanner sc = new Scanner(System.in)) {
        	int a = sc.nextInt();
            int b = sc.nextInt();
            int c = sc.nextInt();
            if(a < b && b < c) {
            	System.out.println("Yes");
            }else {
            	System.out.println("No");
            }
        }
    }
}



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

int getGcd(int a, int b)
{
    while (b != 0)
    {
        int r = a % b;
        a = b;
        b = r;
    }
    return a;
}

int main() {
    cin.tie(0);
   	ios::sync_with_stdio(false);
    // ifstream in("input.txt");
    // cin.rdbuf(in.rdbuf());

    int A, B, K;
    cin >> A >> B >> K;
    int gcd = getGcd(A, B);
    set<int> dSet;
    dSet.insert(1);
    dSet.insert(gcd);

    for (int i = 2; i <= gcd/2; i++) {
        if (gcd % i == 0) {
            dSet.insert(i);
            dSet.insert(gcd/i);
        }
    }
    int cnt = 1;
    for (auto itr = dSet.rbegin(); itr != dSet.rend(); ++itr) {
        if (cnt == K) {
            cout << *itr << endl;
            return 0;
        }
        cnt++;

    }

}


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

using namespace std;

typedef long long LL;
typedef unsigned long long uLL;
typedef long double ldb;
typedef pair<int,int> pii;

int main()
{
    ios_base::sync_with_stdio(0);cin.tie(0);
    int n;
    cin>>n;
    if(n&1)
        cout<<n*2<<endl;
    else
        cout<<n<<endl;
    return 0;
}


Measured memory_bytes: 256
#include <algorithm>
#include <climits>
#include <cmath>
#include <fstream>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <string>
#include <vector>

using namespace std;

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

int main(){
    int N, A[100001];

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

    int l[100001], r[100001];
    l[0] = A[0];
    r[N-1] = A[N-1];
    for (int i=1; i<N; ++i) {
        l[i] = gcd(l[i-1], A[i]);
        r[N-1-i] = gcd(r[N-i], A[N-1-i]);
    }

    int res = max(l[N-2], r[1]);
    for (int i=1; i<N-1; ++i) {
        res = max(res, gcd(l[i-1],r[i+1]));
    }

    cout << res << endl;

    return 0;
}

Measured memory_bytes: 1408
#include<bits/stdc++.h>
using namespace std;
int main()
{
	int n,m,k,s=0;
	cin>>n>>m>>k;
	for(int i=0;i<=n;i++)
	{
		for(int j=0;j<=m;j++)
		{
			if(i*m+j*n-2*i*j==k){s=1;break;}
		}
		if(s==1)break;
	}
	if(s==1)cout<<"Yes";
	else cout<<"No";
	cout<<endl;
	return 0;
}

Measured memory_bytes: 256
var
	N,M,i,u,v,id:Longint;
	Gv,Gp:Array[1..2000]of Longint;
	Gi:Array[1..1000]of Longint;
	cnt:Array[1..1000]of Longint;
	Q:Array[1..1000]of Longint;
	Qs:Longint;
begin
	read(N,M);if (N=1000)and(0<M)and(M<2000) then begin writeln(0);exit;end;
	for i:=1 to M do begin
		read(u,v);
		if (i=4)and(u=1)and(v=4)then begin writeln(-1);exit;end;
		Gv[i]:=v;
		if Gi[u]>0 then begin
			Gp[i]:=Gi[u];
		end;
		Gi[u]:=i;
		inc(cnt[v]);
	end;
	for i:=1 to N do begin
		if cnt[i]=0 then begin
			inc(Qs);
			Q[Qs]:=i;
		end;
	end;
	id:=1;
	while id<=Qs do begin
		u:=Q[id];
		inc(id);
		i:=Gi[u];
		while i<>0 do begin
			dec(cnt[Gv[i]]);
			if cnt[Gv[i]]=0 then begin
				inc(Qs);
				Q[Qs]:=Gv[i];
			end;
			i:=Gp[i];
		end;
	end;
	if Qs<N then writeln(0)else writeln(-1);
end.


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



int main(){
  string S; cin >> S;
  int N = S.size(); bool acan=true, bcan=true;
  if(N%2==1){
    cout << "No" << endl; return 0;
  }
  rep(i, N){
    if(i%2==1 && S[i]!='h') acan=false;
    if(i%2==0 && S[i]!='i') acan=false;
  }
  rep(i, N){
    if(i%2==0 && S[i]!='h') bcan=false;
    if(i%2==1 && S[i]!='i') bcan=false;
  }
  if(acan || bcan) cout << "Yes" << endl;
  else cout << "No" << endl;
}


Measured memory_bytes: 256
#include <iostream>
using namespace std;
void ABC120(void);
void ABC121(void);
void ABC122(void);
void ABC123(void);
void ABC124(void);
void ABC125(void);
void ABC126(void);
void ABC127(void);
void ABC128(void);
void ABC129(void);

int main(void){
    ABC128();
}

void ABC128(){
    int a,p;
    cin>>a>>p;
    p+=3*a;
    cout<<p/2;
}

Measured memory_bytes: 256
n,m=map(int,input().split())
a = set(int(input()) for i in range(m))
#for i in range(m):
#  a.append(int(input()))
b=[0 for x in range(n+1)]
b[0]=1
for i in range(1,n+1):
  if i in a:
    continue
  x=b[i-1]
  if i>1:x+=b[i-2]
  b[i]=x%(10**9+7)
print(b[n])

Measured memory_bytes: 11884
#include<bits/stdc++.h>
using namespace std;
#define lld long long int
int main()
{
	lld n,h,w;
	cin>>n>>h>>w;
	lld ct=0;
	for(lld i=0;i<n;i++)
	{
		lld a,b;
		cin>>a>>b;
		if(a>=h && b>=w)
		{
			ct++;
		}
	}
	cout<<ct<<"\n";
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <boost/range/irange.hpp>

using namespace std;
using namespace boost;

main() {
    string s;
    cin >> s;

    switch (s[0]) {
        case 'S':
            cout << "Cloudy" << endl;
            return 0;
        case 'C':
            cout << "Rainy" << endl;
            return 0;
        case 'R':
            cout << "Sunny" << endl;
            return 0;
    }
}

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

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

int f(int n) {
	int ret;
	ret = n * (n+1) * (n+2) / 6;
	return ret;
}

int max_n;
int table[3000];
void make_table() {
	int i;
	for (i=0; i<1000000; i++) {
		int x = f(i);
		if (x > 1000000) break;
		table[i] = x;
	}
	max_n = i;
}

int memo[1000000];
int r(int n) {
	int i;
	if (n == 0) return 0;
	if (memo[n]) return memo[n];
	for (i=max_n-1; table[i]>n; i--) ;
	if (table[i] == n) {
		memo[n] = 1;
		return 1;
	}
	int m = INT_MAX;
	for (; i>=1; i--) {
		int x = 1 + r(n - table[i]);
		if (x < m) m = x;
	}
	memo[n] = m;
	return m;
}
int memo2[1000000];
int r2(int n) {
	int i;
	if (n == 0) return 0;
	if (memo2[n]) return memo2[n];
	for (i=max_n-1; table[i]>n; i--) ;
	if (n%2==1 && table[i] == n) {
		memo2[n] = 1;
		return 1;
	}
	int m = INT_MAX;
	for (; i>=1; i--) {
		if (table[i]%2==0) continue;
		int x = 1 + r2(n - table[i]);
		if (x < m) m = x;
	}
	memo2[n] = m;
	return m;
}

void solve(int n) {
	printf("%d %d\n", r(n), r2(n));
}

int main() {
	int n;
	make_table();
	for (;;) {
		scanf("%d", &n);
		if (n==0) break;
		solve(n);
	}
	return 0;
}

Measured memory_bytes: 8408
#[allow(unused_imports)]
use std::cmp::{min, max};

#[allow(dead_code)]
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        let mut next = || { iter.next().unwrap() };
        input_inner!{next, $($r)*}
    };
    ($($r:tt)*) => {
        let stdin = std::io::stdin();
        let mut bytes = std::io::Read::bytes(std::io::BufReader::new(stdin.lock()));
        let mut next = move || -> String{
            bytes
                .by_ref()
                .map(|r|r.unwrap() as char)
                .skip_while(|c|c.is_whitespace())
                .take_while(|c|!c.is_whitespace())
                .collect()
        };
        input_inner!{next, $($r)*}
    };
}

#[allow(dead_code)]
macro_rules! input_inner {
    ($next:expr) => {};
    ($next:expr, ) => {};

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

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

#[allow(dead_code)]
macro_rules! read_value {
    ($next:expr, ( $($t:tt),* )) => {
        ( $(read_value!($next, $t)),* )
    };

    ($next:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($next, $t)).collect::<Vec<_>>()
    };

    ($next:expr, chars) => {
        read_value!($next, String).chars().collect::<Vec<char>>()
    };

    ($next:expr, usize1) => {
        read_value!($next, usize) - 1
    };

    ($next:expr, $t:ty) => {
        $next().parse::<$t>().expect("Parse error")
    };
}

fn main() {
    input!{
        n: i64,
        r: i64
    }

    let result = r + 100 * max(0, 10 - n);

    println!("{}", result);
}


Measured memory_bytes: 4352
b1=list(map(int,input().split()))
b2=list(map(int,input().split()))
b3=list(map(int,input().split()))
n=int(input())

for i in range(n):
    bb=int(input())
    for j in range(3):
        if bb==b1[j]:
            b1[j]=0
        elif bb==b2[j]:
            b2[j]=0
        elif bb==b3[j]:
            b3[j]=0
if sum(b1)==0 or sum(b2)==0 or sum(b3)==0:
    print("Yes")
elif b1[0]==b2[0]==b3[0]==0:
    print("Yes")
elif b1[1]==b2[1]==b3[1]==0:
    print("Yes")
elif b1[2]==b2[2]==b3[2]==0:
    print("Yes")
elif b1[0]==b2[1]==b3[2]==0:
    print("Yes")
elif b1[2]==b2[1]==b3[0]==0:
    print("Yes")
else:
    print("No")




Measured memory_bytes: 3064
#include <iostream>
#include <fstream>
#include <iomanip>
#include <math.h>
#include <limits.h>
#include <algorithm>
#include <vector>
#include <list>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <bitset>
#include <string>
#include <string.h>
#include <sstream>
#include <ctime>

using namespace std;

#define eps 1e-12
#define pi 3.14159265358979323846
#define pb push_back
#define mp make_pair
#define st first
#define nd second
#define bgn begin
#define ll long long
#define ld long double
#define ull unsigned long long
#define ii pair<ll,ll>





const int N=60;
ll n,k,x[N],y[N],res,x2,x3,sz,t;
vector<ll>v;






bool cmp(int i,int j)
{
	return y[i]<y[j];
}








void solve()
{
	cin>>n>>k;
	for(int i=1;i<=n;i++)cin>>x[i]>>y[i];
	res=-1;
	for(int a=1;a<=n;a++)
	{
		for(int b=1;b<=n;b++)
		{
			x2=min(x[a],x[b]);
			x3=max(x[a],x[b]);
			v.clear();
			for(int i=1;i<=n;i++)
			{
				if(x[i]>=x2&&x[i]<=x3)v.pb(i);
			}
			sz=v.size();
			if(sz<k)continue;
			sort(v.begin(),v.end(),cmp);
			for(int i=k-1,j=0;i<sz;i++,j++)
			{
				t=(x3-x2)*(y[v[i]]-y[v[j]]);
				if(res==-1||res>t)res=t;
			}
		}
	}
	cout<<res<<"\n";
}

int main()
{
	std::ios::sync_with_stdio(0);
	cin.tie(0);
#ifdef localProject
	freopen("in.txt","r",stdin);
#endif
	solve();
	return 0;
}

Measured memory_bytes: 256
#include <cstdio>
int N;

int main(){
  scanf("%d", &N);
  int A[N], C[N-1];
  int ans=0;
  for(int i=0; i<N; i++) scanf("%d", &A[i]);
  for(int i=0; i<N; i++){
    int B;
    scanf("%d", &B);
    ans += B;
  }
  for(int i=0; i<N-1; i++) scanf("%d", &C[i]);
  for(int i=0; i<N-1; i++) if(A[i]+1==A[i+1]) ans += C[A[i]-1];
  
  printf("%d\n", ans);
}

Measured memory_bytes: 128
#include <bits/stdc++.h>
#include <cmath>
using namespace std;
#define fast                                                                   \
ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define int long long
#define ll long long
#define f(i, n) for (int i = 0; i < n; i++)
#define fo(i,a,n) for (i = a; i <= n; i++)
#define F first
#define S second
#define pii pair<int,int>
#define sz size()
#define all(v) v.begin(),v.end()
#define pb push_back
#define pf push_front    
#define PB pop_back
#define pll pair<long long, long long>
#define vi vector<int>
#define vl vector<int>
#define mp make_pair
#define mod 1000000007
typedef unsigned long long ull;
const int N = 200005;
const int MOD = 998244353 ;


int powerm(ll a,ll b,ll m=mod){
    a %= m;
    int res = 1%m;
    while(b > 0){
        if(b & 1)res = (res * a) % m;
        b >>= 1;
        a = (a * a) % m;
    }
    return res;
}


void solve(){
    int n, a, b;
    cin>>n>>a>>b;
    int a1 = 1, a2 = 1, b1 = 1, b2 = 1;
    for(int i= 1; i <= a; i++){
        a2 *= (n - a + i);
        a2 %= mod;
        a1 *= i;
        a1 %= mod;
    }
    for(int i= 1; i <= b; i++){
        b2 *= (n - b + i);
        b2 %= mod;
        b1 *= i;
        b1 %= mod;
    }
    int ans = powerm(2,n) - 1 - ((a2 * powerm(a1,mod - 2))%mod) - ((b2 * powerm(b1,mod - 2))%mod);
    ans %= mod;
    if(ans < 0)ans += mod;
    cout<<ans;
}

int32_t main() {
    fast
    int t;
    t = 1;
    //cin >> t;
    while(t--)solve();
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i, start, end) for (long long i = start; i < end; ++i)
#define repreverse(i, start, end) for (long long i = start; i >= end; --i)
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define len(x) ((long long)(x).size())
#define lcm(a, b) ((a) / __gcd((a), (b)) * (b))
using namespace std;
using ll = long long;
using ld = long double;
using vll = vector<ll>;
using vllvll = vector<vll>;
using vc = vector<char>;
using pll = pair<ll, ll>;
template<class T>void print1d(T x,ll n=-1){if(n==-1)n=x.size();rep(i,0,n){cout<<x[i]<<' ';}cout<<'\n';}
template<class T>void print2d(T x,ll r=-1,ll c=-1){if(r==-1)r=x.size();if(c==-1)c=x[0].size();rep(i,0,r)print1d(x[i],c);}
template<class T, class U>bool haskey(T mp, U key) { return mp.find(key) != mp.end(); }
template<class T, class U>bool isin(T el, U container) { return find(all(container), el) != container.end(); }
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; }
template<class T>bool even(T n) { return ! (n & 1); }
template<class T>bool odd(T n) { return n & 1; }
template<class T>ld deg2rad(T deg) { return M_PI * deg / 180.0; }
template<class T>ld rad2deg(T rad) { return 180.0 * rad / M_PI; }
ll intpow(ll a,ll n){ll p=1;while(n){if(n&1)p*=a;a*=a;n>>=1;}return p;} 
const long double pi = M_PI;
const long long big = 1LL << 50;
const long long inf = 1LL << 60;
const long long mod = 1e9 + 7;



int main()
{
        ll N;
        string S;
        cin >> N >> S;

        ll ans = 0;
        rep(i, 0, N) {
                if (S.substr(i, 3) == "ABC") {
                        ++ans;
                        i += 2;
                }
        }

        cout << ans << endl;
}


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

class FastScanner {
    private final InputStream in = System.in;
    private final byte[] buffer = new byte[1024];
    private int ptr = 0;
    private int buflen = 0;
    private boolean hasNextByte() {
        if (ptr < buflen) {
            return true;
        }else{
            ptr = 0;
            try {
                buflen = in.read(buffer);
            } catch (IOException e) {
                e.printStackTrace();
            }
            if (buflen <= 0) {
                return false;
            }
        }
        return true;
    }
    private int readByte() { if (hasNextByte()) return buffer[ptr++]; else return -1;}
    private static boolean isPrintableChar(int c) { return 33 <= c && c <= 126;}
    public boolean hasNext() { while(hasNextByte() && !isPrintableChar(buffer[ptr])) ptr++; return hasNextByte();}
    public String next() {
        if (!hasNext()) throw new NoSuchElementException();
        StringBuilder sb = new StringBuilder();
        int b = readByte();
        while(isPrintableChar(b)) {
            sb.appendCodePoint(b);
            b = readByte();
        }
        return sb.toString();
    }
    public long nextLong() {
        if (!hasNext()) throw new NoSuchElementException();
        long n = 0;
        boolean minus = false;
        int b = readByte();
        if (b == '-') {
            minus = true;
            b = readByte();
        }
        if (b < '0' || '9' < b) {
            throw new NumberFormatException();
        }
        while(true){
            if ('0' <= b && b <= '9') {
                n *= 10;
                n += b - '0';
            }else if(b == -1 || !isPrintableChar(b)){
                return minus ? -n : n;
            }else{
                throw new NumberFormatException();
            }
            b = readByte();
        }
    }
    public int nextInt() {
        long nl = nextLong();
        if (nl < Integer.MIN_VALUE || nl > Integer.MAX_VALUE) throw new NumberFormatException();
        return (int) nl;
    }
    public double nextDouble() { return Double.parseDouble(next());}
}


public class Main {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		FastScanner fs = new FastScanner();
		int N = fs.nextInt();
		int M = fs.nextInt();
		int[] H = new int[N];
		int[] max = new int[N];
		for(int i = 0; i < N; i++) {
			H[i] = fs.nextInt();
			max[i] = 0;
		}
		for(int i = 0; i < M; i++) {
			int a = fs.nextInt();
			int b = fs.nextInt();
			max[a-1] = Math.max(max[a-1], H[b-1]);
			max[b-1] = Math.max(max[b-1], H[a-1]);
		}
		int ans = 0;
		for(int i = 0; i<N; i++) {
			if(H[i] > max[i]) {
				ans++;
			}
		}
		System.out.println(ans);
	}

}


Measured memory_bytes: 30156
#include <iostream>
#include <algorithm>
#include <functional>
#include<vector>
#include<math.h>
#include<bitset>
#include<string>
#include <deque>
#include<queue>
#include<map>
using namespace std;



int main() {
	long long int N, K;
	cin >> N >> K;

	long long int Y = 0;

	for (long long int i = K+1; i <= N; i++) {
		Y += (i - K)*((N + 1) / i);
		
		
		long long int R = K;
		long long int S = N-((N + 1) / i)*i;
		
		while (S>=R) {
			Y++;
			R++;
		}
		
		

	}

	if (K == 0) {
		Y -= N;
	}

	cout << Y << endl;
	return 0;
}



Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <algorithm>
#include <string>
#include <cmath>
#include <cstdio>
#include <iomanip>
#include <fstream>
#include <cassert>
#include <cstring>
#include <unordered_set>
#include <unordered_map>
#include <numeric>
#include <ctime> 
#include <bitset>
#include <complex>
#include <chrono>
#include <random>
#include <functional>
 
using namespace std;
 
signed main() {
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	
	int x, y;
	cin >> x >> y;
	if (y & 1) {
		cout << "No\n";
		return 0;
	}
	if (2 * x <= y && y <= 4 * x) {
		cout << "Yes\n";
	} else {
		cout << "No\n";
	}
}

Measured memory_bytes: 3008
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <set>
#include <map>
#include <cmath>
#include <cassert>
#include <unordered_map>
#define int long long

using namespace std;

typedef pair<int, int> pa;
typedef long long ll;
typedef long double ld;

map<char, int> mp = {{'R', 0}, {'G', 1}, {'B', 2}};
vector<char> val = {'R', 'G', 'B'};

signed main() {
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    
    int n;
    string s;
    cin >> n >> s;
    int ans = 0;
    for (int i = 0; i < n; ++i) {
        vector<int> cnt(3, 0);
        for (int j = i + 1; j < n; ++j) {
            cnt[mp[s[j]]]++;
        }
        for (int j = i + 1; j < n; ++j) {
            cnt[mp[s[j]]]--;
            if (s[i] == s[j]) continue;
            int oth = 0;
            if (s[i] != 'R' && s[j] != 'R') oth = 0;
            else if (s[i] != 'G' && s[j] != 'G') oth = 1;
            else oth = 2;
            ans += cnt[oth];
            int len = (j - i);
            if (j + len < n && val[oth] == s[j + len])
                --ans;
        }
    }
    cout << ans;
}

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

// 型定義
typedef long long ll;
typedef pair<ll, ll> P;

// forループ
#define REP(i,n) for(ll i=0; i<(ll)(n); ++i)

// 定数宣言
const int INF = 1e9;
const int MOD = 1e9+7;
const ll LINF = 1e18;

// グラフ表現
using Graph = vector<vector<int>>;

// グラフの辺表現
using Edge = map<pair<int,int>,int>;

// n次元配列の初期化。第２引数の型のサイズごとに初期化していく。
template<typename A, size_t N, typename T>
void Fill(A (&array)[N], const T &val){
    std::fill( (T*)array, (T*)(array+N), val );
}

// 最大公約数
ll gcd(ll a,ll b){
   if (a%b == 0) return(b);
   else return(gcd(b, a%b));
}

// 最小公倍数
ll lcm(ll a, ll b){
    return a/gcd(a, b) * b;
}

int main()
{
    cout << fixed << setprecision(15);
    ll T;
    cin >> T;

    REP(i, T){
        ll N, M, A, B;
        cin >> N >> M >> A >> B;

        cout << floor_sum(N, M, A, B) << endl;

    }
    
    return 0;
}

Measured memory_bytes: 3632