akhauriyash/Code-Regression huggingface dataset:
#include<iostream>
#include<algorithm>
using namespace std;
int main(){
  long long n,m,ans =0,v=0;
  cin>>n>>m;
  long long x[n],y[n],z[n],eva[n];
  for(int i=0;i<n;i++)cin>>x[i]>>y[i]>>z[i];

  for(int i=-1;i<2;i+=2){
    for(int j=-1;j<2;j+=2){
      for(int k=-1;k<2;k+=2){
        v = 0;
        for(int l=0;l<n;l++){
          eva[l]=i*x[l]+j*y[l]+k*z[l];
        }
        sort(eva,eva+n);
        reverse(eva,eva+n);
        for(int l=0;l<m;l++){
          v+=eva[l];
        }
        ans = max(ans,v);
      }
    }
  }
  cout<<ans<<endl;
  return 0;
}


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

using namespace std;

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

typedef long long ll;

//vector<int> mp(10000);
ll mp[10000000];
int main() {
    map<string, int> mm;
    int N;
    cin >> N;
    ll ans = 0;
    rep(i,N){
        string s;
        cin >> s;
        sort(s.begin(), s.end());
        mm[s]++;
    }
    for(auto& a : mm){
        ans += (ll)a.second*(a.second-1)/2;
    }
    cout<<ans<<endl;
}

Measured memory_bytes: 11136
import Data.List

toInt :: String -> Int
toInt = read :: String -> Int

getAns :: [Int] -> Int -> Int
getAns a k = sum . take n $ sort l
  where
    l = map length . group $ sort a
    n = length l - k

main = do
  [n, k] <- map toInt . words <$> getLine
  a <- map toInt . words <$> getLine
  print $ getAns a k


Measured memory_bytes: 64252
def main():
    import sys
    sys.setrecursionlimit(10**6)
    input = sys.stdin.readline
    X = int(input())
    for a in range(-100, 1001):
        for b in range(-1000, 1001):
            if a ** 5 - b ** 5 == X:
                print(a, b)
                exit()


if __name__ == '__main__':
    main()

Measured memory_bytes: 64488
/*
            _ _  ___            __ _ _  _       _     
 _   _  ___| | |/ _ \__      __/ _| | || |  ___| |__  
| | | |/ _ \ | | | | \ \ /\ / / |_| | || |_/ __| '_ \ 
| |_| |  __/ | | |_| |\ V  V /|  _| |__   _\__ \ | | |
 \__, |\___|_|_|\___/  \_/\_/ |_| |_|  |_| |___/_| |_|
 |___/                 

*/

#include <bits/stdc++.h>
using namespace std;
#define all(x) x.begin(), x.end()
#define debug(x) cout<<#x<<": "<<x<<endl
#define For(i, st, en) for(ll i=st; i<en; i++)
#define rfor(i, st, en) for(ll i=st; i>=en; i--)
#define tr(x) for(auto it=x.begin(); it!=x.end(); it++)
#define printv(x) For(i, 0, x.size()){cout<<x[i]<<" ";} cout<<endl;
#define fast std::ios::sync_with_stdio(false);cin.tie(NULL);
#define ll long long
#define int long long
#define F first
#define S second
#define pb push_back
typedef vector<int> vi;
typedef pair<int, int> pii;
typedef vector< vector<int> > vvi;
typedef vector< pair<int, int> > vpi;
#define MAXN 300005
#define MOD 1000000007
#define INF 1000000000000000007


signed main(){
	fast
	int a;
	string s;
	cin>>a>>s;
	if(a<3200){
		cout<<"red"<<endl;
	}else{
		cout<<s<<endl;
	}

    return 0;
}
    



Measured memory_bytes: 256
#include <iostream>
#include <iomanip>
#include <vector>
#include <algorithm>
#include <cstring>
#include <map>
#include <queue>
#include <cmath>
#include <complex> // complex<double> a(1.2 , 2.3);// real(): 1.2, imag()2.3
using namespace std;

#define MOD 1000000007
#define ll long long
#define ld long double
#define FOR(i,a,b) for(ll i=(ll)a;i<(ll)b;i++)
#define rep(i,n) FOR(i,0,n)
#define pb push_back
#define mp make_pair
#define all(a) a.begin(),a.end()
#define rall(a) a.rbegin(),a.rend()
#define rmsame(a) sort(all(a)),a.erase(unique(all(a)), a.end())
#define rmvector(a,b) rep(i,a.size())rep(j,b.size())if(a[i]==b[j]){a.erase(a.begin()+i);i--;break;}
#define pq_pair_tB priority_queue <pair<ll,ll>, vector<pair<ll,ll> > , greater<pair<ll,ll> > >
#define pq_pair_ts priority_queue <pair<ll,ll> > //第二成分の大きさが関係ない
template<typename X> bool exist(vector<X> vec, X item){return find(all(vec), item)!=vec.end();}
ll gcd(ll a, ll b){if(b==0)return a;return gcd(b,a%b);}
ll lcm(ll a, ll b){return a/gcd(a,b)*b;}


int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    
    ll N;
    cin >> N;
    ll x;
    cin >> x;
    
    N = 2 * (N-1) + 1;
    
    if(x == 1 || x == N){
        cout << "No" << endl;
        return 0;
    }
    if(N == 3){
        if( x == 2){
            cout << "Yes" << endl;
            cout << 1 << endl;
            cout << 2 << endl;
            cout << 3 << endl;
        }
        else cout <<"No" << endl;
        return 0;
    }
    cout << "Yes" << endl;
    if( x>=3 ){
        ll a = 1;
        ll b = x-1;
        ll c = x;
        ll d = x +1 ;
        //N-=4;
        ll cnt = 0;
        rep(i,N){
            if((i+1) == a) continue;
            if((i+1) == b) continue;
            if((i+1) == c) continue;
            if((i+1) == d) continue;
            cnt ++;
            cout << i+1 << endl;
            if( cnt-1 == (N-4)/2){
                cout << b << endl;
                cout << c << endl;
                cout << d << endl;
                cout << a << endl;
            }
        }
    }
    else{
        ll a = x -1;
        ll b = x ;
        ll c = x+1;
        ll d = N;
        //N-=4;
        ll cnt = 0;
        rep(i,N){
            if((i+1) == a) continue;
            if((i+1) == b) continue;
            if((i+1) == c) continue;
            if((i+1) == d) continue;
            cnt ++;
            cout  << i+ 1 << endl;
            if((cnt) >= (N-4)/2) {
                cout << d << endl;
                cout << a << endl;
                cout << b << endl;
                cout << c << endl;
                cnt = -10000000000;
            }
        }
    }
    return 0;
    
    
    //cout << fixed << setprecision(16) << ans << endl;
    return 0;
}


Measured memory_bytes: 1536
// Algorithm.cpp : このファイルには 'main' 関数が含まれています。プログラム実行の開始と終了がそこで行われます。
//

#include <iostream>
#include <algorithm>

using namespace std;

