akhauriyash/Code-Regression huggingface dataset:
#include<iostream>
#include<cstdio>
#include<math.h>
#include<string>
#include<algorithm>
#include<functional>
#include<vector>
#include<set>
#include<stack>
#include<queue>
#include<map>
#define INF 999999
#define EPS 1.0e-6

using namespace std;

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

int n, m;
vector<P> e[105];
int d[105][105];


void warshall_floyd()
{
	for (int k = 0; k < n; k++) {
		for (int i = 0; i < n; i++) {
			for (int j = 0; j < n; j++) {
				if (d[i][j] > d[i][k] + d[k][j]) {
					d[i][j] = d[i][k] + d[k][j];
				}
			}
		}
	}

}

int main()
{
	cin >> n >> m;
	int ai, b, c;
	for(int i = 0; i < n; i++){
		for (int j = 0; j < n; j++) {
			d[i][j] = INF;
			if (i == j)d[i][j] = 0;
		}
	}
	for (int i = 0; i < m; i++) {
		cin >> ai >> b >> c;
		ai--; b--;
		e[ai].push_back(P(b, c));
		e[b].push_back(P(ai, c));
		d[ai][b] = c;
		d[b][ai] = c;
	}
	warshall_floyd();

	int ans = 0;
	for (int i = 0; i < n; i++) {
		for (int j = 0; j < e[i].size(); j++) {
			int ope = 0;
			int from = i; int to = e[i][j].first;
			int cost = e[i][j].second;
			for (int s = 0; s < n; s++) {
				for (int t = 0; t < n; t++) {
					if (d[s][from] + cost + d[to][t] == d[s][t]) {
						ope++;
					}
				}
			}
			if (ope == 0)ans++;
		}
	}
	cout << ans / 2 << endl;

	return 0;
}

Measured memory_bytes: 384
#include<stdio.h>

int main(void){
	double r;
	double l,s;
	double f =3.14159265359;
	scanf("%lf",&r);
	
	l = 1.0*2*r*f;
	s = 1.0*r*r*f;
	
	printf("%lf %lf\n",s,l);

	return 0;
}


Measured memory_bytes: 2068
#include <cstdio>

int main(void) {
	int score[2] = { 0 };
	for(int i = 0; i < 2; i++) {
		for(int j = 0; j < 4; j++) {
			int buf;
			scanf("%d", &buf);
			score[i] += buf;
		}
	}
	
	printf("%d\n", score[0] > score[1] ? score[0] : score[1]);
	return 0;
}

Measured memory_bytes: 0
#include <bits/stdc++.h>
#include<cmath>
#define N 100005
#define A 1000005
#define MOD 998244353 //1000000007 // //100000000
#define INF 1000000000000000000
#define ll long long
//#define M_PI 3.141592653589793238463

using namespace std;

#define pii pair<ll, ll>
#define piii pair<ll, pii>
#define ft first
#define sd second
#define pb push_back
#define rep(i, n) for(ll i = 0; i < n; i++)
#define repr(i, n) for(ll i = n-1; i >= 0; i--)
#define itr(it, x) for(auto it = x.begin(); it != x.end(); it++)
#define mem(a, b) memset(a, (ll)b, sizeof(a))
#define all(v) v.begin(), v.end()
#define allr(v) v.rbegin(), v.rend()
#define edge(v, x, y) v[x].pb(y); v[y].pb(x);
#define popcount __builtin_popcount
#define ANS(s) {cout << s << "\n"; return;}

//~~~~~~fancy print~~~~~~~//
#define printpii(a) cout << a.ft << " " << a.sd << endl;
#define printpiii(a) cout << a.ft << " " << a.sd.ft << " " << a.sd.sd << endl;
#define print(a, n) rep(i, n) cout << a[i] << " "; cout << endl;
#define printv(v) for(auto x: v)cout << x << " "; cout << endl;
#define printm(a, n, m) rep(i, n) { rep(j, m) cout << a[i][j] << "\t"; cout << endl;}

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

void fast(){ios_base::sync_with_stdio(false);cin.tie(0);cout << setprecision(12) << fixed;}


void solve(){
    string n, m; cin >> n >> m;
    if(n == m) ANS("EQUAL");
    if(n.size() == m.size()) cout << (n > m? "GREATER" : "LESS");
    else cout << (n.size() > m.size()? "GREATER" : "LESS");
}
main(){
    /*#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
    #endif*/
    fast();
    ll t = 1; //cin >> t;
    while(t--){
        solve();
    }
}


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

namespace ABC150_A
{
    public class Program
    {
        public static void Main(string[] args)
        {
            new Program().Solve(new ConsoleInput(Console.In, ' '));
        }

        public void Solve(ConsoleInput cin)
        {
            // 解答はココに書く
            var k = cin.ReadInt;
            var x = cin.ReadInt;
            var coin = 500;
            Console.Write(coin * k >= x ? "Yes" : "No");
        }
    }

    public class ConsoleInput
    {
        private readonly System.IO.TextReader _stream;
        private char _separator = ' ';
        private Queue<string> inputStream;
        public ConsoleInput(System.IO.TextReader stream, char separator = ' ')
        {
            this._separator = separator;
            this._stream = stream;
            inputStream = new Queue<string>();
        }
        public string Read
        {
            get
            {
                if (inputStream.Count != 0) return inputStream.Dequeue();
                string[] tmp = _stream.ReadLine().Split(_separator);
                for (int i = 0; i < tmp.Length; ++i)
                    inputStream.Enqueue(tmp[i]);
                return inputStream.Dequeue();
            }
        }
        public string ReadLine { get { return _stream.ReadLine(); }}
        public int ReadInt { get { return int.Parse(Read); }}
        public long ReadLong { get { return long.Parse(Read); }}
        public double ReadDouble { get { return double.Parse(Read); }}
        public string[] ReadStrArray(long N) { var ret = new string[N]; for (long i = 0; i < N; ++i) ret[i] = Read; return ret;}
        public int[] ReadIntArray(long N) { var ret = new int[N]; for (long i = 0; i < N; ++i) ret[i] = ReadInt; return ret;}
        public long[] ReadLongArray(long N) { var ret = new long[N]; for (long i = 0; i < N; ++i) ret[i] = ReadLong; return ret;}
    }
}

Measured memory_bytes: 11220
def fact(A): #fact(int)
    c0 = A
    r = 2
    lis = []
    count = 1
    while A != 1:
        if A%r == 0:
            A = A//r
            lis.append(r)
            r = 2
        else:
            r += 1
        if r > int(pow(c0,0.5))+1:
            lis.append(A)
            break
    return(lis)

n = int(input())
mod = 10**9+7

L = [0]*(n+1)
for i in range(1,n+1):
    p = fact(i)
    for q in p:
        L[q] += 1
        
ans = 1
for i in range(1,n+1):
    ans *= L[i] + 1
    ans %= mod
    
print(ans)

Measured memory_bytes: 9456
#include <cstdio>
#include <cstring>
#include <algorithm>
using namespace std;

int main() {
	int amd[31];
	int w,n; scanf("%d%d", &w, &n);
	for(int i = 1; i <= w; i++) amd[i]=i;
	for(int i = 0; i < n; i++) {
		int a,b; scanf("%d,%d", &a, &b);
		swap(amd[a], amd[b]);
	}
	for(int i = 1; i <= w; i++) printf("%d\n",amd[i]);
	return 0;
}

