akhauriyash/Code-Regression huggingface dataset:
#define _USE_MATH_DEFINES
#include "bits/stdc++.h"
using namespace std;
#define FOR(i,j,k) for(int (i)=(j);(i)<(int)(k);++(i))
#define rep(i,j) FOR(i,0,j)
#define each(x,y) for(auto &(x):(y))
#define mp make_pair
#define MT make_tuple
#define all(x) (x).begin(),(x).end()
#define debug(x) cout<<#x<<": "<<(x)<<endl
#define smax(x,y) (x)=max((x),(y))
#define smin(x,y) (x)=min((x),(y))
#define MEM(x,y) memset((x),(y),sizeof (x))
#define sz(x) (int)(x).size()
#define RT return
#define vv(a,b,c,d) vector<vector<a> >(b,vector<a>(c,d))
#define vvv(a,b,c,d,e) vector<vector<vector<a> > >(b,vv(a,c,d,e))
using ll = long long;
using pii = pair<int, int>;
using vi = vector<int>;
using vll = vector<ll>;

int N, K, A[5001];
bool g[5001][5001], h[5001][5001];

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout << fixed << setprecision(20);

    cin >> N >> K;
    rep(i, N)cin >> A[i];
    g[0][0] = h[N][0] = 1;
    rep(i, N)rep(j, K)if (g[i][j]) {
        if (j + A[i] < K)g[i + 1][j + A[i]] = 1;
        g[i + 1][j] = 1;
    }
    for (int i = N; i >= 1; --i)rep(j, K)if (h[i][j]) {
        if (j + A[i - 1] < K)h[i - 1][j + A[i - 1]] = 1;
        h[i - 1][j] = 1;
    }

    int ans = 0;
    rep(i, N)if (A[i] < K) {
        int y = K - 1;
        ans++;
        rep(x, K)if (g[i][x]) {
            while (y >= 0 && (!h[i + 1][y] || x + y >= K))y--;
            if (y >= 0 && x + y >= K - A[i]) {
                ans--;
                break;
            }
        }
    }
    cout << ans << endl;
}

Measured memory_bytes: 49152
#include<bits/stdc++.h>
using namespace std;
bool comp(pair<long long int,long long int>a,pair<long long int,long long int>b)
{
    if(a.first==b.first)
    {
        if(a.second<=b.second)
        return true;
        else
        return false;
    }
    if(a.first>b.first)
    return true;
    else return false;
}
bool rev(long long int a,long long int b)
{
    if(a>b)return true;
    else return false;
}
bool compa(pair<string,pair<int,int>>a,pair<string,pair<int,int>>b)
{
    if(a.first==b.first)
    {
        if(a.second.first>b.second.first)
        return true;
        else
        return false;
    }
    if(a.first<b.first)
    return true;
    else 
    return false;
}
long long int gcd(long long int bdda,long long int chota)
{
    if(chota==0)
        return bdda;
    return gcd(chota,bdda%chota);
}
void solve()
{
    long long int n;
    cin>>n;
    long long int a[n];
    for(long long int i=0;i<n;i++)
    cin>>a[i];
    long long int ans=0;
    for(long long int i=0;i<n;i++)
    {
        while(a[i]%2==0)
        {
            a[i]/=2;
            ans++;
        }
    }
    cout<<ans;
}
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int t;    
    t=1;

    //cin>>t;
    while(t--)
    {
        solve();
    }
}


Measured memory_bytes: 3720
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll INF = 1e18;
const ll MOD = 1e9 + 7;
#define all(v) v.begin(), v.end()
#define repi(i, n, init) for (ll i = init; i < (n); i++)
#define repd(i, n, init) for (ll i = (n); i >= init; i--)
#define repm(i, m) for (auto i = m.begin(); i != m.end(); i++)
#define repb(bit, n, init) for (ll bit = init; bit < (1 << n); ++bit)

int main()
{
    ll a, b;
    cin >> a >> b;
    cout << a / b << " " << a % b << " " << fixed << setprecision(10) << 1. * a / b << endl;
    return 0;
}


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

int main() {
	int a, b;
	while (cin >> a >> b,a,b) {
		int s = 0;

		if (a < b) { swap(a, b); }
		while (b!=0) {
				int c = a%b;
				a = b;
				b = c;
				s++;			
		}
		cout << a << ' ' << s << endl;
	}
	return 0;
}

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

#define mp make_pair
#define pb push_back

using namespace std;

typedef int32_t i32;
typedef uint32_t u32;
typedef int64_t i64;
typedef uint64_t u64;
typedef pair<int,int> pii;
typedef vector<int> vi;

const int MAX_N = 100000;
int n, m;
bool odd[MAX_N];

int main()
{
  cin >> n >> m;
  fill_n(odd,n,false);
  int a,b;
  for (int i = 0; i < m; i++) {
    cin >> a >> b;
    odd[a-1] = !odd[a-1];
    odd[b-1] = !odd[b-1];
  }
  if (all_of(odd,odd+n,[](bool b) { return !b; }))
    cout << "YES" << endl;
  else
    cout << "NO" << endl;

  return 0;
}


Measured memory_bytes: 892
#include <bits/stdc++.h>
 
using namespace std;
 
#define xx         first
#define yy         second
#define pb         push_back
#define mp         make_pair
#define LL         long long
#define inf        INT_MAX/3
#define mod        1000000007ll
#define PI         acos(-1.0)
#define linf       (1ll<<60)-1
#define FOR(I,A,B) for(int I = (A); I < (B); ++I)
#define REP(I,N)   FOR(I,0,N)
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define ALL(A)     ((A).begin(), (A).end())
#define set0(ar)   memset(ar,0,sizeof ar)
#define vsort(v)   sort(v.begin(),v.end())
#define setinf(ar) memset(ar,126,sizeof ar)
 
//cout << fixed << setprecision(20) << p << endl;
 
template <class T> inline T bigmod(T p,T e,T M){
    LL ret = 1;
    for(; e > 0; e >>= 1){
        if(e & 1) ret = (ret * p) % M;
        p = (p * p) % M;
    } return (T)ret;
}
template <class T> inline T gcd(T a,T b){if(b==0)return a;return gcd(b,a%b);}
template <class T> inline T modinverse(T a,T M){return bigmod(a,M-2,M);}


int main(){
	ios_base::sync_with_stdio(false);
    cin.tie(NULL);
	
	string s;
	cin>>s;
	
	set<char>al;
	for(char c:s){
		al.insert(c);
	}
	string ans="None";
	for(char c='a';c<='z';c++){
		if(al.count(c)==0){
			ans=c;
			break;
		}
	}
	cout<<ans<<endl;
	return 0;
}


Measured memory_bytes: 512
n = int(input())

if n < 10:
    print(n)
elif 10<=n and n<100:
    print(9)
elif 100<=n and n<1000:
    print(9+n-99)
elif 1000<=n and n <10000:
    print(909)
elif 10000<=n and  n<100000:
    print(909+n-9999)
