akhauriyash/Code-Regression huggingface dataset:
#!/usr/bin/env python3
import sys

YES = "Yes"  # type: str
NO = "No"  # type: str


def inRange(h: int, w: int, H: int, W: int):
    return h >= 0 and w >= 0 and h < H and w < W


def solve(H: int, W: int, s: "List[str]"):
    failed = False
    for h in range(H):
        for w in range(W):
            cur = s[h][w]
            if cur == "#":
                if inRange(h-1, w, H, W) and s[h-1][w] == "#":
                    continue
                if inRange(h+1, w, H, W) and s[h+1][w] == "#":
                    continue
                if inRange(h, w-1, H, W) and s[h][w-1] == "#":
                    continue
                if inRange(h, w+1, H, W) and s[h][w+1] == "#":
                    continue
                failed = True
                break
        if failed:
            break
    print("No") if failed else print("Yes")
    return


# Generated by 1.1.4 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    H = int(next(tokens))  # type: int
    W = int(next(tokens))  # type: int
    s = [next(tokens) for _ in range(H)]  # type: "List[str]"
    solve(H, W, s)


if __name__ == '__main__':
    main()


Measured memory_bytes: 3064
#include <bits/stdc++.h>
#define all(x) (x).begin(), (x).end()
using namespace std;
using i64 = int64_t;
using point = pair<int, int>;

int32_t main()
{
    int n, m;
    cin >> n >> m;
    vector<int> a(m);
    for (auto&& i : a) {
        cin >> i;
    }

    int sum = accumulate(all(a), 0);

    cout << (sum > n ? -1 : n - sum) << endl;
}


Measured memory_bytes: 3668
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp> 
#include <ext/pb_ds/tree_policy.hpp> 
using namespace __gnu_pbds;
using namespace std;
typedef tree<pair<int,int>,null_type,less<pair<int,int>>,rb_tree_tag,tree_order_statistics_node_update> oset;
#define sim template < class c
#define ris return * this
#define dor > debug & operator <<
#define eni(x) sim > typename \
  enable_if<sizeof dud<c>(0) x 1, debug&>::type operator<<(c i) {
sim > struct rge { c b, e; };
sim > rge<c> range(c i, c j) { return rge<c>{i, j}; }
sim > auto dud(c* x) -> decltype(cerr << *x, 0);
sim > char dud(...);
struct debug {
#ifdef LOCAL
~debug() { cerr << endl; }
eni(!=) cerr << boolalpha << i; ris; }
eni(==) ris << range(begin(i), end(i)); }
sim, class b dor(pair < b, c > d) {
  ris << "(" << d.first << ", " << d.second << ")";
}
sim dor(rge<c> d) {
  *this << "[";
  for (auto it = d.b; it != d.e; ++it)
	*this << ", " + 2 * (it == d.b) << *it;
  ris << "]";
}
#else
sim dor(const c&) { ris; }
#endif
};
#define imie(...) " [" << #__VA_ARGS__ ": " << (__VA_ARGS__) << "] "
using ll = long long;
#define ar array 

const int nax = 2e5;
bool vis[nax];
int n , m , ans = 0 , s = 0;
vector<int> edges[nax];

void dfs(int u){
	s++;
	vis[u] = 1;
	for(auto x : edges[u])
		if(!vis[x])
			dfs(x);
		}


void test_case() {
	cin >> n >> m;
	for(int i = 0 ; i < m ; i++){
		int a , b;
		cin >> a >> b;
		a-- , b-- ;
		edges[a].push_back(b);
		edges[b].push_back(a);
	}
	for(int i = 0 ; i < n ; i++)
		if(!vis[i])
			s=0,dfs(i),ans=max(ans,s);
	cout<<ans;
}
 
int main() {
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cout.tie(NULL);
	int T = 1;
	//~ cin >> T;
	while(T--){
		test_case();
	}
}


Measured memory_bytes: 20908
#define _USE_MATH_DEFINES
#include <bits/stdc++.h>
#define dump(x) cout << x << endl
typedef int64_t Int;

using namespace std;
using Graph = vector<vector<Int>>;

const double pi = M_PI;
const Int MOD = 1000000007;

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

    auto itr = unique(s.begin(), s.end());
    s.erase(itr, s.end());

    cout << s.size() << endl;

    return 0;
}

Measured memory_bytes: 512
#include<stdio.h>
#include<math.h>
#include<algorithm>
#include<queue>
#include<deque>
#include<string>
#include<string.h>
#include<vector>
#include<set>
#include<map>
#include<bitset>
#include<stdlib.h>
#include<cassert>
using namespace std;
const long long mod=1000000007;
const long long inf=mod*mod;
const long long d2=500000004;
const double EPS=1e-6;
const double PI=acos(-1.0);
int ABS(int a){return max(a,-a);}
long long ABS(long long a){return max(a,-a);}
int main(){
	int a,b,c;scanf("%d%d%d",&a,&b,&c);
	int ret=0;
	for(int i=1;i<=a;i++){
		int tmp=0;
		int d=i;
		while(d){
			tmp+=d%10;d/=10;
		}
		if(b<=tmp&&tmp<=c)ret+=i;
	}
	printf("%d\n",ret);
}

Measured memory_bytes: 128
#include <iostream>
#include <stdio.h>
using namespace std;

void trace(int [], int );

void insertionSort(int A[], int N) {
    int i, j, v;
    for (i = 1; i != N; ++i) {
        v = A[i];
        j = i - 1;
        while (j >= 0 && A[j] > v) {
            A[j + 1] = A[j];
            --j;
        }
        A[j + 1] = v;
        trace(A, N);
    }
}

void trace(int A[], int N) {
    int i = 0;
    while (i < N) {
        if (i > 0) {
            printf(" ");
        }
        printf("%d", A[i]);
        ++i;
    }
    cout << endl;
}

int main() {
    int N, i, j;
    int A[100];
    
    std::cin >> N;
    for (i = 0; i < N; ++i ) {
        scanf("%d", &A[i]);
        
    }
    trace(A, N);
    insertionSort(A, N);
    return 0;
}


Measured memory_bytes: 3232
import math
#import numpy as np
import queue
from collections import deque,defaultdict
import heapq as hpq
from sys import stdin,setrecursionlimit
#from scipy.sparse.csgraph import dijkstra
#from scipy.sparse import csr_matrix
ipt = stdin.readline
setrecursionlimit(10**7)

def main():
    n,m,v,p = map(int,ipt().split())
    a = [int(i) for i in ipt().split()]
    a.sort(reverse=True)
    l = p
    r = n
    while l < r:
        mid = l + (r-l)//2
        tp = a[mid]+m
        if a[p-1] > tp:
            r = mid
        else:
            if p+n-mid-1 >= v:
                l = mid+1
            else:
                res = v+mid+1-n-p
                cos = 0
                for i in range(p-1,mid):
                    cos += tp-a[i]
                if cos >= res*m:
                    l = mid+1
                else:
                    r = mid
    print(l)

    return

if __name__ == '__main__':
    main()


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

using namespace std;

int main() {
	int N, K;
	string S, ans = "";
	cin >> N >> K;
	cin >> S;

	for (int i = 0; i < N; i++) {
		if (i == K - 1) {
			ans += tolower(S[i]);
		}
		else {
			ans += S[i];
		}
	}

	cout << ans << endl;
}

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