Measured memory_bytes: 0
#include <bits/stdc++.h>
using namespace std;
int main() {
    string s; cin >> s;
    bool ok = false;
    if(s[0] == 'a' && s[1] == 'b' && s[2] == 'c') ok = true;
    else if(s[0] == 'a' && s[1] == 'c' && s[2] == 'b') ok = true;
    else if(s[0] == 'b' && s[1] == 'a' && s[2] == 'c') ok = true;
    else if(s[0] == 'b' && s[1] == 'c' && s[2] == 'a') ok = true;
    else if(s[0] == 'c' && s[1] == 'a' && s[2] == 'b') ok = true;
    else if(s[0] == 'c' && s[1] == 'b' && s[2] == 'a') ok = true;
    if(ok) cout << "Yes" << endl;
    else cout << "No" << endl;
}

Measured memory_bytes: 3624
use std::io;

fn procon_read<T: std::str::FromStr>() ->  Vec<T> {
	let mut buf = String::new();
	io::stdin().read_line(&mut buf).expect("");
	let iter = buf.split_whitespace();
	let mut v: Vec<T> = Vec::new();
	for i in iter {
		v.push(i.parse().ok().unwrap());
	}
	v
}

fn main() {
	let v:Vec<i64> = procon_read();
	let n = v[0];
	let m = v[1];
	let mut a:Vec<i64> = Vec::new();
	let mut b:Vec<i64> = Vec::new();
	let mut c:Vec<i64> = Vec::new();
	let mut d:Vec<i64> = Vec::new();
	for i in 0..n {
		let v:Vec<i64> = procon_read();
		a.push(v[0]);
		b.push(v[1]);
	}
	for i in 0..m {
		let v:Vec<i64> = procon_read();
		c.push(v[0]);
		d.push(v[1]);
	}
	for i in 0..n {
		let mut point = 1;
		let mut mini = (a[i as usize] - c[0]).abs() + (b[i as usize] - d[0]).abs();
		for j in 1..m {
			let cur = (a[i as usize] - c[j as usize]).abs() + (b[i as usize] - d[j as usize]).abs();
			if mini > cur {
				mini = cur;
				point = j + 1;
			}
		}
		println!("{}", point);
	}
	
	
}

Measured memory_bytes: 4352
#include <iostream>
#include <vector>
#include <array>
#include <deque>
#include <stack>
#include <queue>
#include <list>
#include <map>
#include <set>
#include <unordered_map>
#include <unordered_set>
#include <algorithm>
#include <numeric>
#include <utility>
#include <cmath>
#include <iomanip>
#include <cassert>
#include <complex>
#include <bitset>
#include <functional>

using namespace std;
using ll=long long int;

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

    if (n%2 == 1) {
        cout << n/2 << endl;
    } else {
        cout << n/2-1 << endl;
    }

    return 0;
}


Measured memory_bytes: 256
s = input()

cntoz = 0
cntzo = 0
for i in range(len(s)):
	if (i%2) == 0:
		if s[i] == '0':
			cntoz += 1
		else:
			cntzo += 1
	else:
		if s[i] == '0':
			cntzo += 1
		else:
			cntoz += 1
		
print(min(cntoz, cntzo))


Measured memory_bytes: 3188
#include<vector>
#include<iostream>
#define mod 1000000007
using namespace std;
vector<vector<char>>dat;
vector<vector<int>>dp;
int m(int i,int j){
    if(i>=dat.size()||j>=dat[0].size()||dat[i][j]=='#'){
        return 0;
    }
    if(i==dat.size()-1&&j==dat[0].size()-1){
        return 1;
    }
    if(dp[i][j]!=-1){
        return dp[i][j];
    }
    dp[i][j]=0;
    dp[i][j]=((dp[i][j]%mod)+(m(i+1,j)%mod))%mod;
    dp[i][j]=((dp[i][j]%mod)+(m(i,j+1)%mod))%mod;
    return dp[i][j];
}
int main(){
    int a,b;
    cin>>a>>b;
    vector<int>ax(b,-1);
    dp=vector<vector<int>>(a,ax);
    vector<char>aux;
    char d;
    for(int i=0;i<a;i++){
            aux.clear();
        for(int j=0;j<b;j++){
            cin>>d;
            aux.push_back(d);
        }
        dat.push_back(aux);
    }
    cout<<m(0,0)<<endl;
    return 0;

}


Measured memory_bytes: 8644
#define _GLIBCXX_DEBUG
#include<bits/stdc++.h>
#include<algorithm>//next_permutation
#define rep(i,n) for (int i = 0;i < (n);i++)
#define all(v) v.begin(),v.end()
#define dec(n) cout << fixed << setprecision(n);
#define large "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
#define small "abcdefghijklmnopqrstuvwxyz"
using namespace std;
using ll = long long;
using P = pair<ll,ll>;
using vl = vector<ll>;
using vvl = vector<vl>;

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

const ll MOD = 1000000007;
const ll MAX = 2000001;

ll mod(ll a){
  return a % MOD;
}

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

ll fac[MAX], finv[MAX], inv[MAX];

void nCrprep() {
    fac[0] = fac[1] = 1;
    finv[0] = finv[1] = 1;
    inv[1] = 1;
    for (ll i = 2; i < MAX; i++){
        fac[i] = fac[i - 1] * i % MOD;
        inv[i] = MOD - inv[MOD%i] * (MOD / i) % MOD;
        finv[i] = finv[i - 1] * inv[i] % MOD;
    }
}

ll nCr(ll n, ll r){
    if (n < r) return 0;
    if (n < 0 || r < 0) return 0;
    return fac[n] * (finv[r] * finv[n - r] % MOD) % MOD;
}

ll nCrcheep(ll n,ll r){
  if(r == 0) return 1;
  else if(r == 1) return n;
  else return nCrcheep(n-1,r-1)*n/r;
}

vector<pair<ll,ll>> prime_factorize(ll n){
  vector<pair<ll,ll>> res;
  
  for(ll i=2; i*i <= n; i++){
    if(n % i != 0) continue;
    
    ll ex = 0;
    while(n % i == 0){
      ex++;
      n /= i;
    }
    
    res.push_back({i,ex});
  }
  
  if(n != 1) res.push_back({n,1});
  
  return res;
  
}




int main(){
  ll h,w; cin >> h >> w; ll bcnt = 0;
  
  rep(i,h*w){
    char c; cin >> c;
    if(c == '#') bcnt++;
  }
  
  if(bcnt == h+w-1) cout << "Possible" << endl;
  else cout << "Impossible" << endl;
  
  
}

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

#define hell                         1000000007
#define lcm(a,b)                     (a*b)/__gcd(a,b)
#define ll                           long long
#define vll                          vector<ll>
#define vi                           vector<int>
#define pll                          vector< pair<ll,ll> >
#define pb                           push_back
#define mp                           make_pair
#define all(v)                       v.begin(),v.end()
#define lbnd                         lower_bound
#define ubnd                         upper_bound
#define bs                           binary_search
#define F                            first
#define S                            second
#define rep(i,a,b)                   for(i=a;i<b;i++)
#define parr(a,n)                    for(ll it=0;it<n;it++) cout<<a[it]<<" ";cout<<endl;
#define pcont(a)                     for(auto it:a) cout<<it<<" ";cout<<endl;
#define ret(x)                       return cout<<x,0;
#define endl                           '\n'