elif n==100000:
    print(90909)

Measured memory_bytes: 3060
#include <bits/stdc++.h>
using namespace std;
using lint = long long int;
template<class T = int> using V = vector<T>;
template<class T = int> using VV = V< V<T> >;
template<class T> void assign(V<T>& v, int n, const T& a = T()) { v.assign(n, a); }
template<class T, class... Args> void assign(V<T>& v, int n, const Args&... args) { v.resize(n); for (auto&& e : v) assign(e, args...); }


struct Monoid {
  using T = int;
  static T op(const T& lhs, const T& rhs) { return min(lhs, rhs); }
  static constexpr T e() { return numeric_limits<int>::max(); }
};

template<class Monoid> struct SegmentTree {
  using T = typename Monoid::T;

  const int n;
  V<T> val;

  SegmentTree(int n) : n(n), val(2 * n, Monoid::e()) {}
  template<class Itr> SegmentTree(Itr first, Itr last) : n(distance(first, last)), val(2 * n, Monoid::e()) {
    copy(first, last, next(begin(val), n));
    build();
  }

  T& at(int i) { return val[i + n]; }

  void build() {
    for (int i = n - 1; i > 0; --i) val[i] = Monoid::op(val[2 * i], val[2 * i + 1]);
  }

  T get(int l, int r) const {
    T resl = Monoid::e(), resr = Monoid::e();
    for (l += n, r += n; l < r; l >>= 1, r >>= 1) { 
      if (l & 1) resl = Monoid::op(resl, val[l++]); 
      if (r & 1) resr = Monoid::op(val[--r], resr);
    }
    return Monoid::op(resl, resr);
  }

  void set(int i, const T& a) {
    for (val[i += n] = a, i >>= 1; i > 0; i >>= 1) val[i] = Monoid::op(val[2 * i], val[2 * i + 1]);
  }
};

int main() {
  cin.tie(nullptr); ios::sync_with_stdio(false);
  int n, q; cin >> n >> q;
  SegmentTree<Monoid> st(n);
  for (int i = 0; i < q; ++i) {
    int c, x, y; cin >> c >> x >> y;
    if (!c) st.set(x, y);
    else cout << st.get(x, y + 1) << '\n';
  }
}


Measured memory_bytes: 3612
n = int(input())
t = list(map(int, input().split()))
m = int(input())
px = [list(map(int, input().split())) for _ in range(m)]
for i in range(m):
    p, x = px[i][0], px[i][1]
    p -= 1
    cnt = 0
    for j in range(n):
        if p == j:
            cnt += x
        else :
            cnt += t[j]
    print(cnt)


Measured memory_bytes: 9196
from collections import deque
H,W = map(int,input().split())
C = [list(input()) for _ in range(H)]
# スタートの位置
sy,sx = 0,0
# ゴールの位置
gy,gx = H-1,W-1

INF = 1000000
# スタート、ゴールを除く.の数
nulcnt = -2

# . をすべてINFにしながら、.の数を数える（スタート、ゴール除く）
for y in range(H):
    for x in range(W):
        if C[y][x] == '.':
            nulcnt += 1
            C[y][x] = INF

def bfs(C,sy,sx,gy,gx):
    # スタート地点をqueに入れ、距離を０に
    que = deque([[sy,sx]])
    C[sy][sx] = 0

    while que:
        y,x = que.popleft()
        if [y,x] == [gy,gx]:
            # スタートからゴールまでの最短経路数を返す
            return C[gy][gx]
        for dy,dx in [[1,0],[0,1],[-1,0],[0,-1]]:
            ny = y + dy
            nx = x + dx
            if (0 <= ny < H) and (0 <= nx < W):
                if C[ny][nx] != '#' and (C[ny][nx] > C[y][x] + 1):
                    que.append([ny,nx])
                    C[ny][nx] = C[y][x] + 1
    # ゴールにたどりつけなかった
    return -1

saitan = bfs(C,sy,sx,gy,gx)

if saitan != -1:
    print(nulcnt - saitan + 1)
else:
    print(-1)


Measured memory_bytes: 3316
from heapq import heappush, heappop

INF = 10**15

def dijkstra(s, edges):
    n = len(edges)
    que = []
    d = [INF] * n
    prev = [-1] * n
    d[s] = 0
    heappush(que, (0, s))

    while len(que) > 0:
        (c, v) = heappop(que)
        if d[v] < c:
            continue
        for (cc, w) in edges[v]:
            if d[w] > d[v] + cc:
                d[w] = d[v] + cc
                prev[w] = v
                heappush(que, (d[w], w))

    return d, prev

n, m = map(int, input().split())
edges = [[] for i in range(n)]
for i in range(m):
    ui, vi = map(int, input().split())
    ui, vi = vi-1, ui-1
    edges[ui].append((1, vi))
    edges[vi].append((1, ui))

d, prev = dijkstra(0, edges)
print('Yes')
for i in range(1, n):
    print(prev[i]+1)


Measured memory_bytes: 112028
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(n);i++)
#define repi(i, n) for (int i = 0; i <= (n); i++)
#define all(x) (x).begin(), (x).end()
typedef long long ll;
using namespace std;

struct P {
    int x;
    int y;
};