int main()
{
	 
	int a[1004] = {};
	int b; cin >> b;
	for (int i = 0; i < b; i++)		cin >> a[i];

	int v, j;
	for (int i = 1; i < b; i++) {  
		cout << a[0] << flush;
		for (int k = 1; k < b; k++)	cout << ' ' << a[k] << flush;
	    cout << endl;

		v = a[i];  
		j = i - 1;  
		while (j >= 0 && a[j] > v) {
			a[j + 1] = a[j];
			j--;
		}
		a[j + 1] = v;

		
	}

	cout << a[0] << flush;
	for (int k = 1; k < b; k++)	cout << ' ' << a[k] << flush;
	cout << endl;
	return 0;


}


Measured memory_bytes: 3124
#include<iostream>
#include<string.h>
using namespace std;
string A,S;
long long i,rez,nr;
int main()
{
	ios::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);
    cin>>A;
	for(i=0; i<=(int)A.size()-2; i++)//ai grija ca normal e unsigned, exemplu 2
	{
        if(A[i]=='B' && A[i+1]=='C')
        {
            S=S+'D';
            i++;
        }
        else
            S=S+A[i];
	}
    nr=0;
    for(i=0; i<S.size(); i++)
    {
        if(S[i]=='B' || S[i]=='C')
            nr=0;
        if(S[i]=='A')
            nr++;
        if(S[i]=='D')
            rez+=nr;
    }
	cout<<rez<<"\n";
    return 0;
}


Measured memory_bytes: 1460
#include<bits/stdc++.h>
using namespace std;
int n,k,ans=0;
int a[1005];
int main()
{
    cin>>n>>k;
    for(int i=1;i<=n;i++)
	{
		cin>>a[i];
	}
	sort(a+1,a+n+1);
	for(int i=1;i<=k;i++)
	ans+=a[i];
	cout<<ans<<endl;
	return 0;
}


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

int main() {
  int n, cnt = 1;
  cin >> n;
  vector<string> vec(0);
  
  REP(i,n) {
    string s;
    cin >> s;
    vec.push_back(s);
  }
  
  sort(vec.begin(),vec.end());
  
  REP(i,n-1) {
    if(vec[i] != vec[i+1]) cnt++;
  }
  
  cout << cnt << endl;
  return 0;
}

Measured memory_bytes: 11664
#include<stdio.h>
#include<string.h>
int main(void){
    int n, t[50],sum=0;
    char x[100], s[50][100];
    scanf("%d",&n);
    for(int i=0;i<n;i++){
        scanf("%s",s[i]);
        scanf("%d",&t[i]);
    }
    scanf("%s",x);
    for(int i=0;i<n;i++){
        if(strcmp(s[i],x)==0){
            for(int j=i+1;j<n;j++){
                sum+=t[j];
            }
            break;
        }
    }
    printf("%d",sum);
    return 0;
}

Measured memory_bytes: 128
#include <cstring>
#include <map>
#include <unordered_map>
#include <string>
#include <list>
#include <vector>
#include <algorithm>
#include <queue>
#include <stack>
#include <cstdio>
#include <iostream>
#include <set>
#include <unordered_set>
using namespace std;

#define MAX(a,b) (a>b?a:b)
#define MIN(a,b) (a<b?a:b)
typedef long long ll;
typedef unsigned long long ull;
typedef unsigned int ui;
typedef pair<int, int> pii;

int gi() {
    int a;
    scanf("%d", &a);
    return a;
}

ll gli() {
    ll a;
    scanf("%lld", &a);
    return a;
}

int n;
int v[8];
vector<int> c;
vector<int> p, q;
int w, pn, qn;

void d() {
    if (c.size() == n) {
        if (c == p)
            pn = w;
        if (c == q)
            qn = w;
        w++;
        return;
    }
    for (int i = 0; i < n; i++)
        if (!v[i]) {
            c.push_back(i+1);
            v[i] = 1;
            d();
            c.pop_back();
            v[i] = 0;
        }
}

int ABS(int a) {
    return (a < 0 ? -a : a);
}

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    n = gi();
    memset(v, 0, sizeof(v));
    w = 0;
    for (int i = 0; i < n; i++)
        p.push_back(gi());
    for (int i = 0; i < n; i++)
        q.push_back(gi());

    d();

    printf("%d\n", ABS(pn-qn));

    return 0;
}


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

#define ll long long int
#define vi vector<int> 

int main() {
	int n,m;
	cin >> n >> m;
	vector<bool> found(n+1,0);
	vector<ll> count(n+1,0);
	ll penalty=0;
	ll acs=0;
	    int a;
	    string b;
	for(int i=0;i<=n;i++)found[i]=0,count[i]=0;
	for(int i=0;i<m;i++){
	    cin >> a >> b;
	    //cout << a<<b<<"\n";
	    if(b=="AC"&&!found[a]){
	        acs++;
	        found[a]=true;
	        penalty+=count[a];
	    }
	    else if(b=="WA"){
	        count[a]++;
	        
	    }
	    
	}
	
    cout << acs<<" "<<penalty;
}


Measured memory_bytes: 1024
#include <iostream>
#include <algorithm>
#include <vector>
#include <cmath>
#include <string>

using namespace std;

typedef long long int ll;
typedef vector<ll> V;
typedef vector<V> VV;

int main() {
  // Happy hacking!
  ll n, k;
  string s;
  cin >> n >> k;
  cin >> s;

  V blk_size;
  V blk_dist;
  ll t_size = 0;
  ll t_dist = 0;
  bool is_in_blk = false;
  if(s[0] == '0') {
    is_in_blk = false;
    blk_size.push_back(0);
  } else {
    is_in_blk = true;
  }
  for(ll i=0; i<n; i++) {
    char c = s[i];
    if(is_in_blk) {
      if(c == '0') {
        is_in_blk = false;
        blk_size.push_back(t_size);
        t_dist = 1;
      } else {
        t_size++;
      }
    } else {
      if(c == '0') {
        t_dist++;
      } else {
        is_in_blk = true;
        blk_dist.push_back(t_dist);
        t_size = 1;
      }
    }
  }
  if(is_in_blk) {
    blk_size.push_back(t_size);
    blk_dist.push_back(0);
  } else {
    blk_dist.push_back(t_dist);
  }

  ll score_max = 0;
  // calc initial score
  ll score_prev = 0;
  ll init_idx = 0;
  for(; init_idx<k; init_idx++) {
    if(init_idx >= blk_size.size()) break;
    score_prev += blk_size[init_idx] + blk_dist[init_idx];
  }
  if(init_idx < blk_size.size()) {
    score_prev += blk_size[init_idx];
  }
  score_max = score_prev;
  for(ll i=1; i<((ll)blk_size.size())-k+1; i++) {
    ll score = score_prev;
    score -= blk_size[i-1] + blk_dist[i-1];    // remove the head block
    score += blk_dist[i+k-1];    // expand
    if(i+k < blk_size.size()) {
      score += blk_size[i+k];
    }
    if(score > score_max) {
      score_max = score;
    }
    score_prev = score;
  }

  cout << score_max << endl;

  return 0;
}