/*constants*/
#define MAXN                         100005
#define PI                           3.14159265358979323846

/*debug*/
#define TRACE
#ifdef TRACE
#define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
    template <typename Arg1>void __f(const char* name, Arg1&& arg1){ std::cout << name << " : " << arg1 << '\n';}
    template <typename Arg1, typename... Args>void __f(const char* names, Arg1&& arg1, Args&&... args){const char* comma = strchr(names + 1, ','); std::cout.write(names, comma - names) << " : " << arg1<<" | ";__f(comma+1, args...);}
#else
#define trace(...)
#endif

using namespace std;


int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);cout.tie(NULL);
	
	ll i,j,n,m,k,cnt=0,ans=0,t=1;
	cin>>n;
	cout<<3*n*n;	
	
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
//----***やべーやつら***----
using namespace std;
#define int long long

//----***型定義***----
using ll = long long;
using P = pair<int,int>;

//----***Like a Pythonista***----
#define REP(ii,jj,nn) for (ll ii=jj;ii<(nn);ii++)
#define RREP(ii,nn,jj) for (ll ii = nn; jj<ii;ii--)
#define each(i,...) for (auto&& i:__VA_ARGS__)
#define ALL(vec) (vec).begin(),(vec).end()
#define sum(...) accumulate(ALL(__VA_ARGS__),0LL)
#define dsum(...) accumulate(ALL(__VA_ARGS__),0.0)
#define vec(type,name,...) vector<type> name(__VA_ARGS__)
template<class T> inline auto max(const T& a){ return *max_element(ALL(a)); }
template<class T> inline auto min(const T& a){ return *min_element(ALL(a)); }
inline ll gcd(ll a,ll b){if(b == 0) return a;return  gcd(b,a%b);}
inline ll lcm(ll a,ll b){ll g = gcd(a,b);return a / g * b;}

//----***定数***----
#define MOD 1000000007
#define INF 100000000000000000
#define EPS 1e-9
const vector<vector<int>> DXY={{-1,0},{1,0},{0,-1},{0,1}};

//----***パーツ***----
#define fi first
#define se second
#define pb push_back
#define re return
#define br break

//----***入出力***---
void print() { std::cout << "\n"; }
template <class T>void print(const T &x) {std::cout << x<<"\n";}
template <class T, class... Args>void print(const T &x, const Args &... args) {std::cout << x << " ";print(args...);}
#define debug(var)  do{std::cerr << #var << " ↓ "<<"\n";view(var);}while(0);
#define dbg cerr<<"🥺🥺🥺🥺🥺🥺"<<endl;
template<typename T> void view(T e){std::cout << e << std::endl;}
template<typename T> void view(const std::vector<T>& v){for(const auto& e : v){ std::cout << e << " "; } std::cout << std::endl;}
template<typename T> void view(const std::vector<std::vector<T> >& vv){ for(const auto& v : vv){ view(v); } }

//----***初期時読み込み***----
struct initial{initial(){cin.tie(0); ios::sync_with_stdio(0); cout<<fixed<<setprecision(15);};}initial_;

signed main(){
  string S,ans;cin>>S;
  each(c,S){
    if(c=='B'){
      if(ans.size()>0){
        ans.pop_back();
      }
      else{
        continue;
      }
    }
    else{
      ans+=c;
    }
  }
  print(ans);

    

}


Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <algorithm>
#include <functional>
#include <vector>
#include <utility>
#include <cstring>
#include <iomanip>
#include <numeric>
#include <cmath>
#include <queue>
#include <map>
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
const int INF = 1<<30; 
const int MOD = 1e9 + 7;
const int dy[] = {1, 0, -1, 0};
const int dx[] = {0, 1, 0, -1};
const int MAX_N = 60;
struct Info
{
    P left, right;
};
string Rfield[MAX_N];
string Lfield[MAX_N];
bool used[MAX_N][MAX_N][MAX_N][MAX_N];
int h, w, lsy, lsx, rsy, rsx;
bool OutOfRange(int y, int x, string field[])
{
    if(y >= h || x >= w || x < 0 || y < 0 || field[y][x] == '#') return true;
    else return false;
}
bool bfs()
{
    memset(used, false, sizeof(used));
    queue<Info> que;
    que.push({P(lsy, lsx), P(rsy, rsx)});
    while(!que.empty())
    {
        Info p = que.front();
        que.pop();
        if(used[p.left.first][p.left.second][p.right.first][p.right.second]) continue;
        used[p.left.first][p.left.second][p.right.first][p.right.second] = true;
        if(Lfield[p.left.first][p.left.second] == '%' && Rfield[p.right.first][p.right.second] == '%') return true;
        if(Lfield[p.left.first][p.left.second] == '%' || Rfield[p.right.first][p.right.second] == '%') continue;
        for(int i = 0; i < 4; i++)
        {
            int ly = p.left.first;
            int lx = p.left.second;
            int ry = p.right.first;
            int rx = p.right.second;
            if(!OutOfRange(ly + dy[i], lx + dx[i], Lfield)) ly += dy[i], lx += dx[i];
            if(!OutOfRange(ry + dy[i], rx - dx[i], Rfield)) ry += dy[i], rx -= dx[i];
            P np = {ly, lx}, nq = {ry, rx};
            if(!used[ly][lx][ry][rx]) que.push({np, nq});
        }
    }
    return false;
}
int main()
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    while(cin >> w >> h, w | h)
    {
        for(int i = 0; i < h; i++)
        {
            cin >> Lfield[i] >> Rfield[i];
            for(int j = 0; j < w; j++)
            {
                if(Lfield[i][j] == 'L') lsy = i, lsx = j;
                if(Rfield[i][j] == 'R') rsy = i, rsx = j;
            }
        }
        cout << (bfs() ? "Yes" : "No") << endl;
    }
    return 0;
}





Measured memory_bytes: 17484
import java.io.*;
import java.util.*;

class Main
{
    public static void main(String[] args)
    {
        Scanner sc = new Scanner(System.in);
        
        int n = sc.nextInt();
        int[] array = new int[n];
        
        for (int i = 0; i < n ; i++) {
            array[i] = sc.nextInt();
        }
        
        int max = array[0];
        int min = array[0];
        long sum = 0;
        
        for (int i = 0; i < n; i++) {
            if (max < array[i]) {
                max = array[i];
            }
            if (min > array[i]) {
                min = array[i];
            }
            sum += array[i];
        }
        
        System.out.printf("%d %d %d\n", min, max, sum);
    }
}

Measured memory_bytes: 42344
#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <cmath>
#include <queue>
#include <map>
#include <unordered_map>
#include <set>
#include <functional>
#include <bitset>
#include <cassert>
#include <random>
using namespace std;
using ll = long long;