//g++ -g -o yourexe yourfile.cpp
//./yourexe < yourinput.in > youroutput.out

#define fast ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);

#define M 201

#define ll long long
#define ld long double
#define vi vector<ll>
#define pi pair<ll, ll>
#define vii vector<pi>
#define vvi vector<vi>
#define pb push_back
#define endl "\n"

#define REP(i, s, e) for (ll i = s; i < e; i++)
#define RREP(i, s, e) for (ll i = s; i > e; i--)

#define all(v) v.begin(), v.end()
#define print(v) for (auto i: v) cout << i << " ";

ll n, k;
vii arr;

bool poss(ll m) {
    ll s = 0, x;
    REP(i, 0, n) {
        if (arr[i].first < m)
            continue;
        x = (m/arr[i].second)*arr[i].second;
        s += (arr[i].first - x)/arr[i].second;
    }
    if (s <= k)
        return true;
    return false;
}

int main() {
    fast
    cin >> n >> k;
    vi a(n), f(n);
    REP(i, 0, n)
        cin >> a[i];
    REP(i, 0, n)
        cin >> f[i];
    sort(all(a));
    sort(all(f), greater<ll>());
    REP(i, 0, n)
        arr.pb({a[i]*f[i], f[i]});
    sort(all(arr));
    ll l = 0, h = arr[n-1].first, mid = (l+h)/2;
    while (l < h) {
        if (poss(mid))
            h = mid;
        else
            l = mid + 1;
        mid = (l + h)/2;
    }
    cout << l << endl;
}


Measured memory_bytes: 9328
#include <algorithm> // min, max, swap, sort, reverse, lower_bound, upper_bound
#include <bitset>    // bitset
#include <deque>     // deque
#include <iomanip>   //setprecsion
#include <iostream>  // cout, endl, cin
#include <map>       // map
#include <queue>     // queue, priority_queue
#include <set>       // set
#include <stack>     // stack
#include <string>    // string, to_string, stoi
#include <tuple>     // tuple, make_tuple
#include <utility>   // pair, make_pair
#include <vector>    // vector

#include <cctype> // isupper, islower, isdigit, toupper, tolower
#include <cmath>  //sin, cos, tan

using namespace std;
using Graph = vector<vector<int>>;

#define rep(i, n) for (ll i = 0; i < (n); ++i)
#define rrep(i, n) for (ll i = (n - 1); i >= 0; --i)
#define blank(ans) cout << (ans) << " ";
#define mp(p, q) make_pair(p, q)
#define mt(p, q, r) make_tuple(p, q, r)
#define pb(n) push_back(n)
#define all(a) a.begin(), a.end()

typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef string str;

typedef vector<ll> vll;
typedef vector<ld> vd;
typedef vector<bool> vb;
typedef vector<char> vc;
typedef vector<str> vs;
typedef vector<vector<ll>> vvll;
typedef vector<vector<ld>> vvd;
typedef vector<vector<bool>> vvb;
typedef vector<vector<char>> vvc;
typedef vector<vector<str>> vvs;
typedef vector<pair<ll, ll>> vpll;
typedef vector<tuple<ll, ll, ll>> vtlll;

const ld PI = acos(-1.0);
const ll MAX = 9000000000000000000;
const ll MIN = -9000000000000000000;
const ld DMAX = 4500;
const ld DMIN = -4500;
const ll MOD = 1000000007;

template <typename T>
void fin(T a)
{
  cout << a << endl;
  exit(0);
}

void Main()
{
  ll n; cin >> n;
  vs s(n); rep(i, n) cin >> s[i];
  vll flag(26, MAX);
  rep(i, n)
  {
    map <char, ll> M;
    rep(j, s[i].size()) M[s[i][j]]++;
    rep(j, 26)
    {
      //cout << M[(char)('a' + j)];
      flag[j] = min(M[(char)('a' + j)], flag[j]);
    }
    //cout << endl;
  }
  rep(i, 26)
  {
    rep(j, flag[i])
    {
      cout << (char)('a' + i);
    }
  }
  fin("");
}

//前処理
int main()
{
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout << fixed << setprecision(20); //高精度少数表示
  //cout << setfill('0') << internal << setw(4); 0埋め４桁
  Main();
  return 0;
}


Measured memory_bytes: 256
n, m = map(int, input().split())
h = list(map(int, input().split()))
ab = [list(map(int, input().split())) for i in range(m)]
ans = [1]*n
for i in range(m):
  if h[ab[i][0]-1] < h[ab[i][1]-1]: ans[ab[i][0]-1] = 0
  elif h[ab[i][0]-1] > h[ab[i][1]-1]: ans[ab[i][1]-1] = 0
  else: ans[ab[i][0]-1] = ans[ab[i][1]-1] =0
print(ans.count(1))

Measured memory_bytes: 31900
N, A, B = gets.chomp.split.map(&:to_i)
S = gets.chomp.split('')
d, o = 0, 0
S.each do |s|
  if s == 'a' && d + o < A + B
    puts 'Yes'
    d += 1
  elsif s == 'b' && d + o < A + B && o < B
    puts 'Yes'
    o += 1
  else
    puts 'No'
  end
end


Measured memory_bytes: 9852
mod = 998244353


n = int(input())
D = list(map(int, input().split()))

if D[0] != 0:
    print(0)
    exit()

CNT = [0] * n
for d in D:
    CNT[d] += 1

if CNT[0] >= 2:
    print(0)
    exit()

ans = 1
for i in range(1, n):
    ans *= pow(CNT[i - 1], CNT[i], mod)
    ans %= mod

print(ans)


Measured memory_bytes: 14020
MOD = 10**9 + 7
l, r = map(int, input().split())

def func(x, y):
	if y == 0:
		return 1
	dp = [[0 for _ in range(6)] for _ in range(61)]
	dp[60][0] = 1
	for i in range(59, -1, -1):
		if (y>>i) & 1 == 0 and (x>>i) & 1 == 0:
			dp[i][0] = dp[i+1][0]
			dp[i][1] = dp[i+1][1]
			dp[i][2] = dp[i+1][2]
			dp[i][3] = (dp[i+1][3]*2) % MOD
			dp[i][4] = dp[i+1][4]
			dp[i][5] = (dp[i+1][1] + dp[i+1][3] + dp[i+1][5]*3) % MOD
		elif (y>>i) & 1 == 1 and (x>>i) & 1 == 1:
			dp[i][0] = 0
			dp[i][1] = 0
			dp[i][2] = (dp[i+1][0] + dp[i+1][2]) % MOD
			dp[i][3] = (dp[i+1][1] + dp[i+1][3]) % MOD
			dp[i][4] = (dp[i+1][4]*2) % MOD
			dp[i][5] = (dp[i+1][4] + dp[i+1][5]*3) % MOD
		elif (y>>i) & 1 == 1 and (x>>i) & 1 == 0:
			dp[i][0] = 0
			dp[i][1] = (dp[i+1][0] + dp[i+1][1]) % MOD
			dp[i][2] = dp[i+1][2]
			dp[i][3] = (dp[i+1][2] + dp[i+1][3]*2) % MOD
			dp[i][4] = (dp[i+1][0] + dp[i+1][2] + dp[i+1][4]*2) % MOD
			dp[i][5] = (dp[i+1][1] + dp[i+1][3] + dp[i+1][4] + dp[i+1][5]*3) % MOD
		elif (y>>i) & 1 == 0 and (x>>i) & 1 == 1:
			dp[i][0] = 0
			dp[i][1] = 0
			dp[i][2] = 0
			dp[i][3] = (dp[i+1][1] + dp[i+1][3]) % MOD
			dp[i][4] = dp[i+1][4]
			dp[i][5] = (dp[i+1][5]*3) % MOD

	return (sum(dp[0]))%MOD