Measured memory_bytes: 1404
n = gets.to_i
x,y = 2.times.map{Array.new(n)}
n.times do |i|
    x[i],y[i] = gets.split.map(&:to_i)
end
a = Hash.new(0)
n.times do |i|
    n.times do |j|
        next if i == j
        a[(x[i]-x[j])*(10**10)+y[i]-y[j]] += 1
    end
end
m = a.values.max
if n == 1
    m = 0
end
puts n-m

Measured memory_bytes: 3964
#include <bits/stdc++.h>
using namespace std;
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define REP(i,n) FOR(i,0,n)
#define ALL(v) (v).begin(),(v).end()
#define fi first
#define se second
template<typename A, typename B> inline bool chmax(A &a, B b) { if (a<b) { a=b; return 1; } return 0; }
template<typename A, typename B> inline bool chmin(A &a, B b) { if (a>b) { a=b; return 1; } return 0; }
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef pair<int, pii> pip;
typedef pair<pll, pll> P;
const ll INF = 1ll<<29;
const ll MOD = 1000000007;
const double EPS = 1e-9;
const bool debug = 0;
//---------------------------------//

int main() {
	string s; cin >> s;
	int size = s.size();
	
	printf("%c%d%c\n", *s.begin(), size - 2, *--s.end());
	
	return 0;
}


Measured memory_bytes: 256
import sys
from bisect import *
from heapq import *
from collections import *
from itertools import *
from functools import *
from math import *

sys.setrecursionlimit(100000000)
input = lambda: sys.stdin.readline().rstrip()

N = int(input())
r = []
for i in range(N):
    s, p = input().split()
    p = int(p)
    r.append((s, -p, i))
r.sort()
for _, _, i in r: print(i + 1)



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

int main(){
    int n; cin>>n;
    string s; cin>>s;
    int e[300001];
    e[0]=0;
    for(int i=0;i<n;i++){
        e[i+1]=e[i]+(s[i]=='E');
    }
    int ans=1000000;
    for(int i=0;i<n;i++){
        int l=e[i];
        int r=e[n]-e[i+1];
        ans=min(ans,i-l+r);
    }
    cout<<ans<<endl;
}


Measured memory_bytes: 1796
import collections


def main():
    k = int(input())
    a = 0
    ans = -1
    for i in range(1, 2 * 10 ** 6):
        a = 10 * a + 7
        a %= k
        if a == 0:
            ans = i
            break
    print(ans)


if __name__ == '__main__':
    main()


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

int main(){
  ll n, ki = 0, gu = 0;
  cin >> n;
  ll a;
  rep(i, n){
    cin >> a;
    if (a % 2 == 0) {
      gu += 1;
    }else{
      ki += 1;
    }
  }
  if (ki != 0) {
    cout << "first" << endl;
  }else{
    cout << "second" << endl;
  }
}


Measured memory_bytes: 256
#include<stdio.h>
int main(void)
{
  int i,j,k;
  int ymd[100][3], n, y3=590, date;

  scanf("%d", &n);
  for(i=0; i<n; i++) {
    for(j=0; j<3; j++) {
      scanf("%d", &ymd[i][j]);
    }
  }

  for(i=0;i<n;i++) {
    date = 0;
    date += ((ymd[i][0]-1)/3)*y3;
    switch(ymd[i][0]%3){
    case 2:
      date += 195;
      for(j=0;j<ymd[i][1]-1;j++) {
	j%2 ? (date += 19):(date += 20);
      }
      date += ymd[i][2];
      break;
      
    case 1:
      for(j=0;j<ymd[i][1]-1;j++) {
	j%2 ? (date += 19):(date += 20);
      }
      date += ymd[i][2];
      break;
      
    case 0:
      date += 390;
      for(j=0;j<ymd[i][1]-1;j++) {
	date += 20;
      }
      date += ymd[i][2];
      break;
    }
    printf("%d\n", 196471 - date);
  }

  for(i=0;i<10000000;i++) {
    for(j=0;j<10000000;j++) {
       if(i>j) k++;
       else k--;
}
}

  return 0;
}
      

Measured memory_bytes: 596
import Control.Monad
main=do
 [h,w]<-map read.words<$>getLine
 s<-replicateM h getLine
 putStrLn(f 0 0 h w s)
  where f i j h w s |i==h ="Yes"
                    |j==w = f (i+1) 0 h w s
                    |otherwise =if(g i j h w s)then"No"else(f i (j+1) h w s)
        g i j h w s =((s!!i)!!j=='#')&&
                     (if j==0 then True else(s!!i)!!(j-1)=='.')&&
                     (if j==(w-1) then True else(s!!i)!!(j+1)=='.')&&
                     (if i==0 then True else(s!!(i-1))!!j=='.')&&
                     (if i==(h-1) then True else(s!!(i+1))!!j=='.')

Measured memory_bytes: 764
#include <stdio.h>

int main(int argc, char* argv[]){
    int a, b;
    scanf("%d %d", &a, &b);

    if (a < b) {
        printf("a < b\n");
    } else if (a > b) {
        printf("a > b\n");
    } else {
        printf("a == b\n");
    }
}


Measured memory_bytes: 2568
n=int(input())
a=[]
for i in range(n):
    a=a+[input()]
for i in range(1,14):
    if ("S "+str(i) in a)==False:
        print("S "+str(i))
for i in range(1,14):
    if ("H "+str(i) in a)==False:
        print("H "+str(i))
for i in range(1,14):
    if ("C "+str(i) in a)==False:
        print("C "+str(i))
for i in range(1,14):
    if ("D "+str(i) in a)==False:
        print("D "+str(i))


Measured memory_bytes: 5596
#include <bits/stdc++.h>
#define rep(i, a, n) for(int i = a; i < n; i++)
#define repp(i, n) rep(i, 0, n)
#define repb(i, a, b) for(int i = a; i >= b; i--)
#define all(a) a.begin(), a.end()
#define int long long
using namespace std;

int change_to_i(string s){
    stringstream ss; int k;
    ss << s; ss >> k;
    return k;
}
string change_to_s(int k){
    stringstream ss; string s;
    ss << k; ss >> s;
    return s;
}

signed main(){
    int q;
    cin >> q;
    rep(x, 0, q){
        string s;
        cin >> s;
        for(int ans = 0;; ans++){
            if(s.size() == 1){
                cout << ans << endl;
                break;
            }
            /*if(ans > 1000000){
                cout << -1 << endl;
                break;
            }*/
            string t1, t2;
            int MAX = 0, n1, n2;
            rep(i, 1, s.size()){
                t1 = s.substr(0, i);
                t2 = s.substr(i, s.size() - i);
                n1 = change_to_i(t1);
                n2 = change_to_i(t2);
                int tmp = n1*n2;
                //cout << t1 << ' ' << t2 << endl;
                //cout << n1 << ' ' << n2 << ' ' << tmp << endl;
                MAX = max(MAX, tmp);
            }
            s = change_to_s(MAX);
            //cout << ' ' << MAX << ' ' << s << endl;
        }
    }
}