int main() {
	ll n, m; cin >> n >> m;
	vector<pair<ll, ll>> b(n + m);
	for (int i = 0; i < n; i++) {
		cin >> b[i].first;
		b[i].second = 1;
	}
	for (int i = n; i < n + m; i++) cin >> b[i].second >> b[i].first;
	sort(b.rbegin(), b.rend());
	ll cnt = 0, ans = 0;
	for (int i = 0; i < n + m; i++) {
		if (cnt + b[i].second <= n) {
			ans += b[i].first*b[i].second;
			cnt += b[i].second;
		}
		else if (cnt < n) {
			ans += (n - cnt)*b[i].first;
			cnt += n - cnt;
		}
	}
	cout << ans << endl;
	return 0;
}


Measured memory_bytes: 3328
N = int(input())
A = list(map(int, input().split()))
s = sum(A)
c = 0
d = 10000000000000000
a = 0
for i in range(N):
  c += 2*A[i]
  if abs(c - s) < d:
    a = i
    d = abs(c - s)
a1 = sum(A[:(a+1)])
a2 = sum(A[(a+1):])
ans = abs(a1-a2)
print(ans)

Measured memory_bytes: 26220
#include <stdio.h>
#include <algorithm>
using namespace std;

const int N = 1e5+10;
const int INF = 1e9+10;

int n,k,res;
int T[N], DP[N];

int abso(int x){
  return x<0 ? -x : x;
}

int main(){
  scanf("%d%d",&n,&k);
  for(int i=1; i<=n; i++)scanf("%d",&T[i]);
  for(int i=2; i<=n; i++){
    res = INF;
    for(int j=i-1; j>=i-k && j>0; j--)
      res = min(res, DP[j] + abso(T[j]-T[i]));
    DP[i] = res;
  }
  printf("%d\n",DP[n]);

  return 0;
}


Measured memory_bytes: 896
#include<iostream>
#include<math.h>
#include<vector>
#include<algorithm>
#include<string.h>
using namespace std;
#define rep(i,n) for(int i=0;i<n;i++)
typedef long long ll;
int main(){
	int n,m;
	cin>>n>>m;
	vector<int>l(m),r(m);
	rep(i,m){
		cin>>l[i]>>r[i];
	}
	int left=1,right=n;
	rep(i,m){
		if(l[i]>=left){
			left=l[i];
		}
		if(r[i]<=right){
			right=r[i];
		}
	}
	int rslt=right-left+1;
	if (rslt<0) rslt=0;
	cout<<rslt<<endl;

	return 0;
}

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

int main(){

    int N;
    cin >> N;
    vector<int> A(N);

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

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

    for(int i=1;i<N;i++){
        if(A.at(i) == A.at(i-1)){
            cout << "NO";
            break;
        }
        if(i==N-1) cout << "YES";
    }
}




Measured memory_bytes: 1024
#include "bits/stdc++.h"
using namespace std;
using ll = long long;
using vi = vector<int>;
using vii = vector<vector<int>>;
using vl = vector<ll>;
using vll = vector<vector<ll>>;
using pii = pair<int,int>;
#define FOR(i,a,b) for(ll i = (a); i < (b); i++)
#define REP(i,n) FOR(i,0,n)
#define ALL(obj) (obj).begin(), (obj).end()
#define pb push_back
#define double long double
const double pi = acos(-1);
const double EPS = 1e-10;

double crosss(pair<double,double> c,pair<double,double> d){
  return c.first * d.second - d.first * c.second;
}

int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  vector<pair<double,double>> a(4);
  int n;
  pair<double,double> lineab, linecd;
  cin >> n;
  REP(i,n){
    REP(j,4){
      cin >> a[j].first >> a[j].second;
    }
    lineab.first = a[1].first - a[0].first;
    linecd.first = a[3].first - a[2].first;
    lineab.second = a[1].second - a[0].second;
    linecd.second = a[3].second - a[2].second;
    if (fabs(crosss(lineab,linecd)) == 0){
      cout << "YES" << endl;
    } else {
      cout << "NO" << endl;
    }
  }
  
  
  return 0;
}



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

int main(){
  int N;
  cin >> N;
  string ans = "No";
  for (size_t i = 1; i <= 9; i++) {
    for (size_t j = 1; j <= 9; j++) {
      if (N == i* j) {
        ans = "Yes" ;
      }
    }
  }
        cout << ans << '\n';
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define loop2(i, s, n, a) for (int i = int(s); i < int(n); i += a)
#define loop(i, s, n) loop2(i, s, n, 1)
#define rep(i, n) loop(i, 0, n)

#define pb push_back
#define all(in) in.begin(),in.end()

using ll = long long;
using ull = unsigned long long;
using namespace std;

int main(){
    int h, w; cin >> h >> w;
    int cost[10][10]; rep(i,10) rep(j,10) cin >> cost[i][j];
    int data[h][w]; rep(i,h) rep(j,w) cin >> data[i][j];

    rep(k,10) rep(i,10) rep(j,10) cost[i][j] = min(cost[i][j], cost[i][k] + cost[k][j]);

    ll ans = 0;

    rep(i,h) rep(j,w) {
        if(abs(data[i][j]) == 1) continue;
        ans += cost[data[i][j]][1];
    }
    cout << ans << endl;
}



Measured memory_bytes: 3788
#include<iostream>
#include<string>
#include<algorithm>
#include<cmath>
#include<vector>
#include<stack>
#include<cstdio>
using namespace std;
#define rep(i,n) for(int i=0;i<n;i++)

int main(){
    int n;cin>>n;
    int h;
    int max=0;
    int ans=0;
    for(int i=0;i<n;i++){
        cin>>h;
        if(h>=max){
            max=h;
            ans++;
        }
    }
    cout<<ans<<endl;
}



Measured memory_bytes: 256
package main

import (
	"fmt"
)

func main() {
	var n int
	fmt.Scan(&n)
	
	l := make([]int, n)
	
	max := 0
	sum := 0
	for i := range l {
    	fmt.Scan(&l[i])
		sum += l[i]
		if l[i] > max {
			max = l[i]
		}
	}
	sum -= max
	
	if max < sum {
		fmt.Println("Yes")
	} else {
		fmt.Println("No")
	}
}

Measured memory_bytes: 512
#include<bits/stdc++.h>
#include<ext/pb_ds/assoc_container.hpp>
#include<ext/pb_ds/tree_policy.hpp>
#define pi 3.141592653589793238
#define int long long
using namespace __gnu_pbds;
using namespace std;
template <typename T>
using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;


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

#ifndef ONLINE_JUDGE
    if(fopen("INPUT.txt","r"))
    {
    freopen ("INPUT.txt" , "r" , stdin);
    freopen ("OUTPUT.txt" , "w" , stdout);
    }
#endif  

    int n;
    cin>>n;
    int a[n+1];
    for(int i=1;i<=n;i++)
            cin>>a[i];
    int mn=1e10;
    for(int i=-100;i<=100;i++)
    {
        int s=0;
        for(int j=1;j<=n;j++)
        {
            s+=abs(a[j]-i)*abs(a[j]-i);
        }
        mn=min(mn,s);
    }
    cout<<mn;

} 


Measured memory_bytes: 256
from collections import deque
H,W=map(int,input().split())

l=[input() for _ in range(H)]

sx,sy=0,0