int main() {
	int N;
	cin >> N;
	vector<vector<P>> w(N);

  rep(i,N){
		int A = 0;
		cin >> A;
		rep(a,A){
			int x,y;
			cin >> x >> y;
			x--;
			w[i].push_back({x,y});
		}
	}

	int ans = 0;
	rep(i,pow(2,N)){
		bool syouziki = true;
		rep(k,N){
				if(bitset<16>(i)[k] == 0) continue;
				for(auto e:w[k]){
				int x = e.x;
				int y = e.y;
				if(y != bitset<16>(i)[x]){
					syouziki = false;
					break;
				}
			}
		}
		if(syouziki) ans = max(ans,(int)bitset<16>(i).count());
	}
	cout << ans << endl;
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>

int main() {
  unsigned N, D;
  std::cin >> N >> D;
  std::vector<unsigned> d(N + 1);
  for (unsigned i = 1; i < N + 1; ++i) {
    std::cin >> d[i];
  }
  unsigned Q;
  std::cin >> Q;
  std::vector<unsigned> q(Q);
  for (unsigned i = 0; i < Q; ++i) {
    std::cin >> q[i];
  }
  std::vector<unsigned> unreachable(N + 2);
  unreachable[N + 1] = 1;
  for (unsigned i = N; i > 0; --i) {
    if (unreachable[i + 1] * 2 > d[i]) {
      unreachable[i] = unreachable[i + 1] + d[i];
    } else {
      unreachable[i] = unreachable[i + 1];
    }
  }
  std::vector<bool> ok(N + 1);
  unsigned pos = D;
  for (unsigned i = 1; i <= N; ++i) {
    ok[i] = unreachable[i + 1] <= pos;
    if (pos >= d[i]) { pos -= d[i]; }
    else if (d[i] - pos < pos) { pos = d[i] - pos; }
  }
  for (unsigned i = 0; i < Q; ++i) {
    std::cout << (ok[q[i]] ? "YES" : "NO") << std::endl;
  }
  return 0;
}

Measured memory_bytes: 9600
//#pragma GCC target ("avx2,sse2")
//#pragma GCC optimization ("Ofast")
//#pragma GCC optimization ("unroll-loops")
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;

#define ordered_set tree <pair <ll, int>, null_type, less <pair <ll, int> >, rb_tree_tag, tree_order_statistics_node_update>
#define ll long long
#define ull unsigned long long
#define db double
#define pb push_back
#define pf push_front
#define ppb pop_back
#define ppf pop_front
#define fi first
#define se second
#define mp make_pair
#define up_b upper_bound
#define low_b lower_bound
#define sz(x) (int)(x).size()
#define all(x) (x).begin(), (x).end()
#define endl "\n"

#define left fsdsdfoisf
#define sum dpsdfioppsf
#define assign xcvjlkdjfio
#define trie fksdfkjkfnjuiv
#define next sidlfjsfkl
#define merge sdfksdkfsldf

#define int long long

using namespace std;

void dout() {
    cerr << endl;
}
template <typename Head, typename... Tail>
void dout(Head H, Tail... T) {
    cerr << H << ' ';
    dout(T...);
}

//mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
typedef pair <int, int> pii;

const int N = 16;
int n, a[N][N], cost[(1 << N)], dp[(1 << N)];

void solve(int tc) {
    // check for (int i = 0; i < n; j++)
    cin >> n;
    for (int i = 0; i < n; i++) {
        for (int j = 0; j < n; j++) {
            cin >> a[i][j];
        }
    }
    for (int mask = 0; mask < (1 << n); mask++) {
        int res = 0;
        for (int i = 0; i < n; i++) {
            if (mask & (1 << i)) {
                for (int j = i + 1; j < n; j++) {
                    if (mask & (1 << j)) {
                        res += a[i][j];
                    }
                }
            }
        }
        cost[mask] = res;
    }
    for (int mask = 0; mask < (1 << n); mask++) {
        dp[mask] = cost[mask];
        for (int s = mask; s > 0; s = (s - 1) & mask) {
            dp[mask] = max(dp[mask], dp[s] + dp[mask ^ s]);
        }
    }
    cout << dp[(1 << n) - 1];
}

signed main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
//    freopen("input.txt", "r", stdin);
//    freopen("output.txt", "w", stdout);
    int tc = 1;
//    cin >> tc;
    for (int i = 0; i < tc; i++) {
        solve(i);
//        cleanup();
    }
}


Measured memory_bytes: 1280
s = input()
mmyy = (1 <= int(s[:2]) <= 12)
yymm = (1 <= int(s[2:]) <= 12)
if mmyy:
  if yymm:
    print('AMBIGUOUS')
  else:
    print('MMYY')
else:
  if yymm:
    print('YYMM')
  else:
    print('NA')

Measured memory_bytes: 9108
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
using namespace std;
using namespace __gnu_pbds;
/******************************************
* AUTHOR : PANDRAVISAM SHIVA SANTHOSH *
* Handle : santhosh_80 *
* INSTITUTION : IIT Palakkad *
******************************************/
typedef tree<int,null_type,less<int>,rb_tree_tag,
tree_order_statistics_node_update> indexed_set;
#define ll long long int 
#define mod 1000000007
#define rep(i,a,b) for(int i=a;i<b;i++)
#define pii pair<int,int>
#define all(v) (v).begin(),(v).end()
#define S(x) scanf("%d",&(x))
#define P(x) printf("%d\n",(x))
#define Sl(x) scanf("%lld",&(x))
#define Pl(x) printf("%lld\n",(x))
#define pb push_back
#define f first
#define s second


int main() {
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	int n,k;cin >> n  >> k ;
	ll min_sum[n+2] = {0};
	ll max_sum[n+2] = {0};
	ll count = 1;
	for(ll i = 0; i <= n; i++){
		if(count == 0){
			min_sum[count] = 0;
		}
		else{
			min_sum[count] = i + min_sum[count-1] ;
		}
		count++;
	}
	count= 1; 
	for(ll i = n ; i >= 0 ; i--){
		if(count == 1){
			max_sum[count] = i;
		}
		else{
			max_sum[count] = i + max_sum[count-1] ;
		}
		count++;
	}
	ll ans = 0;

	for(int i = k ; i <= (n+1) ; i++){
		ans = (ans + max_sum[i] - min_sum[i] + 1) %mod ;
		//cout << ans << '\n' ;
	}
	cout << ans ;

 	return 0;
}

Measured memory_bytes: 6768
#include <stdio.h>
#include <string>
#include <stdlib.h>
#include<vector>
#include<iostream>
#include<set>
#include<map>
#include<algorithm>
using namespace std;




int main() {
	int n;
	cin >>n ;
	n++;
	cout << n/2 << endl;
	
    return 0;
}


Measured memory_bytes: 888
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>

using namespace std;

int main()
{
	const int max = 200001;
	vector<int> B;
	int ans = 0;
	int N, K;
	int table[max] = {};

	cin >> N >> K;

	vector<int> A(N);

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

	for (int i = 0; i < max; i++)
	{
		if (table[i] > 0)
		{
			B.push_back(table[i]);
		}
	}

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

	for (int i = 0; i < (int)B.size() - K; i++)
	{
		ans += B[i];
	}
	
	cout << ans << endl;

	return 0;
}


Measured memory_bytes: 2936
#include<iostream>
#include<string>
#include<vector>
#include<unordered_map>
#include<algorithm>
#include<cmath>
#include<climits>
#include<iomanip>
#include<bitset>
#include<cstdlib>
#include<queue>
#include<utility> //pair
using namespace std;

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

typedef long long ll;
typedef vector<vector<int>> Graph;

int main() {
	//入力;
	int A, B;
	cin >> A >> B;

	cout << A * B - A - B + 1 << endl;
	//小数点以下の桁数表示;
	//cout << fixed << setprecision(15);

	return 0;
}

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

int dfs(int node, vector<vector<int>> &adj, vector<bool> &vis, vector<int> &dist){
    if(!vis[node]){
        vis[node] = 1;
        for(auto &x:adj[node]){
            dist[node] = max(dist[node], dfs(x, adj, vis, dist) + 1);
        }
    }
    return dist[node];
}

int main(){
    int N,M;
    cin >> N >> M;
    vector<int> dist(N+1);
    vector<bool> vis(N+1);
    vector<vector<int>> adj(N+1);

    int sta,sto;
    for(int i=0;i<M;i++){
        cin >> sta >> sto;
        adj[sta].push_back(sto);
    }

    for(int i=1;i<=N;i++){
        if(!vis[i]){
            dfs(i, adj, vis, dist);
        }
    }

    int ans=0;

    for(auto &x:dist){
        ans = max(ans, x);
    }
    cout << ans;
}