print(func(l, r))

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

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

typedef long long ll;

const int INF = 1 << 30;
const ll LLINF = 1LL << 62;

int mod = 1000000007;

int main(void){
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    string S; cin >> S;
    cout << S[0] << S[1] << S[2] << endl;
    return 0;
}

Measured memory_bytes: 3636
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <set>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define reps(i, s, n) for (int i = s; i < (int)(n); i++)
#define out(x) cout << x << endl
#define INF 1000000;
#include <map>
#include <math.h>
 
using ll = long long;
using namespace std;

ll n, k;
const ll mod = 1000000007;



int main(){
    int a, b;
    cin >> a >> b;
    int count=0, push = max(a, b), no_push=min(a, b);
    count+= push;
    count+=max(no_push, push-1);
    out(count);

}

Measured memory_bytes: 384
import heapq
# dijkstra
# edges = |V|のリスト
# 頂点iから頂点jにコストwで移動可能な場合：edges[i] = [(j, w)]

def dijkstra(n, edges, start):
    INF = float('inf')
    vertices = [INF] * n # 初期化
    vertices[start] = 0 # スタートの距離はゼロ
    hq = [(0, start)]
    heapq.heapify(hq)

    while hq:
        cost, v = heapq.heappop(hq)
        
        for to, w in edges[v]:
            if cost + w >= vertices[to]:
                continue
            vertices[to] = cost + w
            heapq.heappush(hq, (vertices[to], to))
    
    return vertices

# input
n, m, s, t = map(int, input().split())
G = [list(map(int, input().split())) for _ in range(m)]
INF = float('inf')


G_yen = [[] for _ in range(n)]
G_snu = [[] for _ in range(n)]

s, t = s - 1, t - 1

for u, v, a, b in G:
    G_yen[u - 1].append((v - 1, a))
    G_yen[v - 1].append((u - 1, a))
    G_snu[u - 1].append((v - 1, b))
    G_snu[v - 1].append((u - 1, b))

yen = dijkstra(n, G_yen, s)
snu = dijkstra(n, G_snu, t)

ans = [INF]

for i in reversed(range(n)):
    tmp = snu[i] + yen[i]
    ans.append(min(ans[-1], tmp))

for i in reversed(ans[1:]):
    print(10 ** 15 - i)

Measured memory_bytes: 107624
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); i++)
#define rep1(i, n) for (int i = 1; i <= (n); i++)
using namespace std;
typedef long long ll;
typedef pair<ll, ll> P;

const char wall = '#';
vector<vector<char>> fields;
vector<vector<bool>> used;
vector<vector<ll>> dist;
const int dx[4] = {0, -1, 0, 1};
const int dy[4] = {1, 0, -1, 0};

vector<ll> A;
// vectorのリサイズ
// A.resize(N);

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

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

  ll n;
  cin >> n;
  vector<ll> p(n);
  rep(i, n) cin >> p[i];
  ll ans = 0;
  ll tmp_min = p[0];
  rep(i, n) {
    tmp_min = min(tmp_min, p[i]);
    if (tmp_min == p[i]) {
     ans++;
    }
  }
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 1792
#include<bits/stdc++.h>
using namespace std;
#define N 100000 + 5
#define Mod 1000000007
#define rep(i, l, r) for(int i = l; i <= r; ++i)
bool cir[N];
int n, ans, a[N], f[N], p[N], in[N], deg[N], vis[N], sum[N], inv[N], invp[N];
int read(){
    char c; int x = 0, f = 1;
    c = getchar();
    while(c > '9' || c < '0'){ if(c == '-') f = -1; c = getchar();}
    while(c >= '0' && c <= '9') x = x * 10 + c - '0', c = getchar();
    return x * f;
}
int Inc(int a, int b){ return (a += b) >= Mod ? a - Mod : a;}
int Mul(int a, int b){ return 1ll * a * b % Mod;}
int Qpow(int a, int b){
    int ans = 1;
    while(b){
        if(b & 1) ans = Mul(ans, a);
        a = Mul(a, a), b >>= 1;
    }
    return ans;
}
int C(int n, int m){
    if(m > n) return 0;
    return Mul(f[n], Mul(inv[m], inv[n - m]));
}
void solve(int p){
    int x = p, fi = 0, fl = 0, last = 0, llen = 0, now = 0, nlen = 0, cnt = 0;
    while(cir[x]){
        cir[x] = false, cnt++; if(!in[x]){ x = a[x]; continue;}
        if(!last) last = fi = cnt, llen = fl = in[x];
        else{
            if(!now) now = cnt, nlen = in[x];
            else last = now, llen = nlen, now = cnt, nlen = in[x];
            if(cnt - nlen < last) ans = 0;
            if(cnt - nlen > last) ans = Mul(ans, 2); 
        }
        x = a[x];
    }
    if(!fi) sum[cnt]++;
    else{
        if(!now) now = fi;
        int len = cnt - (now - fi);
        if(len < fl) ans = 0;
        if(len > fl) ans = Mul(ans, 2);
    }
}
int main(){
    n = read();
    rep(i, 1, n) a[i] = read(), deg[a[i]]++;
    f[0] = inv[0] = p[0] = invp[0] = 1;
    rep(i, 1, n){
        f[i] = Mul(f[i - 1], i), inv[i] = Qpow(f[i], Mod - 2);
        p[i] = Mul(p[i - 1], 2), invp[i] = Qpow(p[i], Mod - 2);
    }
    rep(i, 1, n) if(!vis[i]){
        int x = i;
        while(!vis[x]) vis[x] = i, x = a[x];
        if(vis[x] == i) while(!cir[x]) cir[x] = true, x = a[x];
    }
    rep(i, 1, n) if((cir[i] && deg[i] >= 3) || (!cir[i] && deg[i] >= 2)){ puts("0"); return 0;}
    rep(i, 1, n) if(!deg[i]){
        int x = i, cnt = 0;
        while(!cir[x]) x = a[x], cnt++;
        in[x] = cnt;
    }
    ans = 1;
    rep(i, 1, n) if(cir[i]) solve(i);
    rep(i, 1, n) if(sum[i]){
        int res = 0;
        rep(j, 0, sum[i] / 2){
            int cnt = 0;
            cnt = C(sum[i], 2 * j);
            cnt = Mul(cnt, C(2 * j, j));
            cnt = Mul(cnt, f[j]);
            cnt = Mul(cnt, invp[j]);
            cnt = Mul(cnt, Qpow(i, j));
            if((i & 1) && i != 1) cnt = Mul(cnt, p[sum[i] - 2 * j]);
            res = Inc(res, cnt);
        }
        ans = Mul(ans, res);
    }
    printf("%d", ans);
    return 0;
}

Measured memory_bytes: 3456
WIN = "0"
LOSE = "1"

while True:

    input_count = int(input())

    if input_count == 0:
        break

    input_list = [input().split(" ") for _ in range(input_count)]

    count_list = [(item[0], item.count(WIN), item.count(LOSE)) for item in input_list]
    count_list.sort(key=lambda item: (-item[1], item[2]))

    output = [item[0] for item in count_list]
    print("\n".join(output))