black=0
for i in range(H):
  for j in range(W):
    if l[i][j]=='#':
      black+=1

def bfs(sx,sy,l):
  que=deque()
  que.append([sx,sy])
  count=[[-1]*W for _ in range(H)]
  count[sx][sy]=0
  dx=[1,-1,0,0]
  dy=[0,0,1,-1]
  while que:
    x,y=que.popleft()
    if x==H-1 and y==W-1:
      return count[x][y]
    for j in range(4):
      a,b=x+dx[j],y+dy[j]
      if a<0 or a>=H or b<0 or b>=W or count[a][b]!=-1 or l[a][b]=='#':
        continue
      else:
        count[a][b]=count[x][y]+1
        que.append([a,b])
  return 0
print(-1 if bfs(sx,sy,l)==0 else H*W-(bfs(sx,sy,l)+black+1))

Measured memory_bytes: 3316
#include <bits/stdc++.h>
#define _GLIBCXX_DEBUG
#define rep(i,n) for(int i=0;i<(n);++i)
#define repi(i,a,b) for(int i=int(a);i<int(b);++i)
#define all(x) (x).begin(), (x).end()
#define PI 3.14159265358979323846264338327950L
using namespace std;
typedef long long ll;
typedef long double ld;
int main() {
    string s;
    cin>>s;
    int n=s.size(),cnt=0;
    rep(i,n-1){
        if(s[i]!=s[i+1]) cnt++;
    }
    cout<<cnt;
}

Measured memory_bytes: 3736
#include <algorithm>
#include <cmath>
#include <deque>
#include <iostream>
#include <queue>
#include <string>
#include <vector>

#include <boost/multiprecision/cpp_int.hpp>

using namespace std;
using ll = long long;
namespace mp = boost::multiprecision;
using mpint = mp::cpp_int; // 多倍長整数（任意精度）

/*
 * 定数
 */
const long double PI = (acos(-1));
const long double EPS = 1e-10;
const long long INF = 1e18;

/*
 * データ変換 
 */
/* char -> int */
int ctoi(char c) { return (int)(c - '0'); }

/*
 * 数学的な計算
 */
/* 階乗 */
int factorial(int n){ int ret = 1; for(int i = 1; i < n + 1; ++i) { ret = ret * i; } return ret; }

/* 最大公約数 */
template <typename T>T gcd(T x, T y){ return x % y == 0 ? y : gcd(y, x % y); }

/* 最小公倍数 */
template <typename T>T lcm(T a, T b) { return a * b / gcd(a, b); }

/* n個の整数の最小公倍数 */
template <typename T>T lcm_n(vector<T> &numbers) { T l; l = numbers[0]; for(int i = 1; i < numbers.size(); ++i) { l = lcm(l, numbers[i]); } return l; }

/*
 * DP向け
 */
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }

/*
 * グラフ
 */
class Graph {
   public:
    vector<vector<int>> G;
    vector<int> Trans;
    vector<int> inDeg;
    int numV;
 
    Graph(int numV) {
        this->numV = numV;
        inDeg.assign(numV, 0);
        Trans.assign(numV, 0);
        G.assign(numV, vector<int>());
    }
 
    int topologicalSort(int v, vector<int> &dp) {
        if (dp[v] != -1) {
            return dp[v];
        }
 
        int res = 0;
 
        for (auto to : G[v]) {
            chmax(res, topologicalSort(to, dp) + 1);
        }
 
        return dp[v] = res;
    }
};

int main(){
  string S, T;
  cin >> S >> T;

  // TODO: 後ろから探索する
  // ???? で bのときにaaabを生み出すため。
  int fit_index = -1;
  for(int i = S.length() - T.length(); 0 <= i; --i){
    if(0 <= fit_index) break;
    for(int j = 0; j < T.length(); ++j){
      // cout << "i: " << i << ", j: " << j << endl;
      // cout << "S[i+j]: " << S[i+j] << ", T[j]: " << T[j] << endl;
      if(S[i+j] != '?' && S[i+j] != T[j]) break;
      if(j == T.length()-1){
        // cout << "hoge" << endl;
        fit_index = i;
      } 
    }
  }

  // cout << fit_index << endl;
  
  if(fit_index < 0){
    cout << "UNRESTORABLE" << endl;
    return 0;
  }

  for(int i = 0; i < S.length(); ++i){
    if(fit_index <= i && i <= fit_index+T.length()-1){
      S[i] = T[i-fit_index];
      continue;
    }
    if(S[i] == '?'){
      S[i] = 'a';
    }
  }

  cout << S << endl;

  return 0;
}


Measured memory_bytes: 256
// Problem : C - : (Colon)
// Contest : AtCoder - AtCoder Beginner Contest 168
// URL : https://atcoder.jp/contests/abc168/tasks/abc168_c
// Memory Limit : 1024 MB
// Time Limit : 2000 ms
// Powered by CP Editor (https://github.com/cpeditor/cpeditor)

#include<bits/stdc++.h>
using namespace std;
#define PI 3.14159265358979323846264338327950L
int main()
{
	long double a=0,b=0,h=0,m=0;
	cin>>a>>b>>h>>m;
	long double ab=0,length=0;
	ab=abs((long double)(m*6)-(long double)(h*30+m/2.0));
	if(ab>180)
	ab=360-ab;
	length=sqrtl((long double)(a*a+b*b)-(long double)(2*a*b)*(long double)(cosl(ab*PI/180.0)));
	printf("%20.20Lf\n", length);
	return 0;
}


Measured memory_bytes: 4164
W, H, N = map(int,input().split())
x,y=0,0

for _ in range(N):
    xi,yi,a = map(int,input().split())
    if a==1:
        x = max(x,xi)
    elif a==2:
        W = min(xi,W)
    elif a==3:
        y = max(y,yi)
    else:
        H = min(H,yi)

print(0 if x>=W or y>=H else (W-x)*(H-y))


Measured memory_bytes: 3060
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
const auto INF = (ll)1e9;  
using  p = pair<int,int>;
using  v = vector<int>;

int main(){
   string s;
   cin >> s;
   auto ss = map<char,int>();
   for (int i = 0; i < s.size(); i++)
   {
      if(ss[s[i]]!=0){
         cout << "no";
         return 0;
      }
      ss[s[i]]++;
   }

   cout << "yes";
   
}
  

Measured memory_bytes: 256
/* 実行時間1s制限の場合
  10^6 1,000,000   : 余裕をもって間に合う
  10^7 10,000,000  : おそらく間に合う
  10^8 100,000,000 : 非常にシンプルな処理でないと厳しい
 */
#define rep(i, n) for(int i = 0; i < (int)n; i++)
#define repi(i,a,b) for(int i=int(a);i<int(b);++i)
#include <bits/stdc++.h>
using namespace std;