Measured memory_bytes: 9472
# coding: utf-8
import sys

# from operator import itemgetter
sysread = sys.stdin.readline
read = sys.stdin.read
#from heapq import heappop, heappush
#from collections import defaultdict

sys.setrecursionlimit(10 ** 7)
# import math
# from itertools import product, accumulate, combinations, product
# import bisect# lower_bound etc
#import numpy as np
# from copy import deepcopy
#from collections import deque
#import numba
import math

def run():
    A, b = input().split()
    A = int(A)
    B = 0
    B += int(b[0]) * 100
    B += int(b[-2:])
    ret = 0
    for _ in range(B):
        ret += A
    print(ret//100)


if __name__ == "__main__":
    run()

Measured memory_bytes: 9200
S = input()
N = len(S)

def checkPalindrome(inStr):
    strLen = len(inStr)
    if strLen%2 == 1:
        loopMax = (strLen + 1) / 2
    else:
        loopMax = strLen / 2
    loopMax = int(loopMax)
    for index in range(loopMax):
        if(inStr[index] != inStr[strLen-1-index]):
            return False
    return True

if(not checkPalindrome(S)):
    print('No')
elif(not checkPalindrome(S[0:int((N-1)/2)])):
    print('No')
elif(not checkPalindrome(S[int((N+3)/2-1):N])):
    print('No')
else:
    print('Yes')

Measured memory_bytes: 3064
#![allow(unused_imports)]
#![allow(unused_variables)]
#![allow(non_snake_case)]
#![allow(dead_code)]
#![allow(deprecated)]

use std::cell::{Cell, Ref, RefCell, RefMut};
use std::cmp::{max, min, Ordering};
use std::collections::*;
use std::fmt::{Debug, Formatter, Write as FmtWrite};
use std::io::{stderr, stdin, BufRead, Write};
use std::mem::{replace, swap};
use std::ops::*;
use std::rc::Rc;
use std::usize;

const MOD_10_9_7: u64 = 1_000_000_007;
const INF: i64 = 1_000_000_000_000;
const MIN_INF: i64 = -1_000_000_000_000;

/// FYI: https://github.com/vain0x/scan-bench
#[allow(unused_macros)]
macro_rules! read {
    ([$t:ty] ; $n:expr) =>
        ((0..$n).map(|_| read!([$t])).collect::<Vec<_>>());
    ($($t:ty),+ ; $n:expr) =>
        ((0..$n).map(|_| read!($($t),+)).collect::<Vec<_>>());
    ([$t:ty]) =>
        (rl().split_whitespace().map(|w| w.parse().unwrap()).collect::<Vec<$t>>());
    ($t:ty) =>
        (rl().parse::<$t>().unwrap());
    ($($t:ty),*) => {{
        let buf = rl();
        let mut w = buf.split_whitespace();
        ($(w.next().unwrap().parse::<$t>().unwrap()),*)
    }};
}

fn rl() -> String {
    let mut buf = String::new();
    stdin().read_line(&mut buf).unwrap();
    buf.trim_right().to_owned()
}

#[allow(unused_macros)]
macro_rules! debug {
    ($($a:expr),*) => {
        eprintln!(concat!($(stringify!($a), " = {:?}, "),*), $($a),*);
    }
}

fn a() {
    let s: String = read!(String);

    if &s == "Sunny" {
        println!("Cloudy");
        return;
    }
    if &s == "Cloudy" {
        println!("Rainy");
        return;
    }
    if &s == "Rainy" {
        println!("Sunny");
        return;
    }
}

fn b() {
    let s: String = read!(String);
    let c: Vec<char> = s.chars().collect();

    for i in 0..c.len() {
        let j = i + 1;
        if j % 2 == 0 {
            if c[i] == 'R' {
                println!("No");
                return;
            }
        } else {
            if c[i] == 'L' {
                println!("No");
                return;
            }
        }
    }
    println!("Yes");
}

fn c() {
    let (n, k, q): (usize, i64, usize) = read!(usize, i64, usize);
    let a: Vec<usize> = read!(usize; q);

    let mut points = vec![k; n]; // 初期ポイント

    let mut resolves = vec![0; n]; // 正解数
    for v in a {
        resolves[v - 1] += 1;
    }

    // 累積和
    let mut s = vec![0; n + 1];
    for i in 1..(n + 1) {
        s[i] = s[i - 1] + resolves[i - 1];
    }

    // ポイント計算
    for i in 0..n {
        // iさん以外の正解数
        let another = s[i] + s[n] - s[i + 1];
        points[i] -= another;
        if points[i] > 0 {
            println!("Yes");
        } else {
            println!("No");
        }
    }
}

fn d() {
    unimplemented!();
}

fn e() {
    unimplemented!();
}

fn f() {
    unimplemented!();
}

fn main() {
    c();
}


Measured memory_bytes: 8828
package main

import (
	"bufio"
	"fmt"
	"io"
	"os"
	"strconv"
)

const mod = 2 << 60
const facNum = 300001
const INF = 2 << 60

func main() {
	sc := newScanner(os.Stdin)
	K := sc.i()
	q := []int{1, 2, 3, 4, 5, 6, 7, 8, 9}
	for i := 0; i < K; i++ {
		x := q[i]
		if x%10 != 0 {
			q = append(q, 10*x+(x%10)-1)
		}
		q = append(q, 10*x+(x%10))
		if x%10 != 9 {
			q = append(q, 10*x+(x%10)+1)
		}
	}
	fmt.Println(q[K-1])
}

func Pow(a, n int) int {
	ans := 1
	for n > 0 {
		if (n & 1) == 1 {
			ans = ans * a % mod
		}
		a = a * a % mod
		n = n >> 1
	}
	return ans
}

func min(a, b int) int {
	if a < b {
		return a
	}
	return b
}

// I/O
type scanner struct {
	sc *bufio.Scanner
}

func newScanner(input io.Reader) *scanner {
	sc := bufio.NewScanner(input)
	sc.Split(bufio.ScanWords)
	sc.Buffer(make([]byte, 1024), int(1e+9))
	return &scanner{sc}
}

func (s *scanner) s() string {
	s.sc.Scan()
	return s.sc.Text()
}

func (s *scanner) i() int {
	i, e := strconv.Atoi(s.s())
	if e != nil {
		panic(e)
	}
	return i
}

func (s *scanner) f() float64 {
	f, e := strconv.ParseFloat(s.s(), 64)
	if e != nil {
		panic(e)
	}
	return f
}

func (s *scanner) bs() []byte {
	return []byte(s.s())
}

func (s *scanner) is(n int) []int {
	res := make([]int, n)
	for i := 0; i < n; i++ {
		res[i] = s.i()
	}
	return res
}

func (s *scanner) fs(n int) []float64 {
	res := make([]float64, n)
	for i := 0; i < n; i++ {
		res[i] = s.f()
	}
	return res
}

func abs(i int) int {
	if i < 0 {
		return -i
	}
	return i
}


Measured memory_bytes: 8508
n = int(input())
d = list(map(int, input().split()))
d.sort()
m = int(input())
t = list(map(int, input().split()))
t.sort()

i = 0
j = 0
while j < m:
    if d[i] == t[j]:
        i += 1
        j += 1
    elif d[i] < t[j]:
        i += 1
    else:
        print("NO")
        exit()
print("YES")

Measured memory_bytes: 35420
import java.util.*;
public class Main {
    public static final String[] W = new String[]{"Sunny", "Cloudy", "Rainy"};
    public static void main(String[] args) {

        Scanner sc = new Scanner(System.in);

        String s = sc.nextLine();
        for (int i = 0; i < W.length; i++) {
            if (s.equals(W[i])) {
                String output = (i < W.length - 1 )? W[i + 1] : W[0];
                System.out.println(output);
                break;
            }
        }
    }
}


Measured memory_bytes: 21076
/*input
1 100000
1
*/

//sometimes it's the people who no one imagines anything of 
//who do the things that no one can imagine.

//code author: iamxlr8

#include <bits/stdc++.h>
using namespace std;

#define ll long long
#define N 300005
#define off ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)

int main() 
{
    off;
    ll n,k;
    cin>>n>>k;
    ll a[n+1];
    for(ll i=1;i<=n;i++)
        cin>>a[i];
    ll dp[k+1];
    memset(dp,0,sizeof(dp));
    for(ll i=0;i<=k;i++)
    {
        for(ll j=1;j<=n;j++)
        {
            if(i-a[j]>=0&&!dp[i-a[j]])
            {
                dp[i]=1;
                break;
            }
        }
    }
    if(dp[k])
        cout<<"First";
    else
        cout<<"Second";
    return 0;
}

Measured memory_bytes: 1024
#include<bits/stdc++.h> 
//#define <- プログラムの文字列を置換する
//typedef <- 新しい型に名前を付けるためのキーワード

using namespace std;

#define MAX_N 1

typedef long long ll;

const double PI = 3.141592653589793;
const long long MOD = 1e9 + 7;
const long long INF = 1e15;
const int INF_INT = 1e9;


int main(){
    int N;
    cin >> N;
    vector<int> a(N);
    int b[N];
    for(int i = 0; i < N;i++) {
        cin >> a[i];
        b[i] = a[i];
    }
    sort(a.begin(),a.end(),greater<>());
    for(int i = 0; i < N;i++){
        if(b[i] != a[0]) cout << a[0] << endl;
        else cout << a[1] << endl;
    }
    return 0;
}

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

const int INF=0x3f3f3f3f;
const ll INFL=0x3f3f3f3f3f3f3f3f;
const int MOD=1000000007;

int a[300000];
int main(){
	int n;cin>>n;
	set<int>se;
	rep(i,n){
		int a;scanf("%d",&a);
		se.insert(a);
	}
	if(se.size()==n)puts("YES");
	else puts("NO");
}

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

int main() {
  string s;
  cin >> s;
  
  int A,Z;
  for(int i=0; i<s.size(); ++i){
    if(s.at(i)=='A'){
      A=i+1;
      break;
    }
  }
  for(int i=s.size()-1; i>0; --i){
    if(s.at(i)=='Z'){
      Z=i+1;
      break;
    }
  }
  int ans = Z-A+1;
  cout << ans << endl;
}


Measured memory_bytes: 640
#include<bits/stdc++.h>
#define all(vec) vec.begin(),vec.end()
using namespace std;
typedef long long int ll;
typedef pair<int,int> P;
const ll MOD=1000000007;
const ll INF=1000000010;
const ll LINF=4000000000000000010LL;
const int MAX=310;
const double EPS=1e-9;
int dx[4]={0,1,0,-1};
int dy[4]={1,0,-1,0};
ll dp[1<<8][1<<9][1<<8];
ll fact[110];
int main(){
	fact[0]=1;
	for(int i=1;i<=100;i++){
		(fact[i]=fact[i-1]*i)%=MOD;
	}
	int n,k;cin>>n>>k;
	int a[110];
	for(int i=0;i<n;i++)cin>>a[i];
	dp[0][0][0]=1;
	for(int i=0;i<n;i++){
		for(int j=0;j<=(1<<8);j++){
			for(int l=0;l<=i;l++){
				(dp[i+1][j][l]+=dp[i][j][l])%=MOD;
				(dp[i+1][j^a[i]][l+1]+=dp[i][j][l])%=MOD;
			}
		}
	}
	ll ans=0;
	for(int i=1;i<=n;i++){
		(ans+=dp[n][k][i]*fact[i])%=MOD;
	}
	cout<<ans%MOD<<endl;
}


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

#define ll long long

using namespace std;
 
void solve() {
    int n, w_max;
    cin >> n >> w_max;

    vector<ll> v(n), w(n);
    for (int i = 0; i < n; ++i) {
        cin >> w[i] >> v[i];
    }

    // dp[i][k] -> maior valor possível utilizando até o item i podendo usar
    //             até o peso k
    // dp[i][k] = max(inclui o i-ésimo, não inclui o i-ésimo)
    vector<vector<ll>> dp(n, vector<ll>(w_max+1, -1ll));

    function<ll(int, int)> calc_dp = [&] (int i, int k) {
        if (i < 0)
            return 0ll;
        if (dp[i][k] != -1)
            return dp[i][k];
        
        if (w[i] > k) {
            dp[i][k] = calc_dp(i-1, k);
        } else {
            dp[i][k] = max(v[i]+calc_dp(i-1, k - w[i]), calc_dp(i-1, k));
        }
        return dp[i][k];
    };

    cout << calc_dp(n-1, w_max) << endl;
}

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

    int t = 1;
    // cin >> t;

    for (int i = 0; i < t; ++i) {
        solve();
    }

    return 0;
}