Measured memory_bytes: 1232
object Main {
  def main(args: Array[String]): Unit = {
    val t = io.StdIn.readLine.split(" ").map(_.toInt)
    val r = t.sorted
    if (r(0) == 5 && r(1) == 5 && r(2) == 7)
      println("YES")
    else
      println("NO")
  }
}

Measured memory_bytes: 21420
n = int(input())
a_list = list(map(int, input().split()))

DIGIT = 61
MOD = (10**9) +7
count = 0
for i in range(DIGIT):
    one_count = 0
    for num in a_list:
        if (num >> i) % 2 == 1:
            one_count += 1
    comb_1_1 = one_count * (n - one_count)
    count += comb_1_1 * (2**i)
    count = count % MOD
    
print(count)

Measured memory_bytes: 122936
#include<bits/stdc++.h>
using namespace std;
const int p=2019;
int l,r,ans=2019;
int main(){
	scanf("%d%d",&l,&r);
	int a=l/2019,b=r/2019,c=l%2019,d=r%2019;
	for(int i=0;i<2019;i++){
		for(int j=0;j<2019;j++){
			if(i==j)continue;
			if(a==b&&i>=c&&i<=d&&j>=c&&j<=d)ans=min(ans,(i%p*j%p)%p);
			else if(a+1==b&&((i>=c||i<=d)&&(j>=c&&j<=d)))ans=min(ans,(i%p*j%p)%p);
			else if(a+1<b)ans=min(ans,(i%p*j%p)%p);
		}
	}
	printf("%d\n",ans);
	return 0;
}

Measured memory_bytes: 384
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        long h = in.nextInt();
        long w = in.nextInt();
        if(h>1 && w>1) {
            System.out.println((long)Math.ceil(h * w / 2.0));
        }
        else {
            System.out.println(1);
        }
    }
}


Measured memory_bytes: 21844
#include <stdio.h>

int main(void){
  int N;
  long max = 0;
  long ans = 0;
  long data;

  scanf("%d",&N);
  for(int i = 0;i < N;i++){
    scanf("%ld",&data);
    if(max<data){
      max = data;
    }
    ans += data;
  }

  printf("%ld\n",ans-max/2);
  return 0;
}

Measured memory_bytes: 128
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i,n) for(int (i)=0;(i)<(int)(n);++(i))
#define all(x) (x).begin(),(x).end()
#define pb push_back
#define fi first
#define se second
#define dbg(x) cout<<#x" = "<<((x))<<endl
template<class T,class U> ostream& operator<<(ostream& o, const pair<T,U> &p){o<<"("<<p.fi<<","<<p.se<<")";return o;}
template<class T> ostream& operator<<(ostream& o, const vector<T> &v){o<<"[";for(T t:v){o<<t<<",";}o<<"]";return o;}

int main(){
    int n;
    cin >>n;
    vector<int> a(n);
    rep(i,n) cin >>a[i];

    sort(all(a));

    int s = 0;
    rep(i,n-1) s += a[i];
    cout << ((a[n-1] < s)?"Yes":"No") << endl;
    return 0;
}


Measured memory_bytes: 256
//@sakshjha
#include<bits/stdc++.h>
using namespace std;
#define ll  long long int
#define ld long double
#define IOS ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define pi 3.14159265358979
const ll MOD = 1000000000;
const ll N=100005;
int main()
{
    IOS
    ll n,m,i;
    cin>>n>>m;
    ll a[m],sum=0;
    for(i=0; i<m; i++)
    {
        cin>>a[i];
        sum+=a[i];
    }
    if(sum>n)
        cout<<-1;
    else
        cout<<n-sum;
    return 0;
}


Measured memory_bytes: 3692
#include<iostream>
using namespace std;
int main(){
	int a,b;
	cin >> a >> b;
	int ans=0;
	int d=2;
	while(d--){
		if(a>b) ans+=a,a--;
		else ans+=b,b--;
	}
	cout << ans << endl;
	return 0;
}


Measured memory_bytes: 256
n = int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
c = list(map(int, input().split()))
ans = 0
mae = -1
for i in range(n):
    k = a[i]
    ans += b[k -1]
    if mae == k -1:
       ans += c[k -2]
    mae = k
print(ans)

Measured memory_bytes: 9208
#include<iostream>
using namespace std;
int main()
{
	int a,b;
	cin>>a>>b;
	int maxn=-1e7;
	maxn=max(maxn,a+b);
	maxn=max(maxn,a-b);
	maxn=max(maxn,a*b);
	cout<<maxn;
 } 

Measured memory_bytes: 256
#include<iostream>
#include<string>
#include<cmath>
#include<math.h>
#include<array>
#include<algorithm>
#include<queue>
//#include<deque>
#include<vector>
//#include<utility>
//#include<set>
#include<map>
//#include<list>
#include<bitset>
#include<iomanip>

using namespace std;
using LLI = long long int;
LLI N;

//array<int, 8>dir_x = { 0,0,1,1,1,-1,-1,-1 };
//array<int, 8>dir_y = { 1,-1,1,0,-1,1,0,-1 };
//array<int, 4>dir_x2 = { 0,0,1,-1 };
//array<int, 4>dir_y2 = { 1,-1,0,0 };
//char alp[] = { 'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z' };

//class UnionFind {
//public:
//	vector<int>data;
//	UnionFind(int size) :data(size, -1) {};
//	bool unionset(int x, int y) {
//		x = root(x), y = root(y);
//		if (x != y) {
//			if (data[y] < data[x]) {
//				swap(x, y);
//			}
//			data[x] += data[y];
//			data[y] = x;
//		}
//		return x != y;
//	}
//	bool findset(int x, int y) {
//		return root(x) == root(y);
//	}
//	int root(int x) {
//		return data[x] < 0 ? x : data[x] = root(data[x]);
//	}
//	int size(int x) {
//		return -data[root(x)];
//	}
//};

//LLI gcd(LLI x, LLI y) {
//	LLI  r;
//	if (x < y) {
//		swap(x, y);
//	}
//	r = x % y;
//	while (r != 0) {
//		x = y;
//		y = r;
//		r = x % y;
//	}
//	return y;
//}
//LLI lcm(LLI x, LLI y) {
//	return x / gcd(x, y) * y;
//}

//long nCr(int n, int r) {
//	long ans = 1;
//	for (int i = n; i > n - r; i--) {
//		ans = ans * i;
//	}
//	for (int i = 1; i < r + 1; i++) {
//		ans = ans / i;
//	}
//	return ans;
//}
//long nHr(int n, int r) {
//	n = n + r - 1;
//	return nCr(n, r);
//}