typedef long long ll; // long longはデータモデル(LLP64, LP64, ...)によらず64bit.
ll gcd(ll a, ll b) {return b ? gcd(b, a%b) : a;}  // Greatest Common Divisor ユークリッドの互除法（aが長辺）
vector<pair<ll,int>> factorize(ll n) {            // a,bの公約数 = GCD(a, b)の約数
    vector<pair<ll,int>> res;
    for (ll i = 2; i*i <= n; i++) { // √nまで探せばよい
        if (n%i) continue;
        res.emplace_back(i, 0);     // 割り切れたら
        while (n%i == 0) {
            n /= i;
            res.back().second++;
        }
    }
    if (n != 1) res.emplace_back(n, 1); // この時点で1でなかったら、残りは素数.
    return res;
}
ll lcm(ll a, ll b) {return a/gcd(a,b)*b;}         // Least Commont Multiple オーバーフローしないように先に割る
ll ceil(ll a, ll b) {return (a+b-1)/b;}

const ll INF = LONG_MAX;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }

int main(int argc, char* argv[])
{
#ifdef LOCAL
    // 以降 cin の入力元が 'xxx.txt' になる
    // std::ifstream in(argv[1]);
    //std::cin.rdbuf(in.rdbuf());
    std::ifstream in(string(argv[0]) + ".txt");
    std::cin.rdbuf(in.rdbuf());
#endif

    int n;
    cin >> n;
    int a[200];
    rep(i ,n) cin >> a[i];

    bool is_app = true;
    rep(i, n)
    {
        if (a[i] % 2 == 0)
        {
            if ( (a[i] % 3 == 0) || (a[i] % 5 == 0))
            {
            }
            else
            {
                is_app = false;
            }
        }
    }

    if (is_app) cout << "APPROVED";
    else cout << "DENIED";

    return 0;
}

/*
  - 1e9 : 10^9
  - container一般
    - 合計
      accumulate(a.begin(), a.end(), 0LL)  0LLはオーバーフロー用
  - vector
    vector<int> A(N, 0); // 0で初期化(省略可)
    - loop
      for  (int i = 0; i < A.size(); i++) {}
      for  (int elem : A) {}
    - sort
      std::sort(v.begin(), v.end());  // 昇順
      std::sort(v.begin(), v.end(), std::greater<int>()); //降順
      - vector<vector<int>> cnt(h, vector<int>(w))
    - sort(struct)
        struct st_t {
            string name;
            int p;
            bool operator<(const st_t& another) const {
                if (name == another.name)
                {
                    return p > another.p;
                }
                return name < another.name;
            }
        };
        vector<st_t> st(n);
        sort(st.begin(), st.end());
  - pair
    - pairのソートの定義 : firstが優先的に比較。同じだったらsecond。
    - pair<pair<string,int>,int> p[110];
      std::sort(p,p+a);
        こうすると、first.first -> first.second -> secondの順にソートされる
    - sort
      - sort(a.begin(), cb.end(), greater<pair<int, int>>());
  - map
    - for (auto x : map) {}  // x.first:key  x.second:value.
  - priority_queue<int> q;
    - q.top()に最大値が入っている
  - string
    - loop
      for (char& c : s) {}
 */



Measured memory_bytes: 256
// #define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
#include <boost/multiprecision/cpp_int.hpp>

#define FOR(i, a, b) for (int i = (a); i < int(b); ++i)
#define RFOR(i, a, b) for (int i = (b)-1; i >= int(a); --i)
#define REP(i, n) FOR(i, 0, n)
#define REP1(i, n) FOR(i, 1, int(n) + 1)
#define RREP(i, n) RFOR(i, 0, n)
#define RREP1(i, n) RFOR(i, 1, int(n) + 1)
#define ALL(c) begin(c), end(c)

int _ = (
#ifndef LOCAL
    std::cin.tie(nullptr), std::ios::sync_with_stdio(false),
#endif
    std::cout.precision(10), std::cout.setf(std::ios::fixed));

using ll = long long;
using ull = unsigned long long;
using ld = long double;
template <typename T> using vec = std::vector<T>;
using namespace std;
using namespace boost::multiprecision;

int main() {
  cpp_int A, B;
  cin >> A >> B;
  if (A > B) {
    cout << "GREATER" << endl;
  } else if (A < B) {
    cout << "LESS" << endl;
  } else {
    cout << "EQUAL" << endl;
  }
  return 0;
}


Measured memory_bytes: 3540
#include<iostream>
#include<map>
using namespace std;
typedef long long ll;
int main(){
  ll n,s,e,cnt=0;
  cin >> n;
  ll a[n],sum[n+1];
  map<ll,ll> mp;
  sum[0]=0;
  mp[0]++;
  for(int i=0;i<n;i++){
    cin >> a[i];
    sum[i+1]=sum[i]+a[i];
    mp[sum[1+i]]++;
  }
  for(auto i=mp.begin();i!=mp.end();i++){
    if(i->second>=2){
      cnt += ((i->second)*(i->second-1))/2;
    }
  }
  cout << cnt << endl;
}


Measured memory_bytes: 15872
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); i++)
#define loop(i, x, n) for (int i = (x); i < (n); i++)
#define all(v) (v).begin(), (v).end()
#define int long long
using namespace std;
const int MOD = 1e9 + 7;
const int INF = 1e10;
template<typename T> void cmax(T &a, T b) { a = max(a, b); }
template<typename T> void cmin(T &a, T b) { a = min(a, b); }

signed main() {
  int n;
  cin >> n;

  if (n == 0) {
    cout << 0 << endl;
    return 0;
  }
  string ans = "";
  while (n != 0) {
    //  cout << n % 2 << endl;
    if (n % 2 != 0) {
      n--;
      ans += "1";
    } else {
      ans += "0";
    }
    n /= -2;
  }
  reverse(all(ans));
  cout << ans << endl;

  return 0;
}


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

using namespace std;

int main() {
    int n,q;
    cin >> n >> q;
    vector<queue<int>> Q(n);
    while (q--) {
        int code;
        cin >> code;
        switch (code) {
            case 0: {
                int t,x;
                cin >> t >> x;
                Q[t].push(x);
            } break;
            case 1: {
                int t;
                cin >> t;
                if (Q[t].size()) cout << Q[t].front() << endl;
            } break;
            case 2: {
                int t;
                cin >> t;
                if (Q[t].size()) Q[t].pop();
            }
            break;
        }
    }
    return 0;
}


Measured memory_bytes: 4260
#include <vector>
#include <array>
#include <map>
#include <string>
#include <algorithm>
#include <iostream>
#include <set>
#include <random>
#include <cassert>
#include <fstream>

const int MOD = 1e9 + 7;
using namespace std;
typedef long long ll;
int a[10001];
const int LG = 13;
int rmq[201][5001][LG];
int lg[5001];
int n;
int m;
int b[5001][201];
int calc_rmq(int ticket) {
    for (int i = 1; i <= n; ++i) {
        rmq[ticket][i][0] = i;
    }
    for (int k = 1; k < LG; ++k) {
        for (int i = 1; i + (1 << k) - 1 <= n; ++i) {
            int left = rmq[ticket][i][k - 1];
            int right = rmq[ticket][i + (1 << (k - 1))][k - 1];
            rmq[ticket][i][k] =
                (b[left][ticket] < b[right][ticket] ? right : left);
        }
    }
}
int get_rmq(int ticket, int l, int r) {
    int k = lg[r - l + 1];
    int left = rmq[ticket][l][k];
    int right = rmq[ticket][r - (1 << k) + 1][k];
    return b[left][ticket] < b[right][ticket] ? right : left;
}
ll rect[5001][5001];
void add_rectangle(int lx, int rx, int ly, int ry, int val) {
//    cout << lx << " " << rx << " " << ly << " " << ry << " " << val << endl;
    rect[lx][ly] += val;
    if (rx < n) {
        rect[rx + 1][ly] -= val;
    }
    if (ry < n) {
        rect[lx][ry + 1] -= val;
        if (rx < n) {
            rect[rx + 1][ry + 1] += val;
        }
    }
}