Measured memory_bytes: 82384
#include "bits/stdc++.h"
#define MOD 1000000007
#define INF 11234567890
#define in std::cin
#define out std::cout
#define rep(i,N) for(int i=0;i<N;++i)
typedef long long int LL;

LL N, p[112345];
LL ans;

int main()
{
	in >> N;
	rep(i, N) { in >> p[i]; }

	bool flag = true;
	while (flag)
	{
		flag = false;
		rep(i, N)
		{
			if (i + 1 == p[i])
			{
				if (i < N - 1) { std::swap(p[i], p[i + 1]); }
				else { std::swap(p[i], p[i - 1]); }
				flag = true;
				++ans;
			}
		}
	}

	out << ans << std::endl;
	return 0;
}

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

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

  int n = s.size();
  int ans = INT_MAX;
  for(int i = 0;i < n-2;i++){
    ans = min(ans, abs(753-((s[i]-'0')*100+(s[i+1]-'0')*10+(s[i+2]-'0'))));
  }

  cout << ans << endl;

  return 0;
}





Measured memory_bytes: 256
#include<iostream>
#include<climits>
#include<math.h>
#include<vector>
#include<algorithm>
#include<cstdio>
#include<stdio.h>
#include <string>
#include <complex>
#include <functional>
using namespace std;
//typedef pair<string,string> P;
//double dat[100][100];
//int dp[6][1010];//動的計画法
//int prime[10000001];
//char str[1010][1010];
//vector<pair<int,int> > pc[100001];
//int ABS(int a){return max(a,-a);}
long long num[100000];
int main(){
	int a,b;
	cin>>a>>b;
	if(a+b>9) cout<<"error"<<endl;
	else cout<<a+b<<endl;
	return 0;
}