//const int n_max = 8;
//array<array<bool, n_max>, n_max>graph;
//int dfs(int v,int N,array<bool,n_max>visited) {
//	int ret = 0;
//	bool all_visited = true;
//	for (int i = 0; i < N;i++) {
//		if (visited[i] == false) {
//			all_visited = false;
//		}
//	}	
//	if (all_visited) {
//		return 1;
//	}
//	for (int i = 0; i < N;i++) {
//		if (graph[v][i] == false) {
//			continue;
//		}
//		if (visited[i] == true) {
//			continue;
//		}
//		visited[i] = true;
//		ret += dfs(i,N,visited);
//		visited[i] = false;
//	}
//	return ret;
//}

//vector<vector<int>>sub;
//int dfs(int id) {
//	if (sub[id].size() == 0) {
//		return 1;
//	}
//	int minP = (int)1e9;
//	int maxP = 0;
//	for (int i : sub[id]) {
//		int P = dfs(i);
//		minP = min(minP, P);
//		maxP = max(maxP, P);
//	}
//	return minP + maxP + 1;
//}

//#define debug(x) cerr << #x << " : " << x << endl
//#define debugv(x) cerr << #x << " : "; for(auto i:x) cerr << i << ", "; cerr<<endl

int main(void) {
	LLI N, cnt = 0;
	string S, T;
	cin >> S >> T;
	for (int i = 0; i < S.size(); i++) {
		if (S[i] == T[i]) {
			cnt++;
		}
	}
	cout << cnt << endl;
}

Measured memory_bytes: 764
#include <iostream>
#include <fstream>
#include <cstdio>
#include <cmath>
#include <vector>
#include <string>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <deque>
#include <bitset>
#include <algorithm>
#include <complex>
#include <array>
#include <functional>
using namespace std;

#define REP(i,n) for(int i=0; i<n; ++i)
#define FOR(i,a,b) for(int i=a; i<=b; ++i)
#define FORR(i,a,b) for (int i=a; i>=b; --i)
#define ALL(c) (c).begin(), (c).end()

typedef long long ll;
typedef vector<int> VI;
typedef vector<ll> VL;
typedef vector<double> VD;
typedef vector<VI> VVI;
typedef vector<VL> VVL;
typedef vector<VD> VVD;
typedef pair<int,int> P;
typedef pair<ll,ll> PL;

template<typename T> void chmin(T &a, T b) { if (a > b) a = b; }
template<typename T> void chmax(T &a, T b) { if (a < b) a = b; }

int in() { int x; scanf("%d", &x); return x; }
ll lin() { ll x; scanf("%lld", &x); return x; }

int main(void){
    ll n;
    cin >> n;
    ll ans = 0;
    REP(i,n){
        ans += (i + 1) * (n - i);
    }
    REP(i,n-1){
        ll u = in() - 1, v = in() - 1;
        if (u > v) swap(u, v);
        ll x = (u + 1) * (n - v);
        ans -= x;
    }
    cout << ans << endl;

    return 0;
}


Measured memory_bytes: 3760
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define mod 1e9+7;

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

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


int main() {
  char s[10]; cin >> s;
  sort(s, s+4);
  
  if (s[0]==s[1] && s[1]!=s[2] && s[2]==s[3]) cout << "Yes";
  else cout << "No";
  cout << endl;

}

Measured memory_bytes: 256
// #define _CRT_SECURE_NO_WARNINGS
// #define _USE_MATH_DEFINES	// M_PI=3.1415...
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <string>
#include <vector>
#include <map>
#include <set>
#include <stack>
#include <cmath>
#include <cstdlib>
#include <functional>
#include <locale>
#include <cctype>
#include <sstream>
#include <iomanip>	// 20桁出力 cout << setprecision(20) << double;
#include <queue>
#include <bitset>	// bitset<8> bs1(131uL); // 10000011 bs1[0]は1 01stringからビット集合生成可
#include <numeric>
#include <random>
#include <climits>  // A/Bを計算するときA==LLONG_MIN && B==-1のみ(1ull<<63)で代用
using namespace std;

typedef long long LL;
typedef pair<LL, LL> P;
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<LL> VL;
typedef vector<VL> VVL;				// VVL v(100,VL(100,0));
typedef vector<pair<LL, LL> > VP;
typedef vector<string> VS;
typedef map<int, int> MAPII;
typedef multimap<int, char, greater<int> > MuMAPIC;
typedef multimap<int, string, greater<int> > MuMIS;
typedef pair<LL, pair<P, P> > PP;

#define INF 999999999999999997		// 少し加算したらオーバーフローする
#define MP make_pair
#define FAST_IO  cin.tie(0); ios::sync_with_stdio(false);
#define FOR(i,a,b) for(LL i=(a);i<(b);i++)
#define FOR_REV(i,a,b) for(int i=(a);i>=(b);i--)
#define FOR_ITR(d) for(auto itr=d.begin(),d_end=d.end();itr!=d_end;++itr)	// C++11
#define O(s) cout<<s<<endl;
#define SORTVL(v) sort(v.begin(), v.end());
#define SORTVL_GR(v) sort(v.begin(), v.end(), greater<LL>());

#define DUMP_VVI(b) if(dbgF){FOR(i,0,b.size()){FOR(j,0,b[i].size())printf("%d ",b[i][j]);puts("");}}
#define D_OUT(str,value) if(dbgF){cout<<str<<" : "<<value<<endl;}

template<class T>T IN() { T d; cin >> d; return d; }

LL gcd(LL a, LL b) { return (b > 0) ? gcd(b, a % b) : a; } // 最大公約数（Greatest Common Divisor）
LL lcm(LL a, LL b) { return a / gcd(a, b) * b; } // 最小公倍数（Least Common Multiple）
bool uruu(LL Y) { return (((Y % 4 == 0 && Y % 100 != 0) || Y % 400 == 0) ? true : false); } // うるう年判定
string Replace(string S, string from, string to) { auto p = S.find(from); while (p != string::npos) { S.replace(p, from.size(), to); p = S.find(from, p + to.size()); }return S; }
// 桁和
LL Ketawa_s(string s) { LL a = 0; FOR(i, 0, s.length())a += s[i] - '0'; return a; }
// 末尾数字で切り上げ
LL CeilLastNumber(LL n) { return ((n + (10 - 1)) / 10) * 10; }
//二項係数 nCk mod pを求める
const LL MAX = 510000, p = 998244353; LL fac[MAX], finv[MAX], inv[MAX];
/* 前処理 */void COM_init() { fac[0] = fac[1] = 1; finv[0] = finv[1] = 1; inv[1] = 1; FOR(i, 2, MAX) { fac[i] = fac[i - 1] * i % p; inv[i] = p - inv[p % i] * (p / i) % p; finv[i] = finv[i - 1] * inv[i] % p; } }
/* 主処理 */LL COM(int n, int k) { if (n < k) return 0; if (n < 0 || k < 0) return 0; return fac[n] * (finv[k] * finv[n - k] % p) % p; }

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

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

int main() {
	FAST_IO;
	bool dbgF = true; // for D_OUT(str, value)  ... cout<< str <<" : "<< value <<endl;

	LL A, B;
	cin >> A >> B;
	O(max(A + B, max(A - B, A * B)));

	return 0;
}

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