Measured memory_bytes: 5616
using System;

namespace ABC135
{
    class Program
    {
        static int Main(string[] args)
        {
            problemB();
            return 0;
        }

        static void problemB()
        {
            string Nstr = Console.ReadLine();
            string[] input = Console.ReadLine().Split(' ');

            int N = int.Parse(Nstr);
            int[] pArray = new int[N];
            for(int i = 0; i < N; i++)
            {
                pArray[i] = int.Parse(input[i]);
            }

            int ans = 0;

            for(int i = 0; i < N; i++)
            {
                if(i + 1 != pArray[i])
                {
                    ans += 1;
                }               
            }

            if(ans > 2)
            {
                Console.WriteLine("NO");
            }
            else
            {
                Console.WriteLine("YES");
            }
        }
    }
}

Measured memory_bytes: 13140
#include<bits/stdc++.h>
#define _GLIBCXX_DEBUG
#define rep(i,n) for (int i = 0; i < (int)(n); i++)
#define all(v) v.begin(),v.end()
#define puts(i) cout << i << endl
#define INF INT_MAX
#define INFL LLONG_MAX
typedef long long ll;
using namespace std;


int main(){
  ll w,h,n;
  cin >> w >> h >> n;

  std::vector<int> x(n);
  std::vector<int> y(n);
  int a;
  ll light=0,right=w,botom=0,top=h;
  rep(i,n){
    cin >> x.at(i) >> y.at(i) >> a;
    if(a==1){
      if(light<x.at(i)){
      light=x.at(i);
      }
    }
    if(a==2){
      if(right>x.at(i)){
      right=x.at(i);
      }
    }
    if(a==3){
      if(botom<y.at(i)){
        botom=y.at(i);
      }
    }
    if(a==4){
      if(top>y.at(i)){
        top=y.at(i);
      }
    }
  }

  int ans,W,H;
  W=right-light;
  H=top-botom;
 if(top<=botom || right<=light){
    W=0; H=0;
  }

  ans=W*H;


  cout << ans << endl;


  }

Measured memory_bytes: 3624
#include<map>
#include<iostream>
#include<deque>
#include<algorithm>
#include<string>
#include<cctype>
#include<iomanip>
#include<vector>
#include<queue>
#include<math.h>
#include<bitset>
#include<random>
using namespace std;
using ll = long long;
using lll = __int128_t;
typedef pair<ll,ll> P;
#define REP(i,b,e) for(ll i=(ll)b;i<(ll)e;i++)
#define rep0(i,n) REP(i,0ll,n)
#define rep1(i,n) REP(i,1ll,n+1)
const ll longinf=1ll<<60;
const int inf=(1<<30)-1;
const ll mod=1e9+7;



int main(){
      ll n,k;
      cin>>n>>k;
      ll a[n];
      rep0(i,n) cin>>a[i];
      ll m[n],u[n];
      fill(m,m+n,0);
      fill(u,u+n,0);
      rep0(i,n){
            for(int j=0;j<i;j++){
                  if(a[j]<a[i]) m[i]++;
            }
            for(int j=i+1;j<n;j++){
                  if(a[i]>a[j]) u[i]++;
            }
      }
      ll ans=0;
      rep0(i,n){
            ans=(ans+u[i]*(((k*(k+1))/2)%mod))%mod;
            ans=(ans+m[i]*(((k*(k-1))/2)%mod))%mod;
      }
      cout<<ans<<endl;
      return 0;
}

Measured memory_bytes: 256
import java.util.Scanner;

public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    int[] di = new int[n];
    int sum = 0;

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

    for (int i = 1; i <= n; i++) {
      for (int j = 1+i; j <= n; j++) {
        sum +=di[i-1] * di[j-1];
      }
    }
    System.out.println(sum);
  }
}

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

int main() {
  int N;
  cin >> N;
  while(N>=1){
    if(N%10 == 7){
      cout << "Yes" << endl;
      break;
    }
    else if(N<10){
      cout << "No" << endl;
      break;
    }
    N = N/10;
  }
}


Measured memory_bytes: 3624
#include <bits/stdc++.h>
using namespace std;
using vi = vector<int>;
using vb = vector<bool>;
using vc = vector<char>;
using vs = vector<string>;
using vvi = vector<vector<int>>;
using vvc = vector<vector<char>>;
using pii = pair<int, int>;
#define fix20 cout << fixed << setprecision(20);
#define rep(i,n) for(int i=0; i<(int)(n);i++)
#define MOD 1000000007

int main(){
  long n,c;
  cin >> n >> c;
  vector<long> x(n),v(n);
  rep(i,n) cin >> x.at(i) >> v.at(i);
  long ans = 0;
  long tmp = 0;
  vector<long> data1(n),data2(n);
  vector<long> ans1(n),ans2(n);
  long max1 = 0;
  long min1_d = c+1;
  long max2 = 0;
  long min2_d = c+1;
  rep(i,n){
    long dis;
    if(i == 0) dis = x.at(i);
    else dis = x.at(i) - x.at(i-1);
    tmp = tmp + v.at(i) - dis;
    data1.at(i) = tmp;
    ans = max(ans,tmp);
    if(x.at(i) <= c/2){
      if(max1 <= tmp){
        max1 = tmp;
        if(min1_d > x.at(i)) min1_d = x.at(i);
      }
    }
  }
  tmp = 0;
  for(int i=n-1;i>=0;i--){
    long dis;
    if(i==n-1) dis = c - x.at(i);
    else dis = x.at(i+1) - x.at(i);
    tmp = tmp + v.at(i) - dis;
    data2.at(i) = tmp;
    ans = max(ans,tmp);
    if(c - x.at(i) <= c/2){
      if(max2 <= tmp){
        max2 = tmp;
        if(min1_d > c - x.at(i)) min1_d = c - x.at(i);
      }
    }
  }
  tmp = 0;
  long ZERO = 0;
  ans1.at(0) = max(ZERO,data1.at(0));
  ans2.at(n-1) = max(ZERO,data2.at(n-1));
  rep(i,n-1){
    ans1.at(i+1) = max(ans1.at(i),data1.at(i+1));
    ans2.at(n-2-i) = max(ans2.at(n-1-i),data2.at(n-2-i));
  }
  rep(i,n-1){
    if(x.at(i) > c/2) break;
    tmp = data1.at(i) - x.at(i) + ans2.at(i+1);
    ans = max(ans,tmp);
  }
  for(int i = n-1; i>= 1 ; i--){
    if(c - x.at(i) > c/2) break;
    tmp = data2.at(i) - (c - x.at(i)) + ans1.at(i-1);
    ans = max(ans,tmp);
  }
  cout << ans << endl;
}


Measured memory_bytes: 4992
#include <algorithm>
#include <cstdint>
#include <cassert>
#include <cmath>
#include <cstdio>
#include <deque>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <vector>
#include <cfloat>

using namespace std;

using lint=int64_t;
using uint=uint32_t;
using ulint=uint64_t;

template<class T>
using vector2d=vector<vector<T>>;

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

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

template <class T>
void OutVec(const vector<T>& vec){
  for(int i = 0; i < vec.size() - 1; ++i){
    cout<<vec[i]<<" ";
  }
  cout<<vec.back()<<endl;
}