void rec(int ticket, int l, int r) {
    if (l > r) {
        return;
    }
    if (l == r) {
        add_rectangle(l, l, l, l, b[l][ticket]);
        return;
    }
    int opt = get_rmq(ticket, l, r);
//    cout << ticket << " " << l << " " << r << " " << opt << endl;
    add_rectangle(l, opt, opt, r, b[opt][ticket]);
    rec(ticket, l, opt - 1);
    rec(ticket, opt + 1, r);
}
ll pref[10001];
ll dist[10001];
int main() {
    std::ios_base::sync_with_stdio(false);
    std::cin.tie(nullptr);
    std::cout.tie(nullptr);
    cin >> n;
    cin >> m;
    for (int i = 1; i < n; ++i) {
        cin >> a[i];
        dist[i + 1] = dist[i] + a[i];
    }
    for (int i = 1; i <= n; ++i) {
        for (int j = 1; j <= m; ++j) {
            cin >> b[i][j];
        }
    }
    for (int i = 1; i <= m; ++i) {
        calc_rmq(i);
    }
    lg[1] = 0;
    for (int i = 2; i <= n; ++i) {
        lg[i] = lg[i >> 1] + 1;
    }
    for (int ticket = 1; ticket <= m; ++ticket) {
        rec(ticket, 1, n);
    }
    ll ans = 0;
    for (int j = 1; j <= n; ++j) {
        ll cur = 0;
        for (int i = 1; i <= j; ++i) {

            cur += rect[i][j];
            pref[i] += cur;
//            cout <<"dp "<< i << " " << j << " " << pref[i] << endl;
            ans = max(ans, pref[i] - dist[j] + dist[i]);
        }
    }
    cout << ans;
}



Measured memory_bytes: 249344
void main()
{
    long[] tmp = rdRow;
    long n = tmp[0], k = tmp[1];

    long result = (n / k) ^^ 3;
    if (!(k & 1))
    {
        result += ((n + k / 2) / k) ^^ 3;
    }

    result.writeln;
}

enum long mod = 10^^9 + 7;
enum long inf = 1L << 60;

T rdElem(T = long)()
if (!is(T == struct))
{
    return readln.chomp.to!T;
}

alias rdStr = rdElem!string;
alias rdDchar = rdElem!(dchar[]);

T rdElem(T)()
if (is(T == struct))
{
    T result;
    string[] input = rdRow!string;
    assert(T.tupleof.length == input.length);
    foreach (i, ref x; result.tupleof)
    {
        x = input[i].to!(typeof(x));
    }
    return result;
}

T[] rdRow(T = long)()
{
    return readln.split.to!(T[]);
}

T[] rdCol(T = long)(long col)
{
    return iota(col).map!(x => rdElem!T).array;
}

T[][] rdMat(T = long)(long col)
{
    return iota(col).map!(x => rdRow!T).array;
}

void wrMat(T = long)(T[][] mat)
{
    foreach (row; mat)
    {
        foreach (j, compo; row)
        {
            compo.write;
            if (j == row.length - 1) writeln;
            else " ".write;
        }
    }
}

import std.stdio;
import std.string;
import std.array;
import std.conv;
import std.algorithm;
import std.range;
import std.math;
import std.numeric;
import std.traits;
import std.container;
import std.functional;
import std.typecons;
import std.ascii;
import std.uni;

Measured memory_bytes: 256
s = input()
n = len(s)-1
ans = 0
for i in range(2**n):
    op = [0]*n
    for j in range(n):
        if ((i >> j) & 1):
            op[j] = 1
    t = s[0]
    for j in range(1,n+1):
        if op[j-1] == 1:
            t += '+' + s[j:j+1]
        else:
            t += s[j:j+1]
    ans += sum(list(map(int,t.split('+'))))
print(ans)

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

using namespace std;

bool cek(string s) {
  if (s.size() & 1)
    return false;
  int len = (s.size() / 2);
  for (int i = 0; i < len; i++) {
    if (s[i] != s[len + i])
      return false;
  }
  return true;
}

int main() {
  int n;
  string s;
  cin >> n;
  cin >> s;
  if (cek(s))
    cout << "Yes\n";
  else
    cout << "No\n";
  return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
const int64_t INF=9999999999999999;

int main() {
  int N;
  cin>>N;
  vector<int>a(N);
  for(int i=0;i<N;i++){
     cin>>a[i];
  }
  set <int> k;int count=0;
  for(int i=0;i<N;i++){
     if(a[i]<3200){k.insert(a[i]/400);}
     else{count++;}
  }
  int Max=k.size()+count;
  int Min=1;
  
  if(k.size()>0){Min=k.size();}
  
  cout<<Min<<" "<<Max<<endl;
return 0;}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); i++)
typedef long long ll;
using namespace std;
int main()
{
  int N, M;
  cin >> N;
  map<string, int> m;
  rep(i, N)
  {
    string tmp;
    cin >> tmp;
    m[tmp]++;
  }
  cin >> M;
  rep(i, M)
  {
    string tmp;
    cin >> tmp;
    m[tmp]--;
  }
  int ans = -10000;
  for (auto a : m)
  {
    ans = max(ans, a.second);
  }
  if (ans < 0)
  {
    cout << 0 << endl;
  }
  else
  {
    cout << ans << endl;
  }
  return 0;
}

Measured memory_bytes: 256
#[allow(unused_imports)]
use std::cmp::*;
#[allow(unused_imports)]
use std::collections::*;
use std::io::{Write, BufWriter};
// https://qiita.com/tanakh/items/0ba42c7ca36cd29d0ac8
macro_rules! input {
    ($($r:tt)*) => {
        let stdin = std::io::stdin();
        let mut bytes = std::io::Read::bytes(std::io::BufReader::new(stdin.lock()));
        let mut next = move || -> String{
            bytes
                .by_ref()
                .map(|r|r.unwrap() as char)
                .skip_while(|c|c.is_whitespace())
                .take_while(|c|!c.is_whitespace())
                .collect()
        };
        input_inner!{next, $($r)*}
    };
}

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

macro_rules! read_value {
    ($next:expr, [graph1; $len:expr]) => {{
        let mut g = vec![vec![]; $len];
        let ab = read_value!($next, [(usize1, usize1)]);
        for (a, b) in ab {
            g[a].push(b);
            g[b].push(a);
        }
        g
    }};
    ($next:expr, ( $($t:tt),* )) => {
        ( $(read_value!($next, $t)),* )
    };
    ($next:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($next, $t)).collect::<Vec<_>>()
    };
    ($next:expr, chars) => {
        read_value!($next, String).chars().collect::<Vec<char>>()
    };
    ($next:expr, usize1) => (read_value!($next, usize) - 1);
    ($next:expr, [ $t:tt ]) => {{
        let len = read_value!($next, usize);
        read_value!($next, [$t; len])
    }};
    ($next:expr, $t:ty) => ($next().parse::<$t>().expect("Parse error"));
}