#define rep(i,n) for(int i=0; i<n; i++)
const double eps = 1e-9;
typedef long long ll;
typedef pair<double, string> pds;

struct node {
	string name;
	double ratio;
};
bool operator<(const node& lhs, const node& rhs) {
	if(fabs(lhs.ratio-rhs.ratio) < eps) {
		return lhs.name < rhs.name;
	}
	return lhs.ratio > rhs.ratio;
}

int main() {
	int n;
	while( cin >> n, n ) {
		vector<node> rank;
		rep(i, n) {
			string l;
			int p, a, b, c, d, e, f, s, m;
			cin >> l >> p >> a >> b >> c >> d >> e >> f >> s >> m;
			int time = a + b + c + m*(d+e);
			double ratio = 1.0 * (f*s*m-p) / time;
			node nd;
			nd.name = l;
			nd.ratio = ratio;
			rank.push_back(nd);
		}
		sort( rank.begin(), rank.end() );
		rep(i, n) {
			cout << rank[i].name << endl;
		}
		cout << "#" << endl;
	}
	return 0;
}

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

const int I_MAX = 0xfffffff;
const int MAX = 100;


int main() {
	int n;
	int graph[MAX][MAX];
	bool table[MAX] = { false };
	int sum = 0;

	cin >> n;
	for (int i = 0; i < n; i++) {
		for (int j = 0; j < n; j++) {
			int temp;
			cin >> temp;
			if (temp == -1)temp = I_MAX;
			graph[i][j] = temp;
		}
	}

	table[0] = true;

	for (int i = 0; i < n - 1; i++) {
		int cost = I_MAX;
		int m;

		for (int j = 0; j < n; j++) {
			if (table[j] == false)continue;

			for (int k = 0; k < n; k++) {
				if (graph[j][k] < cost && table[k] == false) {
					cost = graph[j][k];
					m = k;
				}
			}
		}

		sum += cost;
		table[m] = true;
	}

	cout << sum << endl;

	return 0;
}