template <class T>
void OutVec2d(const vector2d<T>& vec){
  for(auto v:vec){
    OutVec(v);
  }
}

int main(){
  cout << std::fixed << std::setprecision(16);
  cin.tie(nullptr);
  std::ios::sync_with_stdio(false);

  int n;
  cin>>n;
  vector<lint> a(n);
  for(int i=0;i<n;i++){
    cin>>a[i];
  }
  const lint INF=INT64_MIN/2;
  vector2d<lint> dp(n,vector<lint>(3,INF));
  dp[0][0]=a[0];
  dp[0][1]=0;
  dp[1][0]=INF;
  dp[1][1]=a[1];
  for(int i=2;i<n;i++){
    dp[i][0]=dp[i-2][0]==INF?INF:dp[i-2][0]+a[i];

    if(i==2){
      dp[i][1]=dp[i-2][1]+a[i];
    }else{
      dp[i][1]=max(dp[i-2][1]+a[i],dp[i-3][0]+a[i]);
    }

    if(i==2){
      dp[i][2]=a[2];
    }else if(i==3){
      dp[i][2]=max({dp[i-2][2]+a[i],dp[i-3][1]+a[i]});
    }else{
      dp[i][2]=max({dp[i-2][2]+a[i],dp[i-3][1]+a[i],dp[i-4][0]+a[i]});
    }

  }

  if(n%2==0){
    cout<<max({dp[n-2][0],dp[n-1][1]})<<endl;
  }else{
    cout<<max({dp[n-3][0],dp[n-2][1],dp[n-1][2]})<<endl;
  }

  return 0;
}




Measured memory_bytes: 15876
#pragma GCC optimize("O4")
#include <bits/stdc++.h>
#define For(i,a,b) for(int i=a;i<=b;i++)
#define F first
#define S second
#define all(x) x.begin(),x.end()
#define sz(x) ((int)x.size())
#define MOD (ll)(998244353)
#define INF (1e15)
#define int ll
#define EPS (1e-6)
using namespace std;
using ll=long long;
using pii=pair<int,int>;

int gcd(int a,int b) { return b==0?a:gcd(b,a%b); }
int lcm(int a,int b) { return a/gcd(a,b)*b; }
int fpow(int b,int p){
	if(p==0) return 1;
	int h=fpow(b,p/2);
	if(p%2) return h*b%MOD*h%MOD;
	return h*h%MOD;
}

int32_t main() {
#ifdef LOCAL_TEST
	freopen("E:\\Jimmy\\2 Coding\\1 C++\\input.in","r",stdin);
	freopen("E:\\Jimmy\\2 Coding\\1 C++\\output.out","w",stdout);
	freopen("E:\\Jimmy\\2 Coding\\1 C++\\error.out","w",stderr);
#endif
	ios::sync_with_stdio(false);
	cin.tie(0);

	//code...
	string s; cin>>s;
	if(s[0]==s[2]) cout<<"Yes\n";
	else cout<<"No\n";
	return 0;
}






























Measured memory_bytes: 256
#include<stdio.h>
int main()
{
    int i,j,n,m,t;
    scanf("%d",&n);

    int a[n];
    for(i=0;i<n;i++){
        scanf("%d",&a[i]);
    }
    scanf("%d",&m);
    int b[m];
    for(i=0;i<m;i++){
        scanf("%d",&b[i]);
    }
    t=0;
    for(i=0;i<n&&i<m;i++){
        if(a[i]<b[i]){
            t=1;
        break;}
        else if(a[i]>b[i]) {
            t=0;
            break;
            }
            else if(a[i]==b[i])
            {
                t=2;
            }
    }
    if(t==1)
      printf("1\n");
    else if(t==0)
        printf("0\n");
    else if(t==2)
    {
        if(m>n)
        {
            printf("1\n");
        }
        else
            printf("0\n");
    }
}


Measured memory_bytes: 2140
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <deque>
#include <iostream>
#include <numeric>
#include <queue>
#include <string>
#include <utility>
#include <vector>
 
using namespace std;
#define ALL(a) (a).begin(), (a).end()
#define REP(i, n) for (size_t i = 0; i < (n); i++)
#define nvec(T, v, n) vector<T> v(n); REP(i, n) {cin>>(v)[i];}
#define npairs(T1, T2, v, n) vector<pair<T1, T2>> v(n); REP(i, n){cin>>v[i].first>>v[i].second;}
#define ntuples(T1, T2, T3, v, n) vector<tuple<T1, T2, T3>> v(n); REP(i, n){cin>>get<0>(v[i])>>get<1>(v[i])>>get<2>(v[i]);}
#define vec2d(T, v, m, n) vector<vector<T>> (v)(m, vector<T>(n))
#define nvec2d(T, v, m, n) vec2d(T, v, m, n); REP(j, m){REP(i, n) {cin>>(v[j])[i];}}
 
#define min_index(v) size_t( min_element(all(v)) - (v).begin() )
#define max_index(v) size_t( max_element(all(v)) - (v).begin() )
#define min_e(v) *min_element(ALL(v))
#define max_e(v) *max_element(ALL(v))
 
#define count_le(v, a) size_t( upper_bound(ALL(v), a) - (v).begin() )
#define count_lt(v, a) size_t( lower_bound(ALL(v), a) - (v).begin() )
#define count_ge(v, a) size_t( (v).end() - lower_bound(ALL(v), a) )
#define count_gt(v, a) size_t( (v).end() - upper_bound(ALL(v), a) )
 
#define order(neq_sl) [](const auto s, const auto l){return neq_sl;}
#define make_lr(v,type,l,r) vector<type> l(n+1),r(n+1);FOR(i,n){l[i+1]=l[i]+v[i];r[i+1]=r[i]+v[n-1-i];}
 
#define acm accumulate
#define SUM(v) accumulate(ALL(v), 0l)
#define SORT(v) sort(ALL(v))
 
#define GCD(v) gcd(ALL(v), 0l)
 
/*template <typename T>
T gcd(T a, T b) {
    if (a > b) swap(a, b);
    if (a == 0) return b;
    return gcd(b%a, a);
}
template <typename InputItr, typename T>
T gcd(InputItr first, InputItr last, T init) {
    for (; first != last; ++first) init = gcd(init, *first);
    return init;
}*/
 
template <typename T>
using vec =vector<T>;
 
template <typename T>
using vvec =vector<vector<T>>;
 
int main(){
  int n,s;
  cin>>n>>s;
  nvec(long,a,n);
  SORT(a);
  vvec<long> v(n,vec<long>(s+1,0));
  if(a[0]>s){
    cout<<0;
    return 0;
  }
  v[0][a[0]]=1;v[0][0]=2;
  for (int i = 1; i < n; i++) {
    for (int l = 0; l <= s; l++) {
      v[i][l]+=2*v[i-1][l];
      if(l-a[i]>=0){v[i][l]+=v[i-1][l-a[i]];}
      v[i][l]%=998244353;
    }
  }
  cout<<v[n-1][s];
 
}
 
 
/* きょむ〜 */

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