Measured memory_bytes: 256
#include<cstdio>
#include<algorithm>
#define rep(i,l,r) for (int i=(l); i<=(r); i++)
typedef long long ll;
using namespace std;

const int N=100010,mod=1e9+7;
int n,h[N],x,ans,r=1;

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

int main(){
	scanf("%d",&n);
	rep(i,1,n) h[i]=(h[i-1]+ksm(i,mod-2))%mod;
	rep(i,1,n) scanf("%d",&x),ans=(ans+1ll*x*(1ll*h[i]+h[n-i+1]-1+mod)%mod)%mod,r=1ll*r*i%mod;
	printf("%lld\n",1ll*ans*r%mod);
	return 0;
}

Measured memory_bytes: 512
# include <iostream>
# include <cmath>
# include <algorithm>
# include <stdio.h>
# include <cstdint>
# include <cstring>
# include <string>
# include <cstdlib>
# include <vector>
# include <bitset>
# include <map>
# include <queue>
# include <ctime>
# include <stack>
# include <set>
# include <list>
# include <random>
# include <deque>
# include <functional>
# include <iomanip>
# include <sstream>
# include <fstream>
# include <complex>
# include <numeric>
# include <immintrin.h>
# include <cassert>
# include <array>
# include <tuple>
# include <unordered_set>
# include <unordered_map>
using namespace std;


int n;
long long a[10005];

int main(int argc, const char * argv[]) {
#ifdef __APPLE__
    freopen("/Users/danya.smelskiy/Documents/Danya/Resources/input.txt","r",stdin);
#endif
    ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
    cin >> n;
    for (int i = 1; i <= n; ++i) {
        cin >> a[i];
    }
    long long ans = 1e18;
    for (int i = -100; i <= 100; ++i) {
        long long res = 0;
        for (int j = 1; j <= n; ++j)
            res += (i - a[j]) * (i - a[j]);
        ans = min(ans, res);
    }
    cout << ans << '\n';
    return 0;
}



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