Measured memory_bytes: 3128
import sys
## io ##
def IS(): return sys.stdin.readline().rstrip()
def II(): return int(IS())
def MII(): return list(map(int, IS().split()))
def MIIZ(): return list(map(lambda x: x-1, MII()))
## dp ##
INIT_VAL = 0
def DD2(d1,d2): return [[INIT_VAL]*d2 for _ in range(d1)]
def DD3(d1,d2,d3): return [DD2(d2,d3) for _ in range(d1)]
## math ##
MOD=10**9+7
def divc(x,y): return -(-x//y)
def divf(x,y): return x//y
def gcd(x,y):
    while y: x,y = y,x%y
    return x
def lcm(x,y): return x*y//gcd(x,y)
def get_primes(MAX_NUM=10**3):
    """Return a list of prime numbers"""
    is_prime = [True] * MAX_NUM
    is_prime[0] = False
    is_prime[1] = False
    primes = []
    for i in range(MAX_NUM):
        if is_prime[i]:
            primes.append(i)
            for j in range(2*i, MAX_NUM, i):
                is_prime[j] = False
    return primes
## libs ##
from itertools import accumulate as acc
from collections import deque, Counter
from heapq import heapify, heappop, heappush
from bisect import bisect_left

#======================================================#

def main():
    x, y = MII()
    cnt = 0
    while x <= y:
        cnt += 1
        x *= 2
    print(cnt)

if __name__ == '__main__':
    main()

Measured memory_bytes: 3376
import Control.Applicative
import Data.List
import Control.Monad
import Data.Function
import Data.Array

getLineN :: Int -> IO [String]
getLineN n = replicateM n getLine

main = do
    _ <- getLine
    s <- getLine
    putStrLn.show.minimum $ answer [(length $ filter (=='E') s)] ('A':s)

answer vs [x] = vs
answer vs@(v:_) (x:y:xs)
    | x == 'A' && y == 'W' = answer (v:vs) (y:xs)
    | x == 'A' && y == 'E' = answer (v-1:vs) (y:xs)
    | x == 'W' && y == 'W' = answer (v+1:vs) (y:xs)
    | x == 'W' && y == 'E' = answer (v:vs) (y:xs)
    | x == 'E' && y == 'W' = answer (v:vs) (y:xs)
    | x == 'E' && y == 'E' = answer (v-1:vs) (y:xs)

Measured memory_bytes: 50556
n,a,b = gets.chomp.split.map(&:to_i)
 
ans = 0
 
 
tmp = (n/(a+b))
 
ans += tmp*a
 
 
 
amari = n % (a+b)
 
 
ans = [amari, a].min + ans
 
 
puts ans.to_i

Measured memory_bytes: 1788
#ifndef _GLIBCXX_NO_ASSERT
#include <cassert>
#endif
#include <cctype>
#include <cerrno>
#include <cfloat>
#include <ciso646>
#include <climits>
#include <clocale>
#include <cmath>
#include <csetjmp>
#include <csignal>
#include <cstdarg>
#include <cstddef>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>

#ifdef __GXX_EXPERIMENTAL_CXX0X__
#include <ccomplex>
#include <cfenv>
#include <cinttypes>
#include <cstdbool>
#include <cstdint>
#include <ctgmath>
#include <cwchar>
#include <cwctype>
#endif

#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <exception>
#include <fstream>
#include <functional>
#include <iomanip>
#include <ios>
#include <iosfwd>
#include <iostream>
#include <istream>
#include <iterator>
#include <limits>
#include <list>
#include <locale>
#include <map>
#include <memory>
#include <new>
#include <numeric>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdexcept>
#include <streambuf>
#include <string>
#include <typeinfo>
#include <utility>
#include <valarray>
#include <vector>

#ifdef __GXX_EXPERIMENTAL_CXX0X__
#include <array>
#include <atomic>
#include <chrono>
#include <condition_variable>
#include <forward_list>
#include <future>
#include <initializer_list>
#include <mutex>
#include <random>
#include <ratio>
#include <regex>
#include <system_error>
#include <thread>
#include <tuple>
#include <typeindex>
#include <type_traits>
#include <unordered_map>
#include <unordered_set>
#endif

using namespace std;

int main()
{
	bool b[33000] = {};
	b[0] = 1; b[1] = 1;
	for (size_t i = 2; i < 33000; i++)
	{
		if (!b[i])
		{
			int j = 2;
			while (i*j < 33000)
			{
				b[i*j] = 1;
				j++;
			}
		}
	}
	int n;
	while (cin >> n, n)
	{
		int count = 0;
		for (size_t i = 0; i <= n/2; i++)
		{
			if ((!b[i]) && (!b[n - i]))count++;
		}
		cout << count << endl;
	}
	return 0;
}

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


typedef long long int lli;
typedef unsigned long long int ulli;
typedef long double ldb;

#define pb push_back
#define popb pop_back
#define si size()
#define be begin()
#define en end()
#define le length()
#define mp make_pair
#define mt make_tuple
#define fi first
#define se second

#define forz(i,n) for( int i=0;i<n;i++)
#define forl(i, n) for(int i = 1; i<= n; i++)
#define deci(n)  fixed<<setprecision(n)
#define high(n) __builtin_popcount(n)
#define parity(n) __builtin_parity(n)
#define ctz(n)  __builtin_ctz(n)
// #define mod 1000000007
#define mod2 998244353
#define kira ios::sync_with_stdio(0), cin.tie(0),cout.tie(0)

using namespace std;

void cpc()
{
#ifndef ONLINE_JUDGE
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w" , stdout);
#endif
}
lli power(lli x, lli y)
{
	lli res = 1;     // Initialize result
	// lli p = mod;
	x = x ; // Update x if it is more than or
	// equal to p

	if (x == 0) return 0; // In case x is divisible by p;

	while (y > 0)
	{
		// If y is odd, multiply x with result
		if (y & 1)
			res = (res * x);

		// y must be even now
		y = y >> 1; // y = y/2
		x = (x * x);
	}
	return res;
}

int main()
{
	// cpc();
	lli a, b , c , k;
	cin >> a >> b >> c >> k;
	if (k <= a)
	{
		cout << k << endl;
	}
	else if (k > a && k <= a + b)
	{
		cout << a << endl;
	}
	else
	{
		cout << a - (k - (a + b)) << endl;
	}
	return 0;
}


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

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

	std::vector<int> vec(N);
	for (int i = 0; i < N; ++i)
	{
		std::cin >> vec[i];
	}

	std::sort(vec.begin(), vec.end());
	vec.erase(std::unique(vec.begin(), vec.end()), vec.end());

	std::cout << vec.size() << "\n";
	return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define pb push_back
#define mp make_pair
#define f(i,a,n) for(int i=a;i<n;i++)
#define ve vector
#define ss second 
#define ff first
#define pf pop_front
#define pob pop_back
#define psf push_front
#define res(x) cout<<x<<'\n'
#define read(t) ll t;cin>>t

int main(){

    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
	cout.tie(NULL);
    read(a);
    read(b);
    ll sum=0;
    f(i,0,b){
        read(x);
        sum+=x;
    }
    if(sum>=a){
        cout<<"Yes"<<endl;
    }
    else{
        cout<<"No"<<endl;
    }
    
    


   

}

Measured memory_bytes: 256
#include"bits/stdc++.h"
using namespace std;
int main(){
	
	/*
	int A,B,C,D,seconds,minutes;
	cin >> A >> B >> C >> D;
	seconds=A+B+C+D;
	minutes = seconds / 60;
	cout << minutes << seconds << endl;*/
	 
	/*int Q,P,R;
	cin >> Q >> P >>R;
	int answer;
	answer=Q*P/2;
	cout << answer << endl;*/

	int A,B;
	cin >> A >> B;
	int answer;
	answer=(A-1)*(B-1);
	cout << answer << endl;

	return 0;

}

Measured memory_bytes: 256
#include <iostream>
#include <iomanip>
#include <fstream>
#include <string>
#include <array>
#include <vector>
#include <deque>
#include <list>
#include <set>
#include <map>
#include <unordered_map>
#include <unordered_set>
#include <stack>
#include <queue>
#include <bitset>
#include <tuple>
#include <cmath>
#include <complex>
#include <algorithm>
#include <utility>
#include <regex>
#include <cstdint>
#include <numeric>
#include <functional>
#include <cassert>

using namespace std;
using ll = int64_t;
using ull = uint64_t;

constexpr ll INF = 1000000000;/* 1e+9a */

void solve(istream &cin) {
    ll N, x;
    cin >> N >> x;
    if(!cin) return;
    vector<ll> a;
    for (int i = 0; i < N; ++i) {
        ll tmp;
        cin >> tmp;
        a.push_back(tmp);
    } // end i
    sort(a.begin(), a.end());
    ll ans = 0;
    for (int i = 0; i < N; ++i) {
        if(a[i] <= x){
            ans++;
            x -= a[i];
        }
        else break;
    } // end i
    if(ans == N){
        if(x > 0){
            ans--;
        }
    }
    cout << ans << endl;

}

int main(int argc, char *argv[]) {
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    cout << setprecision(16) << scientific;
#ifdef DEBUG
    cerr << "DEBUG MODE" << endl;
    string test_cases = "test.txt";
    auto fs = fstream(test_cases, fstream::in);
    while(fs) {
        solve(fs);
    }
#else
    solve(cin);
#endif
    return 0;
}


Measured memory_bytes: 256
import java.util.*;
public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
 
    // String[] nyu=sc.nextLine().split(" ");

     String nyu=sc.nextLine();
//int A=Integer.parseInt(nyu[0]);
//int B=Integer.parseInt(nyu[1]);
//int C=Integer.parseInt(nyu[2]);
//int D=Integer.parseInt(nyu[3]);


//double A=Double.parseDouble(nyu[0]);
//double B=Double.parseDouble(nyu[1]);
/*
switch(C){
case 7:
case 5:
case 3:
System.out.println("YES") ;
break;
default:
System.out.println("NO") ;

break;
}
*/

//int res=Math.min((A*B),C);

//for(String tem:nyu){
//if(tem.equals("1"))res++;
//}

char[] c = nyu.toCharArray();

if((int)c[0]<(int)c[2]){
//double res=Math.ceil((AB)/2);

System.out.println("<");
}else if((int)c[0]>(int)c[2]){
System.out.println(">");

}else{
System.out.println("=");

}




	}
}

Measured memory_bytes: 21844
N, M, C = map(int,input().split())
B = list(map(int,input().split()))
A = []
for i in range(N):
  A.append(list(map(int,input().split())))
ans = 0
for i in range(N):
  sum = C
  for j in range(M):
    sum += A[i][j] * B[j]
  if sum > 0: ans += 1
print(ans)    

Measured memory_bytes: 38256
#define _USE_MATH_DEFINES // M_PI
#include<cmath>
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
#define REP(i,m,n) for(int i=(int)(m);i<(int)(n);++i)
#define rep(i,n) REP(i,0,n)
#define rREP(i,a,n) for(int (i)=(n)-1; (i)>=(a);--(i))
#define all(x) (x).begin(),(x).end()
#define out(y,x,h,w) (y)<0||(x)<0||(y)>=(h)||(x)>=(w)
constexpr int INF = 2147483647;
constexpr ll mod = 1000000007;

template<class T>inline bool chmin(T& a, T b) {
	if (a > b) {
		a = b;
		return true;
	}
	return false;
}
template<class T>inline bool chmax(T& a, T b) {
	if (a < b) {
		a = b;
		return true;
	}
	return false;
}
inline void init() {
	cin.tie(nullptr); cout.tie(nullptr);
	ios::sync_with_stdio(false);
	cout << fixed << setprecision(15);
}