int main(){
  ll n;
  cin >> n;
  ll ans = 0;
  for (ll i=1; i<=n; i++){
    if ((i%3 != 0) && (i%5 != 0)) ans += i;
  }
  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 3648
#include <bits/stdc++.h>
#define FASTIO ios::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define LL long long int
using namespace std;

const int N = 5e5 + 5;
const int oo = 1e9 + 5;
const int MOD = 1e9 + 7;

int fac[N], invfac[N];

LL ncr(int n, int r) {
    if (r < 0 || r > n) return 0;
    return ((fac[n] * 1LL * invfac[n-r])%MOD * 1LL * invfac[r])%MOD;
}
LL powermod(LL a, LL b) {
    if (b == 0) return 1;
    LL res = powermod(a, b/2);
    res = (res * res)%MOD;
    if (b & 1) res = (res * a)%MOD;
    return res;
}
void pre() {
    fac[0] = 1;
    for (int i=1;i<N;++i) fac[i] = (fac[i-1] * 1LL * i)%MOD;
    invfac[N-1] = powermod(fac[N-1], MOD-2);
    for (int i=N-2;i>=0;--i) invfac[i] = (invfac[i+1] * 1LL * (i+1))%MOD;
}
void solve() {
    int n, m, sgn = 1;
    cin >> n >> m;
    if (m < n) {
        cout << "0\n";
        return;
    }
    LL ans = 0;
    for (int i=0;i<=n;++i) {
        LL now = (fac[m] * 1LL * fac[m-i])%MOD;
        now = (now * invfac[m-n])%MOD;
        now = (now * invfac[m-n])%MOD;
        now = (now * ncr(n, i))%MOD;
        if (i & 1) {
            ans = (ans - now);
            if (ans < 0) ans += MOD;
        } else {
            ans = ans + now;
            if (ans >= MOD) ans -= MOD;
        }
    }
    cout << ans << '\n';
} 

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

Measured memory_bytes: 7528
#include <stdio.h>
#include <math.h>
int main(void){
    double x1,x2,y1,y2, z;
    scanf("%lf %lf %lf %lf", &x1, &y1, &x2, &y2);
    z=(x1-x2)*(x1-x2)+(y1-y2)*(y1-y2);
    printf("%f\n", sqrt(z));
    return 0;
}


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

int main() {
  int a, b;
  cin >> a >> b;
  string s;
  cin >> s;
  for(int i = 0; i < a+b+1; i++) {
    if(i == a && s[i] != '-') {
      cout << "No";
      return 0;
    } else if(i != a && s[i] == '-') {
      cout << "No";
      return 0;
    }
  }
  cout << "Yes";
}

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

using namespace std;

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

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

const ll INF = 1e18;
const int Inf = 1e9;
const double EPS = 1e-9;
const ll MOD = 1e9 + 7;

int main() {
    cin.tie(nullptr);
    ios::sync_with_stdio(0);
	int n;
	cin >> n;
	rep (i, n) {
	  int a;
	  cin >> a;
	  if (a % 2) continue;
	  if (a % 3 != 0 && a % 5 != 0) {
		cout << "DENIED" << endl;
		return 0;
	  }
	}
	cout << "APPROVED" << endl;
    
    return 0;
}



Measured memory_bytes: 3656
#include<iostream>
#include<string>
#include<queue>
#include<algorithm>
#include<set>
#include<map>
#include<sstream>
#include<cstring>
#include<cstdlib>
#include<cstdio>
#include<cctype>
#include<cmath>
#include <fstream>	// require freopen
using namespace std;
#define REP(i,m,n) for(int i=m;i<n;i++)
#define rep(i,n) REP(i,0,n)
int b[100],m,n;
bool C(int d)
{
  int v[20]; rep(i,m)v[i]=0;
  int ii=0;
  rep(i,n){
    while(ii<m && v[ii]+b[i]>d)ii++;
    if(ii==m)return false;
    v[ii]+=b[i];
  }
  return true;
}
int main(void)
{
//	cut here before submit 
//	freopen ("testcase.persistence", "r", stdin );

  for(;;){
    scanf("%d%d",&m,&n); if(!m)break;
    rep(i,n) scanf("%d",b+i);
    int l,r,mid,res=9999999;
    l=0; r=1500000;
    while(l<=r){
      mid=(l+r)/2;
      //printf("%d %d %d\n",l,mid,r);
      if(C(mid)){
	res=min(res,mid);
	r=mid-1;
      }
      else l=mid+1;
    }
    printf("%d\n",res);
  }
}

Measured memory_bytes: 0
main();

sub main {
$n = <STDIN>;
$nums = <STDIN>; $nums =~ s/\s+$//;
@nums = split (/ /, $nums);
%hash;
for $i (@nums) {
  if ($hash{$i}) {
    print "NO\n"; return 0;
  }
  $hash{$i} = 1;
}
print "YES\n"; return 0;
}


Measured memory_bytes: 50380
#include<bits/stdc++.h>
using namespace std;
int main() {
  int n,k;
  cin >> n >> k;
  map<int,int>m;
  for (int i = 0; i < n; i++) {
    int a;
    cin >> a;
    ++m[a];
  }
  vector<int> v;
  for(auto x: m){
    v.push_back(x.second);
  }
  sort(v.begin(), v.end());
  int c = v.size();
  int ans=0;
  for (int i = 0; i < c-k; i++) {
    ans+=v[i];
  }
  cout << ans << endl;
}

Measured memory_bytes: 10748
package main

import (
	"bufio"
	"fmt"
	"os"
)

func main() {
	scanner := bufio.NewScanner(os.Stdin)
	scanner.Split(bufio.ScanWords)

	var N int
	scanner.Scan()
	fmt.Sscanf(scanner.Text(), "%d", &N)

	as := make([]int, N)
	for i := 0; i < N; i++ {
		scanner.Scan()
		fmt.Sscanf(scanner.Text(), "%d", &as[i])
	}

	ans := 0
	for _, a := range as {
		facts := make(map[int]int)
		factoring(a, facts)
		ans = ans + facts[2]
	}
	fmt.Println(ans)
}

func factoring(n int, facts map[int]int) {
	for i := 2; i*i <= n; i++ {
		for n%i == 0 {
			facts[i]++
			n = n / i
		}
	}
	if n != 1 {
		facts[n]++
	}
}


Measured memory_bytes: 1664
#include <bits/stdc++.h>
#define int long long

using namespace std;
using LL = long long;
using P = pair<int, int>;

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

#define pb(a) push_back(a)
#define all(x) (x).begin(),(x).end()

const int INF = (int)1e9;
const LL INFL = (LL)1e15;
const int MOD = 1e9 + 7;

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

/*************** using variables **************/
int n, a, b;
vector<int> h;
/**********************************************/

bool solve(int mid){
    vector<int> cur_h = h;
    REP(i, n){
        cur_h[i] -= mid*b;
    }
    int cnt = 0;
    REP(i, n){
        if(cur_h[i] > 0){
            cnt += (cur_h[i] % a != 0 ? cur_h[i] / a + 1 : cur_h[i] / a);
        }
    }
    return cnt <= mid;
}

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

    cin >> n >> a >> b;
    h.resize(n);
    REP(i, n) cin >> h[i];

    sort(all(h));
    
    int cnt = h[0] / b;
    a -= b;
    int ok = 1e9, ng = -1;
    while(abs(ok-ng) > 1){
        int mid = (ok + ng) / 2;
        if(solve(mid)) ok = mid;
        else ng = mid;
    }
    cout << ok << endl;
}


Measured memory_bytes: 1792
#include <stdio.h>