#[allow(unused)]
macro_rules! debug {
    ($($format:tt)*) => (write!(std::io::stderr(), $($format)*).unwrap());
}
#[allow(unused)]
macro_rules! debugln {
    ($($format:tt)*) => (writeln!(std::io::stderr(), $($format)*).unwrap());
}

fn solve() {
    let out = std::io::stdout();
    let mut out = BufWriter::new(out.lock());
    macro_rules! puts {
        ($($format:tt)*) => (let _ = write!(out,$($format)*););
    }
    input! {
        l: i64, r: i64, d: i64,
    }
    puts!("{}\n", r / d - (l - 1) / d);
}

fn main() {
    // In order to avoid potential stack overflow, spawn a new thread.
    let stack_size = 104_857_600; // 100 MB
    let thd = std::thread::Builder::new().stack_size(stack_size);
    thd.spawn(|| solve()).unwrap().join().unwrap();
}


Measured memory_bytes: 2208
import sys

sys.setrecursionlimit(10**7)

n = int(input())
a = list(map(int, input().split()))
if 0 in a:
    print(0)
    sys.exit(0)
ans = 1
for i in range(n):
    ans *= a[i]
    if ans > 10**18:
        print(-1)
        sys.exit(0)
print(ans)

Measured memory_bytes: 84488
#include<bits/stdc++.h>
 
#define lli long long int
#define llu unsigned long long int
#define ld long double
#define all(v) v.begin(),v.end()
#define pb push_back
#define mp make_pair
#define F first
#define S second
#define si(n) scanf("%d",&n)
#define slli(n) scanf("%lld",&n);
#define ss(n) scanf("%s",n);
 
const long double EPS = 1e-10;
const lli MOD = 1000000007ll;
const lli mod1 = 1000000009ll;
const lli mod2 = 1100000009ll;
int INF = (int)1e9;
lli INFINF = (lli)1e18;
int debug = 0;
 
using namespace std;
 
void print(int a[],int s,int e){for(int i=s;i<=e;i++)cout<<a[i]<<" ";cout<<"\n";}
void print(vector<int> &v,int s,int e){for(int i=s;i<=e;i++)cout<<v[i]<<" ";cout<<"\n";}
void print(vector<int> &v){for(int x:v)cout<<x<<" ";cout<<"\n";}
 
lli bit_count(lli _x){lli _ret=0;while(_x){if(_x%2==1)_ret++;_x/=2;}return _ret;}
lli bit(lli _mask,lli _i){return (_mask&(1<<_i))==0?0:1;}
lli powermod(lli _a,lli _b,lli _m){lli _r=1;while(_b){if(_b%2==1)_r=(_r*_a)%_m;_b/=2;_a=(_a*_a)%_m;}return _r;}
lli add(lli a,lli b,lli m=MOD){lli x=a+b;while(x>=m)x-=m;return x;}
lli sub(lli a,lli b,lli m=MOD){lli x=a-b;while(x<0)x+=m;return x;}
lli mul(lli a,lli b,lli m=MOD){lli x=a*b;x%=m;return x;}
 
 
 
int main()
{
    srand (time(NULL));
 
    lli A,B,C;
    cin>>A>>B>>C;
    if(A%2==0 || B%2==0 || C%2==0){
        cout<<0;
        return 0;
    }
    cout<<min(min(A*B,B*C),C*A);
 
    return 0;
}

Measured memory_bytes: 256
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <map>
#include <vector>
#include <algorithm>
#include <functional>
using namespace std;

int main() {
	int N, dummy;
	dummy = scanf("%d", &N);

	vector<char> vc;

	int sho;
	int amr;
	while (N) {
		sho = N / -2;
		amr = N % -2;
		if (amr == -1) {
			sho++;
			amr = 1;
		}
		vc.push_back(amr);

		N = sho;
	}

	auto end = vc.rend();
	for (auto itr = vc.rbegin(); itr != end; itr++) {
		printf("%d", *itr);
	}

	if (vc.size() == 0) printf("0\n");
		
	return 0;
}


Measured memory_bytes: 256
// #define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define rep(i, n) for (int i = 0; i < n; ++i)
#define REP(i, n) for (int i = 0; i < n; ++i)
#define range(i,a,b) ((a)<=(i) && (i)<(b))
#define debug(x) cout << #x << ' ' << '=' << ' ' << (x) << endl;
#define fs first
#define sc second
#define pb push_back
#define eb emplace_back
typedef long long ll;
typedef pair<ll, ll> P;
typedef tuple<ll, ll, ll> T;
typedef vector<ll> vec;
typedef vector<P> pvec;
typedef vector<vector<ll>> vvec;
typedef vector<vector<P>> pvvec;
typedef priority_queue<ll> PQI;
typedef priority_queue<P> PQP;
typedef priority_queue<ll,vector<ll>,greater<ll>> PQIG;
typedef priority_queue<P,vector<P>,greater<P>> PQPG;
const vector<int> dx = {0, -1, 0, 1, 1, 1, -1, -1};
const vector<int> dy = {1, 0, -1, 0, 1, -1, 1, -1};
const int MOD = (1000000007);
// const int MOD = (998244353);
// const int INF = (1 << 30); // 1073741824
const int INF = (1LL << 60); // 1152921504606846976
const double EPS = (1 >> 30);
template<class T> inline bool chmin(T& a, T b) {if (a > b) {a = b; return 1;} return 0;}
template<class T> inline bool chmax(T& a, T b) {if (a < b) {a = b; return 1;} return 0;}
template< typename T1, typename T2 > istream &operator>>(istream &is, pair< T1, T2 > &p) { is >> p.first >> p.second; return is; }



signed main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout << fixed << setprecision(15);
    //---------------------------------------------
    
    int n;
    cin>>n;
    vector<int> a(n);
    REP(i,n) cin >> a[i];
    reverse(all(a));
    
    // rep(i,n) cout<<a[i]<<" "; cout<<endl;

    int mi=2,ma=2;
    int nextma,nextmi,k;
    int ng=0;
    if(a[0]!=2) ng++;
    for(int i=0;i<n;i++){
        if(ma<a[i]) ng++;
        nextma=(ma/a[i]+1)*a[i]-1;
        k=mi/a[i];
        if(mi%a[i]!=0) k++;
        nextmi=k*a[i];
        if(nextma<mi) ng++;
        if(nextmi>ma) ng++;
        if(nextmi<mi||nextma<ma) ng++;
        mi=nextmi; ma=nextma;
    }
    if(ng>0) cout<<-1<<endl;
    else{
        cout<<mi<<" "<<ma<<endl;
    }
}

Measured memory_bytes: 1024
#include <stdio.h>

int calc_ds(int i) {
    int ds=0;
    while(10*i/10) {
        ds += i%10;
        i /= 10;
    }
    return ds;
}

int main() {
    int N;
    scanf("%d", &N);

    if(N%calc_ds(N)) printf("No\n");
    else printf("Yes\n");

    return 0;

}

Measured memory_bytes: 128