int main() {
	init();

	int N; cin >> N;
	vector<int>A(N);
	rep(i, N)cin >> A[i];
	int ans = 0;
	int mn = A[0];
	rep(i, N) {
		if (mn >= A[i])++ans;
		chmin(mn, A[i]);
	}
	cout << ans << "\n";

	return 0;
}


Measured memory_bytes: 1024
#include <iostream>
#include <string>
#include <algorithm>
#include <functional>
#include <vector>
#include <stack>
#include <queue>
#include <deque>
#include <set>
#include <map>
#include <cstdio>
#include <cmath>
#include <tuple>
#include <iomanip>
#include <numeric>
#include <unordered_map>
#include <sstream>
#include<limits.h>
#include<float.h>
#include<list>
#include <array>
#include <complex>
#include<stdio.h>
#include<string.h>
#include <bitset>

using namespace std;
#define int long long

#define I32_MAX 2147483647
#define I64_MAX 9223372036854775807LL
#define I64_MAX2 1223372036854775807LL
#define INF I64_MAX2
#define MOD 1000000007
#define MEM_SIZE 10000
#define DEBUG_OUT true
#define ALL(x) (x).begin(), (x).end()

template<typename T> void DEBUG(T e){if(DEBUG_OUT == false)return; std::cout << e <<" ";}
template<typename T> void DEBUG(const std::vector<T>& v){if(DEBUG_OUT == false)return;for(const auto& e : v){std::cout<< e << " "; } std::cout << std::endl;}
template<typename T> void DEBUG(const std::vector<std::vector<T> >& vv){if(DEBUG_OUT == false)return;for(const auto& v : vv){ DEBUG(v); } }
template<class T,class... Ts> void DEBUG(T d, Ts... e){if(DEBUG_OUT == false)return;DEBUG(d);DEBUG(e...);}
template <class T> void corner(bool flg, T hoge) {if (flg) {cout << hoge << endl; abort();}}
template< typename T1, typename T2 > inline bool chmax(T1 &a, T2 b) { return a < b && (a = b, true); }
template< typename T1, typename T2 > inline bool chmin(T1 &a, T2 b) { return a > b && (a = b, true); }
//SOLVE


void solve (void)
{
  int A,B,C; cin>>A; cin>>B;cin>>C;
  cout<<min(C,B/A)<<endl;
  return;
}
int32_t main(int32_t argc, const char *argv[])
{
  std::ios::sync_with_stdio(false);
  std::cin.tie(0);

  std::cout << std::fixed;
  std::cout << std::setprecision(9);
  solve();

  return 0;
}


Measured memory_bytes: 256
n=int(input())
x=[]
u=[]
for i in range(n):
    xu = list(map(str,input().split()))
    x.append(float(xu[0]))
    mon = xu[1]
    if mon == "JPY":
        u.append(1)
    else:
        u.append(380000)
s = 0
for i in range(n):
    s = s + x[i]*u[i]
print(s)


Measured memory_bytes: 3316
//clear adj and visited vector declared globally after each test case
//check for long long overflow
//while adding and subs check if mod becomes -ve
//while using an integer directly in a builtin function add ll
//Mod wale question mein last mein if dalo ie. Ans<0 then ans+=mod;
//Dont keep array name as size or any other key word
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
#define PI 3.14159265358979323846264338327950L
#define MOD 1000000007
#define sz 100005
ll inf = 1e9;
ll power(ll x, ll n, ll mod)
{
  ll res = 1;
  x %= mod;
  while (n)
  {
    if (n & 1)
      res = (res * x) % mod;
    x = (x * x) % mod;
    n >>= 1;
  }
  return res%mod;
}
int main()
{
 
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  #ifndef ONLINE_JUDGE
  freopen("input.txt", "r", stdin);
  freopen("output.txt", "w", stdout);
  #endif
  ll n,d;
  cin>>n>>d;
  ll ans=0;
  while(n--)
  {
    ll x,y;
    cin>>x>>y;
    ll d1=x*x+y*y;
    if(d1<=d*d)
      ans++;
  }
  cout<<ans;
  return 0;
}


Measured memory_bytes: 3628
//#define _USE_MATH_DEFINES
#include <cmath>
#include <iostream>
//#include <stdio.h>
//#include <stdlib.h>
//#include <iomanip>
#include <vector>
//#include <string>
//#include <algorithm>
//#include <functional>
//#include <time.h>
//#include <sstream>
//#include <queue>

using namespace std;


int main(){

	int n, ans;
	double xa, ya, ra, xb, yb, rb;
	double R;

	cin >> n;

	while (n--){
		cin >> xa >> ya >> ra >> xb >> yb >> rb;

		R = sqrt((xa - xb)*(xa - xb) + (ya - yb)*(ya - yb));

		if (R > ra + rb){
			ans = 0;
		}
		else{
			ans = 1;
			if (ra > R + rb)ans = 2;
			if (rb > R + ra)ans = -2;
		}

		cout << ans << endl;

	}

	return 0;
}

Measured memory_bytes: 1232
import java.util.Scanner;

public class Main {
    public static void main(String[] args){
        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");
        }
        sc.close();
    }
}


Measured memory_bytes: 26184
def solve():
    S = input()
    T = input()

    spair = {}
    tpair = {}

    for s, t in zip(S, T):
        if s not in spair:
            spair[s] = t
        else:
            if spair[s] != t:
                print("No")
                exit()
        if t not in tpair:
            tpair[t] = s
        else:
            if tpair[t] != s:
                print("No")
                exit()

    print("Yes")


if __name__ == "__main__":
    solve()


Measured memory_bytes: 41840
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int main() {
  vector<int> nums;
  int a;cin>>a;
  int b;
  for (int r=0;r<a;r++){
    cin>>b;
    nums.push_back(b);
  }
  int ans=0;
  for (int f=1;f<a;f++){
    
    if(nums[f]<nums[f-1]){
      ans++;
    }
  }
  if(ans==2){
    vector<int>des;
      for (int f=1;f<a;f++){
    
      if(nums[f]<nums[f-1]){
       des.push_back(f-1);
      }}
    int aux=nums[des[0]];
    nums[des[0]]=nums[des[1]+1];
    nums[des[1]+1]=aux;
    if(is_sorted(nums.begin(),nums.end())){
      cout<<"YES";
    }else{cout<<"NO";}
  }else if(ans==0){cout<<"YES";}
  else{cout<<"NO";}
  
  }

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <algorithm>
#include <math.h>
#include <queue>
#include <iomanip>
using namespace std;
typedef long long ll;

int main() {
    int n, h[100010];
    cin >> n;
    for (int i = 0; i < n; i++) cin >> h[i];

    int mx = 0, idx = 0;
    while (idx < n) {
        int sub = 0;
        while (idx + sub + 1 < n && h[idx + sub] >= h[idx + sub + 1]) sub++;
        mx = max(mx, sub);
        idx += sub + 1;
    }
    cout << mx << endl;

}

/* 
g++ -std=c++14 main.cpp
*/

Measured memory_bytes: 640