int main(){

	int a,b,c;

	scanf("%d %d %d",&a,&b,&c);

	int temp;

	if(a>b){
		if(a>c){
			if(a==b+c)
				printf("Yes\n");
			else
				printf("No\n");
		}
		else{
			if(c==b+a)
				printf("Yes\n");
			else
				printf("No\n");
		}
	}
	else{
		if(b>c){
			if(b==a+c)
				printf("Yes\n");
			else
				printf("No\n");
		}
		else{
			if(c==b+a)
				printf("Yes\n");
			else
				printf("No\n");
		}
	}
	return 0;
}

Measured memory_bytes: 128
#include <iostream>
#include <cstdio>
#include <string>
#include <cstring>
#include <deque>
#include <list>
#include <queue>
#include <stack>
#include <vector>
#include <utility>
#include <algorithm>
#include <map>
#include <set>
#include <complex>
#include <cmath>
#include <limits>
#include <climits>
#include <ctime>
#include <cassert>
#include <numeric>
#include <functional>
#include <bitset>

using namespace std;
using lint = long long int;
using ll = long long int;
using graph = vector<vector<int>>;
using wgraph = vector<vector<pair<int, lint>>>;
const lint INF = 1001001001001001LL;
const lint MOD = 1000000007LL;
int di[] = {-1, 0, 1, 0, -1, 1, 1, -1};
int dj[] = {0, 1, 0, -1, 1, 1, -1, -1};

void yes(){ cout << "yes" << endl; }
void Yes(){ cout << "Yes" << endl; }
void YES(){ cout << "YES" << endl; }
void no(){ cout << "no" << endl; }
void No(){ cout << "No" << endl; }
void NO(){ cout << "NO" << endl; }
void possible(){ cout << "possible" << endl; }
void Possible(){ cout << "Possible" << endl; }
void POSSIBLE(){ cout << "POSSIBLE" << endl; }
void impossible(){ cout << "impossible" << endl; }
void Impossible(){ cout << "Impossible" << endl; }
void IMPOSSIBLE(){ cout << "IMPOSSIBLE" << endl; }

#define rep(i,n) for(int i = 0; i < (n); i++)
#define rrep(i,n) for(int i = 1; i <= (n); i++)
#define drep(i,n) for(int i = (n)-1; i >= 0; i--)
#define srep(i,s,t) for(int i = s; i < t; i++)
#define all(a) a.begin(),a.end()