int main() {
 int N;
 cin >> N;
 
 vector<string> vec(N);
for (int i = 0; i < N; i++) {
  cin >> vec.at(i);
}
 
  int i=0;
  while (i<N-1 && vec.at(i).at(vec.at(i).size()-1) ==vec.at(i+1).at(0)){
    i++;
  }
  if (i!= N-1){
    cout << "No" <<endl;
  }
  else {
    int j=0;
    int k=0;
    while (k == j){
    k=0;
    j=j+1;
      while(k<j && j<N && vec.at(k) != vec.at(j)){
      k++;
      }
    }
    if (j != N){
    cout << "No" <<endl;
    }
    else{
    cout << "Yes" << endl;
    }
  }
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define endl "\n"
#define fastio ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define int long long

int32_t main() {
	fastio;

    string s; cin >> s;
    if(s[2] == s[3] && s[4] == s[5]) cout << "Yes" << endl;
    else cout << "No" << endl;
	return 0;
}


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

const int maxn = 5e5+7;

std::string s;
long long a[maxn];

int main(int argc, char *argv[]) {  
	std::ios::sync_with_stdio(false);
	std::cin.tie(0); 
	std::cin >> s;
	std::fill(a, a+maxn, 0);
	for (int i = 0; i < s.length(); i++) {
//		std::cout << s[i] << " \n"[i==s.length()-1];
		if (s[i] == '<') {
			a[i+1] = a[i]+1;
		}
	}
	for (int i = s.length(); i >= 0; i--) {
		if (s[i] == '>') {
			a[i] = std::max(a[i], a[i+1]+1);
		}
	}
	long long ans = 0;
	for (int i = 0; i <= s.length(); i++) {
//		std::cout << a[i] << " \n"[i==s.length()-1];
		ans += a[i];
	}
	std::cout << ans << '\n';
}

Measured memory_bytes: 4732
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <tuple>
#include <queue>
#include <set>
#include <math.h>
#include <array>
#include <list>
#include <set>
const int MOD=1000000007;
const int INF=1000000000;
using namespace std;
typedef long long ll;
typedef tuple<ll,int,int> tup;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<pair<int,int> > vp;

int main(int argc,char const* argv[])
{
  int ans=0;
  string s;
  cin >> s;
  for(int i=0;i<4;i++)
    {
      if(s[i]=='+') ans++;
      else if(s[i]=='-') ans--;
    }
  cout << ans << endl;

  return 0;
}


Measured memory_bytes: 256
package main
import(
  "fmt"
)
func main(){
  var a, b, k int64
  fmt.Scan(&a, &b, &k)
  if k<=a{
		fmt.Println(a-k,b)
	}else if k<=a+b{
		fmt.Println(0,b-(k-a))
	}else{
		fmt.Println(0,0)
	}
 }


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

typedef int64_t Int;
#define fi first
#define se second
#define all(x) (x).begin(), (x).end()
 
const double EPS = 1e-10;
const Int INF = 1e18;
const int inf = 1e9;
const Int mod = 1e9+7;

bool print_space_enable = false;
void print() { 
    cout << endl; 
    print_space_enable = false;
}

template <class Head, class... Tail>
void print(Head&& head, Tail&&... tail) {
    if (print_space_enable) cout << " ";
    cout << fixed << setprecision(15) << head;
    print_space_enable = true;
    print(std::forward<Tail>(tail)...);
}

template<typename T>
void print(vector<T> v) {
    for (size_t i = 0; i < v.size(); i++) {
        if (i > 0) std::cout << " ";
        std::cout << v[i];
    }
    std::cout << std::endl;
}

int main() {
    Int s, w;
    cin >> s >> w;
    print(s <= w ? "unsafe" : "safe");
    return 0;
}

Measured memory_bytes: 3636
#include <iostream>
#include <string>
#include <sstream>
#include <iomanip> 
#include <math.h>
#include <stdio.h>
#include <string.h>
#include <queue>
#include <stack>
#include <vector>
#include <map>
#include <set>
#include <functional>
#include <algorithm>
#include <unordered_map>
#include <unordered_set>
#include <bitset>

using namespace std;

int main()
{
	ios::sync_with_stdio(false);
	cin.tie(0);
	int n, a;
	cin >> n >> a;
	cout << n * n - a << "\n";

	return 0;
}



Measured memory_bytes: 256
from bisect import bisect_left, bisect_right

N, Q = map(int, input().split())
S = input()
LR = [list(map(int, input().split())) for _ in range(Q)]

AC = []
a = False
for i, s in enumerate(S):
    if s == 'A':
        a = True
        continue
    if a and s == 'C':
        AC.append(i-1)
    a = False

for l, r in LR:
    left = bisect_left(AC, l-1)
    right = bisect_right(AC, r-2)
    print(right-left)

Measured memory_bytes: 30312
#include <stdio.h>
#include <stdlib.h>
#include <vector>
#include <map>
#include <string>
#include <iostream>
#include <limits.h>
#include <algorithm>

#define Int long long
#define rep(i, n) for(Int i = 0; i < n; i++)
#define in(params) cin >> params;
#define p(params) cout << params << endl;
#define mod 1000000007LL

using namespace std;

int main()
{
    int A, B, C;
    cin >> A >> B >> C;

    cout << max(C-( A-B), 0)  << endl;

    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
  
using namespace std;
using namespace __gnu_pbds;
 
#define ll long long
#define uint unsigned int
#define ull  unsigned long long
#define pb push_back
#define mk make_pair
#define ins insert
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(),(x).rend()
#define X first
#define Y second
#define umap unordered_map
#define speed() ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
#define setvalue(d,s,e,n) for(int qwe = s; qwe < e; ++qwe) d[qwe] = n
#define mset multiset
#define pqueue priority_queue
   
template<class T> using oset = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
        
const int  N = 2e5 + 314;
const int INF = 1e9;
const double PI = acos(-1);
const int MOD = 1e9 + 7;
const double eps = 1e-9;
const long long LINF = 1e18 + 3141;
int n, k;
int a[N];
void solve(){
    cin >> n >> k;
    for(int i = 1; i <= n; ++i)
        cin >> a[i];
    sort(a + 1, a + n + 1);
    int ans = 0;
    for(int i = 1; i <= k; ++i)
        ans += a[i];
    cout << ans;
}
 
int main(){
    speed();
    int t = 1;
    // cin >> t;
    while(t--)solve();
}

Measured memory_bytes: 3656
#include"bits/stdc++.h"
using namespace std;
int main(){
	long long q,h,s,d,n;
	cin>>q>>h>>s>>d>>n;
	long long k=min(q*4,min(h*2,s));
	if(k*2>d)
		cout<<(n/2)*d+(n%2)*k;
	else
		cout<<k*n;
}

Measured memory_bytes: 256
//BISMILLAH
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define lli long long int
#define ve vector<int>
#define FOR(n)          for(int i=0; i<(int)(n); ++i)
#define TEST_CASE(t)    for(int z=1;z<=t;z++)
#define PRINT_CASE      printf("Case %d: ",z)
#define pb push_back
#define mod 1000000007
int main()
{

    int i,n;
    scanf("%d",&n);

    ll add=1,sub=1,common=1,ans;

    for(int i=1;i<=n;i++)
    {
        add = (add*10)%mod;
        sub = (sub*9) %mod;
        common = (common*8)%mod;
    }

    ans = (add-sub-sub+common)%mod;

    ans = (ans+mod)%mod;

    printf("%lld\n",ans);



    return 0;
}


Measured memory_bytes: 3812
N = gets
V = gets.split.map{|v| v.to_i}
r = V.reduce({}) do |r, v|
  if r.key?(v)
    r[v] +=1
  else
    r[v] = 1
  end

  if r.key?(v-1)
    r[v-1] += 1
  else
    r[v-1] = 1
  end

  if r.key?(v+1)
    r[v+1] += 1
  else
    r[v+1] = 1;
  end

  r
end

puts r.values.max

Measured memory_bytes: 14988
#include <iostream>
#include <cstdio>
#include <vector>
#include <cmath>
#include <cstring>
#include <numeric>
#include <algorithm>
#include <functional>
#include <array>
#include <map>
#include <queue>
#include <limits.h>
#include <set>
#include <stack>
#include <random>
#include <complex>
#include <unordered_map>
#define rep(i,s,n) for(int i = (s); (n) > i; i++)
#define REP(i,n) rep(i,0,n)
#define RANGE(x,a,b) ((a) <= (x) && (x) <= (b))
#define DUPLE(a,b,c,d) (RANGE(a,c,d) || RANGE(b,c,d) || RANGE(c,a,b) || RANGE(d,a,b))
#define INCLU(a,b,c,d) (RANGE(a,c,d) && (b,c,d))
#define PW(x) ((x)*(x))
#define ALL(x) (x).begin(), (x).end()
#define RALL(x) (x).rbegin(), (x).rend()
#define MODU 1000000007
#define bitcheck(a,b)   ((a >> b) & 1)
#define bitset(a,b)      ( a |= (1 << b))
#define bitunset(a,b)    (a &= ~(1 << b))
#define MP(a,b) make_pair((a),(b))
#define Manh(a,b) (abs((a).first-(b).first) + abs((a).second - ((b).second))
#define pritnf printf
#define scnaf scanf
#define itn int
#define PI 3.141592653589
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
ll gcd(ll a, ll b) {
	if (b == 0) return a;
	return gcd(b, a%b);
}
template<typename A, size_t N, typename T>
void Fill(A(&array)[N], const T &val) {
	std::fill((T*) array, (T*) (array + N), val);
}
pii Dir [] = {
	{ 1,0 },{ 0,1 }
};



signed main() {
	int a, b;
	char c[2];
	scanf("%d %s %d", &a, c, &b);

	if (c[0] == '+') {
		printf("%d\n", a+b);
	}
	else {
		printf("%d\n", a-b);
	}
	return 0;
}

Measured memory_bytes: 256
import itertools

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

aaa = list(itertools.combinations(d,2))

ans = 0

for a in aaa:
    a1 = a[0]
    a2 = a[1]
    seki = a1*a2

    ans += seki

print(ans)

Measured memory_bytes: 3060
#include<bits/stdc++.h>
#define rep(i,a,b) for(int i=a;i<b;i++)
#define rrep(i,a,b) for(int i=a;i>=b;i--)
#define fore(i,a) for(auto &i:a)
#define all(x) (x).begin(),(x).end()
//#pragma GCC optimize ("-O3")
using namespace std; void _main(); int main() { cin.tie(0); ios::sync_with_stdio(false); _main(); }
typedef long long ll; const int inf = INT_MAX / 2; const ll infl = 1LL << 60;
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; }
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
void _main()
{
    int N, A, B;
    cin >> N >> A >> B;
    array<int, 3> nums;
    nums.fill(0);
    rep(i, 0, N)
    {
        int P;
        cin >> P;
        if (P <= A) ++nums[0];
        else if (P <= B) ++nums[1];
        else ++nums[2];
    }
    cout << min({nums[0], nums[1], nums[2]}) << endl;
}


Measured memory_bytes: 256
/**Bismillahir Rahmanir Rahim.**/
/*
         Md.Fagun Molla
         18ICTCSE006
         BSMRSTU(SHIICT)
*/
#include <bits/stdc++.h>
using namespace std;


#define  gcd(a,b)         __gcd(a,b)
#define  lcm(a,b)         (a*b)/gcd(a,b)
#define  ll               long long
#define  vi               std::vector<int>
#define  pb               push_back
#define  MAX              100007
#define  End              return 0;
#define                   pi acos(-1)


int main () {
    ios_base::sync_with_stdio(false); cin.tie(0);cout.tie(0);
    int n;
    cin>>n;
    int aa[32]={1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51};
    cout<<aa[n-1]<<endl;
    End;
}
/* pray for me
Do before die
*/


Measured memory_bytes: 256
#include <stdio.h>
#include <string.h>

int main(void)
{	
	char s;
	int moji[128]={0};
	int i=0;

	while(scanf("%c", &s) != EOF){
		if(s>='A' && s <='Z')
			moji[s-'A'] ++;
		else if(s>='a' && s <='z')
			moji[s-'a'] ++;
	}
	for(i=0; i<26; i++){
		printf("%c : %d\n", i+'a', moji[i]);
	}
	return 0;
}

Measured memory_bytes: 540
#include<iostream>
#include<string>
#include<algorithm>	
#include<cmath>
using namespace std;
int main() {
	int n; cin >> n;
	if (n / 100 == n % 10) {
		cout << "Yes" << endl;
	}
	else {
		cout << "No" << endl;
	}
	cin >> n;
}

Measured memory_bytes: 256
n = int(input())
s = input()
a = s[1:].count('E')
inf = float('inf')
ans = [inf]*n
ans[0] = a
for i in range(1,n):
    if s[i] == 'E':
        ans[i] = ans[i-1] - 1
        if s[i-1] == 'W':
            ans[i] += 1
        else:
            continue
    else:
        ans[i] = ans[i-1]
        if s[i-1] == 'W':
            ans[i] += 1
        else:
            continue
print(min(ans))



Measured memory_bytes: 15436
n,m = map(int,input().split())
nl = []
ml = []
for _ in range(n):
    nl.append(list(map(int,input().split())))
for _ in range(m):
    ml.append(list(map(int,input().split())))

for i in range(n):
    tmp=0
    ans=0
    for j in range(m):
        if ans:
            if tmp > abs(nl[i][0] - ml[j][0]) + abs(nl[i][1] - ml[j][1]):
                tmp = abs(nl[i][0] - ml[j][0]) + abs(nl[i][1] - ml[j][1])
                ans=j+1
        else:
            tmp = abs(nl[i][0] - ml[j][0]) + abs(nl[i][1] - ml[j][1])
            ans=j+1
    print(ans)

Measured memory_bytes: 9124
package main

import (
	"fmt"
	"strconv"
)

type line struct {
	start int
	end   int
}

func main() {
	var n int
	n = 1
	// fmt.Scan(&n)

	lines := []line{}
	for i := 0; i < n; i++ {
		l := line{}
		fmt.Scan(&l.start, &l.end)
		lines = append(lines, l)
	}
	// fmt.Println(lines)

	test := func(lines []line) int {
		c := 0
		for _, l := range lines {
			for i := l.start; i <= l.end; i++ {
				s := strconv.Itoa(i)
				if len(s) < 2 {
					c++
				} else {
					a := len(s) / 2
					b := len(s) % 2
					first := s[:a]
					last := ""

					for _, c := range s[a+b:] {
						last = string(c) + last
					}

					if first == last {
						c++
					}
				}
			}
		}
		return c
	}

	fmt.Println(test(lines))
}


Measured memory_bytes: 1280
#include <algorithm>
#include <cmath>
#include <functional>
#include <iomanip>
#include <iostream>
#include <limits>
#include <map>
#include <queue>
#include <set>
#include <tuple>
#include <vector>

using namespace std;

#define rep(i, n) for (int64_t i = 0; i < (n); i++)
#define irep(i, n) for (int64_t i = 0; i <= (n); i++)
#define rrep(i, n) for (int64_t i = (n)-1; i >= 0; i--)
#define rirep(i, n) for (int64_t i = n; i >= 0; i--)

class FlowNetwork {
  struct Edge {
    int from;
    int to;
    int64_t capacity;
    int64_t flow;
  };

  vector<vector<int>> outEdge, inEdge;
  vector<Edge> edgeData;

 public:
  FlowNetwork(int size) : outEdge(size), inEdge(size) {}

  void addEdge(const int from, const int to, const int64_t capacity) {
    const int eId = edgeData.size();
    Edge eData;
    eData.from = from;
    eData.to = to;
    eData.flow = 0;
    eData.capacity = capacity;
    edgeData.push_back(eData);
    outEdge[from].push_back(eId);
    inEdge[to].push_back(eId);
  }

  int64_t maxflow(const int source, const int sink) {
    const int n = outEdge.size();

    while (true) {
      // check if reachable to sink
      vector<int> parent(n, -1);
      queue<int> q;
      q.push(source);

      while (!q.empty()) {
        const int v = q.front();
        q.pop();

        for (const int e : outEdge[v]) {
          const Edge &data = edgeData[e];
          const int nv = data.to;
          if (parent[nv] < 0 && data.capacity - data.flow > 0) {
            q.push(nv);
            parent[nv] = e;
          }
        }

        for (const int e : inEdge[v]) {
          const Edge &data = edgeData[e];
          const int nv = data.from;
          if (parent[nv] < 0 && data.flow > 0) {
            q.push(nv);
            parent[nv] = e;
          }
        }
      }

      if (parent[sink] < 0) {
        break;
      }

      // select path from source to sink
      int64_t d = numeric_limits<int64_t>::max();
      int v = sink;
      while (v != source) {
        const int e = parent[v];
        const Edge &data = edgeData[e];
        if (data.to == v) {
          d = min(d, data.capacity - data.flow);
          v = data.from;
        } else {
          d = min(d, data.flow);
          v = data.to;
        }
      }

      // update flow on the path
      v = sink;
      while (v != source) {
        const int e = parent[v];
        Edge &data = edgeData[e];
        if (data.to == v) {
          data.flow += d;
          v = data.from;
        } else {
          data.flow -= d;
          v = data.to;
        }
      }
    }

    int64_t result = 0;
    for (const int e : inEdge[sink]) {
      result += edgeData[e].flow;
    }
    return result;
  }
};

int main() {
  int X, Y, E;
  cin >> X >> Y >> E;

  const int nodeNum = X + Y + 2;
  FlowNetwork net(nodeNum);
  const int source = nodeNum - 2;
  const int sink = nodeNum - 1;

  rep(i, X) { net.addEdge(source, i, 1); }
  rep(i, Y) { net.addEdge(X + i, sink, 1); }

  rep(i, E) {
    int x, y;
    cin >> x >> y;

    net.addEdge(x, X + y, 1);
  }

  cout << net.maxflow(source, sink) << endl;

  return 0;
}


Measured memory_bytes: 3504