int main(){
  int n; cin >> n;
  vector<int> v(n);
  rep(i, n) cin >> v[i];
  vector<int> c(n);
  rep(i, n) cin >> c[i]; 
  int ans = 0;
  rep(i, n) ans += max(0, v[i] - c[i]);
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 256
#include<iostream>
#include<stdio.h>
#include<string.h>
#include<ctype.h>
#include<cmath>
#include<iomanip>
using namespace std;

int main(void){
	int n,a,b,count,c,w;
	double d;
	n=0;
	b=0;
	cin>>n;
	//cout<<"n="<<n<<endl;
	count=0;
	for(a=0;a<n;a++){
		cin>>b;
		d=b;
		//cout<<b<<" ";
		for(w=0;w<=0;w++){
			if(b==2){
				break;
			}
			if(b%2==0||b==1){
				//cout<<"NO"<<endl;
				count++;
				break;
			}for(c=3;sqrt(d)>=c;c=c+2){
				if(b%c==0){
					count++;
					//cout<<"NO"<<endl;
					break;
				}
			}
		}
	}cout<<n-count<<endl;
	return 0;
}



Measured memory_bytes: 3108
#include <bits/stdc++.h>
#define rep(i, n) for(int i = 0; i < n; i++)
template<typename T> void pr(T s) {std::cout << s << std::endl;}
template<typename T> void prb(T s) {std::cout << s;}
using namespace std;



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


  int a,b,c;
  cin >> a >> b >> c;
  if (a*b*c == 5*5*7 && a+b+c == 5+5+7 && a*a+b*b+c*c == 5*5 + 5*5 + 7*7)
    pr("YES");
  else pr("NO");


  return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define ll long long
#define double long double
#define rep(i,n) for(int i=0;i<(n);i++)
#define REP(i,n) for(int i=1;i<=(n);i++)
#define mod (ll)(1e9+7)
#define inf (ll)(3e18+7)
#define pi (double) acos(-1)
#define P pair<int,int>
#define PiP pair<int,pair<int,int>>
#define all(x) x.begin(),x.end()
#define rall(x) x.rbegin(),x.rend()
using namespace std;

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

int main() {
    int h, w, ans = 0;
    cin >> h >> w;
    vector<string> s(h);
    rep(i, h)cin >> s[i];
    ll a[h][w];
    rep(i, h){
        rep(j, w){
            if(s[i][j] == '.')a[i][j] = inf;
            else {
                a[i][j] = -1;
                ans--;
            }
        }
    }
    a[0][0] = 0;
    queue<P> que;
    que.push({0, 0});
    while(!que.empty()){
        P p = que.front(); que.pop();
        int y = p.first, x = p.second;
        rep(i, 4){
            int nx = x + dx[i], ny = y + dy[i];
            if(ny < 0 || h <= ny || nx < 0 || w <= nx)continue;
            if(a[ny][nx] == inf){
                a[ny][nx] = a[y][x] + 1;
                que.push({ny, nx});
            }
        }
    }
    cout << (a[h-1][w-1] == inf ? -1 : h * w - a[h-1][w-1] + ans - 1);
}


Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <bitset>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <utility>
#include <vector>
#include <complex>
#include <string.h>
#include <numeric>
using namespace std;

//#define int long long
#define reps(i,s,n) for(int (i)=(s);(i)<(n);++(i))
#define rep(i,n) reps(i,0,n)
#define rept(i,n) rep(i,(n)+1)
#define repst(i,s,n) reps(i,s,(n)+1)
#define reprt(i,n,t) for(int (i)=(n);(i)>=(t);--(i))
#define repr(i,n) reprt(i,n,0)
#define each(i,v) for(auto &(i):(v))
#define eachr(i,v) for(auto &(i)=(v).rbegin();(i)!=(v).rend();(i)++)
#define all(c) (c).begin(),(c).end()
#define rall(c) (c).rbegin(),(c).rend()
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define tmax(x,y,z) max(x,max(y,z))
#define tmin(x,y,z) min(x,min(y,z))
#define chmin(x,y) x=min(x,y)
#define chmax(x,y) x=max(x,y)
#define ln '\n'
#define bln(i,n) (((i)==(n)-1)?'\n':' ')
#define dbg(x) cout<<#x" = "<<(x)<<ln<<flush
#define dbga(x,n) {cout<<#x" : ";for(int (i)=0;i<(n);++i){cout<<((x)[i])<<(i==((n)-1)?'\n':' ')<<flush;}}
#define zero(a) memset(a,0,sizeof(a))
#define unq(a) sort(all(a)),a.erase(unique(all(a)),a.end())
#define endl "\n"

//typedef complex<double> P;
typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<string> vst;
typedef vector<pii> vpii;
typedef vector<pll> vpll;
typedef vector<vector<int> > mat;

const ll inf = (ll)1e9+10;
const ll linf = (ll)1e18+10;
const ll mod = (ll)(1e9+7);
const int dx[] = {0, 1, 0, -1};
const int dy[] = {1, 0, -1, 0};
const int ddx[] = {0, 1, 1, 1, 0, -1, -1, -1};
const int ddy[] = {1, 1, 0, -1, -1, -1, 0, 1};
const double eps = 1e-10;

ll mop(ll a,ll b,ll m=mod) {ll r=1;a%=m;for(;b;b>>=1){if(b&1)r=r*a%m;a=a*a%m;}return r;}
ll gcd(ll a,ll b) {return b?gcd(b,a%b):a;}
ll lcm(ll a,ll b) {return a/gcd(a,b)*b;}
bool ool(int x,int y,int h,int w) {return((x<0)||(h<=x)||(y<0)||(w<=y));}
bool deq(double a,double b) {return abs(a-b)<eps;}

struct oreno_initializer {
	oreno_initializer() {
		cin.tie(0);
		ios::sync_with_stdio(0);
	}
} oreno_initializer;



map<char,char> m = {{'A','T'}, {'T','A'}, {'C','G'}, {'G','C'}};
char c;

signed main() {
	cin >> c;
	cout << m[c] << endl;
}

Measured memory_bytes: 256
#include<cstdio>
#include<iostream>
#include<cmath>
#include<cstring>
#include<queue>
#include<algorithm>
#include<map>
using namespace std;
typedef long long ll;
const ll N=(1e9+5)*1e9;
ll n,a,b,c,d,t,mx=-N; 
int main()
{
	ios::sync_with_stdio(false);
	cin>>a>>b>>c>>d;
	mx=max(mx,a*c);
	mx=max(mx,a*d);
	mx=max(mx,b*c);
	mx=max(mx,b*d);
	cout<<mx<<endl;
}

Measured memory_bytes: 3620
//Gvs Akhil (Vicennial)
#include<bits/stdc++.h>
#define int long long
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define mt make_tuple
#define ld(a) while(a--)
#define tci(v,i) for(auto i=v.begin();i!=v.end();i++)
#define tcf(v,i) for(auto i : v)
#define all(v) v.begin(),v.end()
#define rep(i,start,lim) for(long long (i)=(start);i<(lim);i++)
#define sync ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define osit ostream_iterator
#define INF 		0x3f3f3f3f
#define LLINF       1000111000111000111LL
#define PI 			3.14159265358979323
#define endl '\n'
#define trace1(x)                cerr<<#x<<": "<<x<<endl
#define trace2(x, y)             cerr<<#x<<": "<<x<<" | "<<#y<<": "<<y<<endl
#define trace3(x, y, z)          cerr<<#x<<":" <<x<<" | "<<#y<<": "<<y<<" | "<<#z<<": "<<z<<endl
#define trace4(a, b, c, d)       cerr<<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<endl
#define trace5(a, b, c, d, e)    cerr<<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<" | "<<#e<< ": "<<e<<endl
#define trace6(a, b, c, d, e, f) cerr<<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<" | "<<#e<< ": "<<e<<" | "<<#f<<": "<<f<<endl
const int N=1000006;
using namespace std;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef long long ll;
typedef vector<long long> vll;
typedef vector<vll> vvll;
typedef long double ld;
typedef pair<int,int> ii;
typedef vector<ii> vii;
typedef vector<vii> vvii;
typedef tuple<int,int,int> iii;
typedef set<int> si;
typedef complex<double> pnt;
typedef vector<pnt> vpnt;
typedef priority_queue<ii,vii,greater<ii> > spq;
const ll MOD=1000000007LL;
template<typename T> T gcd(T a,T b){if(a==0) return b; return gcd(b%a,a);}
template<typename T> T power(T x,T y,ll m=MOD){T ans=1;while(y>0){if(y&1LL) ans=(ans*x)%m;y>>=1LL;x=(x*x)%m;}return ans%m;}
int a[N],n;
int f(int x){
	int ans=0;
	rep(i,0,n){
		ans+=abs(a[i]-(x+i+1));
	}
	return ans;
}
int32_t main(){
	 cin>>n;
	rep(i,0,n) cin>>a[i];
	int lo = -1e10, hi = 1e10;
	rep(i,0,100){
		// trace2(i,f(i));
	}
	while (hi - lo > 1){
	    int mid = (hi + lo)>>1;
	    if (f(mid) < f(mid + 1)) 
	         hi = mid;
	    else 
	         lo = mid; 
	}
	cout<<min({f(lo+1),f(lo),f(lo-1),f(hi),f(hi+1),f(hi-1)});
}

Measured memory_bytes: 1792
import sys
import math
import numpy

x , y , a , b , c = map(int,input().split())
pa = list(map(int,input().split()))
pb = list(map(int,input().split()))
pc = list(map(int,input().split()))

pa.sort()
pb.sort()
pc.sort()

if x <= a:
    pa = pa[a-x::]
    a = x
if y <= b:
    pb = pb[b-y::]
    b = y
if x+y <= c:
    # print(c-x+y)
    pc = pc[(c-(x+y))::]
    c = x+y

ain = 0
bin = 0
cin = 0

total = 0
for times in range(x+y):
    if ain < a:
        ta = pa[a-1 - ain ]
    else:
        ta = 0
    
    if bin < b :
        tb = pb[b-1 - bin]
    else:
        tb = 0
    
    if cin < c:
        tc = pc[c-1 - cin]
    else:
        tc = 0
    
    if tb <= ta and tc <= ta:
        total += ta
        ain += 1
    elif ta <= tb and tc <= tb:
        total += tb
        bin += 1
    elif ta <= tc and tb <= tc:
        total += tc
        cin += 1
    else:
        print("error")

print(total)

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

#ifndef ONLINE_JUDGE
#  define LOG(x) (cerr << #x << " = " << (x) << endl)
#else
#  define LOG(x) 0
#endif
#define endl '\n'
#define pb push_back
#define mod 1000000007
typedef int integer;
#define int long long
using namespace std;

int powmod(int a, int b) {
    int res = 1;
    a %= mod;
    assert(b >= 0);
    for (; b; b >>= 1) {
        if (b & 1)res = res * a % mod;
        a = a * a % mod;
    }
    return res;
}

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

const integer NN = (int) 5e5 + 2;
int ar[NN];
int b[NN];
int n, m, k, x;
string s;
integer nums[1000000 + 5];

integer main() {
    ios_base::sync_with_stdio(false);
    cin.tie(0);

//    unordered_set<int> S;
    cin >> n;
    for (int i = 0; i< n; i++){
        cin >> ar[i];
        nums[ar[i]]++;
    }
    if (nums[1] == 1){
        cout << 1 << endl;
        return 0;
    } else if (nums[1]){
        cout << 0 << endl;
        return 0;
    }
    int ans = 0;
    for (int i = 0; i < n; i++){
        if (nums[ar[i]] > 1) continue;
        bool f = true;
        for (int j = 2; j * j <= ar[i]; j++){
            if (ar[i] % j) continue;
            int x = j, y = ar[i] / j;
            if (nums[x] || nums[y]){
                f = false;
                break;
            }
        }
        ans += f;
    }
    cout << ans << endl;

}


Measured memory_bytes: 9088
S = input()
iL = len(S)
iC = 0
iT = 0
bS = False
for i in range(iL):
    if S[i] in ['A','C','G','T'] :
        if bS:
            iT += 1
        else:
            bS = True
            iT = 1
        if iT > iC:
            iC = iT
    else:
        bS = False
        iT = 0
print(iC)


Measured memory_bytes: 3060