akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;

using int32 = int_fast32_t;
using int64 = int_fast64_t;

const int32 INF = 1e9;
const int32 MOD = 1e9+7;
const int64 LLINF = 1e18;

#define YES(n) cout << ((n) ? "YES\n" : "NO\n"  )
#define Yes(n) cout << ((n) ? "Yes\n" : "No\n"  )
#define ANS(n) cout << (n) << "\n"
#define REP(i,n) for(int64 i=0;i<(n);++i)
#define FOR(i,a,b) for(int64 i=(a);i<(b);i++)
#define FORR(i,a,b) for(int64 i=(a);i>=(b);i--)
#define ALL(obj) (obj).begin(),(obj).end()
#define pii pair<int32,int32>
#define pll pair<int64,int64>
#define pb(a) push_back(a)
#define mp make_pair

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    int32 n;
    cin >> n;
    set<int32> used;
    int32 cnt = 0;
    REP(i,n){
        int32 a;
        cin >> a;
        if(used.find(a) != used.end()){
            cnt++;
        }else{
            used.insert(a);
        }
    }
    ANS(n - (cnt+1) / 2 * 2);
    return 0;
}

Measured memory_bytes: 4992
mat = [[0 for i in range(3)] for j in range(3)]
for i in range(3):
    mat[i] = list(map(int, input().split()))

n = int(input())
for _ in range(n):
    b = int(input())
    for x in range(3):
        for y in range(3):
            if mat[x][y] == b:
                mat[x][y] = 101

flg = False
for x in range(3):
    if [mat[x][0], mat[x][1], mat[x][2]] == [101, 101, 101]:
        flg = True

for x in range(3):
    if [mat[0][x], mat[1][x], mat[2][x]] == [101, 101, 101]:
        flg = True

if [mat[0][0], mat[1][1], mat[2][2]] == [101, 101, 101]:
    flg = True

if [mat[0][2], mat[1][1], mat[2][0]] == [101, 101, 101]:
    flg = True

print("Yes") if flg else print("No")


Measured memory_bytes: 3064
#include <bits/stdc++.h>
#define rep(i, a, n) for(int i = a; i < n; i++)
#define repb(i, a, b) for(int i = a; i >= b; i--)
#define all(a) a.begin(), a.end()
#define o(a) cout << a << endl
#define int long long
#define fi first
#define se second
using namespace std;
typedef pair<int, int> P;

int d[110][110];

signed main(){
    int w, h, n;
    cin >> w >> h >> n;
    rep(i, 0, n){
        int x, y, a;
        cin >> x >> y >> a;
        if(a == 1){
            rep(j, 0, x){
                rep(k, 0, h){
                    d[j][k] = 1;
                }
            }
        }
        if(a == 2){
            rep(j, x, w){
                rep(k, 0, h){
                    d[j][k] = 1;
                }
            }
        }
        if(a == 3){
            rep(j, 0, y){
                rep(k, 0, w){
                    d[k][j] = 1;
                }
            }
        }
        if(a == 4){
            rep(j, y, h){
                rep(k, 0, w){
                    d[k][j] = 1;
                }
            }
        }
    }
    int ans = 0;
    rep(i, 0, w) rep(j, 0, h) if(d[i][j] == 0) ans++;
    o(ans);
}

Measured memory_bytes: 384
#include <bits/stdc++.h>
using i64 = long long;

i64 dp[310][310][310];

int main() {
    int n, m;
    constexpr i64 mod = 1000000007;
    std::cin >> n >> m;
    std::vector<std::deque<std::pair<int, int>>> cond(n + 1);
    for (int i = 0; i < m; i++) {
        int l, r, x;
        std::cin >> l >> r >> x;
        cond[r].emplace_back(l, x);
    }

    dp[0][0][0] = 1;
    i64 ret = 0;
    for (int r = 0; r <= n; r++) {
        for (int g = 0; g <= n; g++) {
            for (int b = 0; b <= n; b++) {
                int max = std::max({ r, g, b });
                int min = std::min({ r, g, b });
                int mid = r ^ g ^ b ^ max ^ min;

                for (auto &c : cond[max]) {
                    int l = c.first,
                        x = c.second;
                    
                    if ((x == 1 && l <= mid)
                        || (x == 2 && mid < l)
                        || (x == 2 && l <= min)
                        || (x == 3 && min < l)) dp[r][g][b] = 0;
                }

                dp[max + 1][g][b] = (dp[max + 1][g][b] + dp[r][g][b]) % mod;
                dp[r][max + 1][b] = (dp[r][max + 1][b] + dp[r][g][b]) % mod;
                dp[r][g][max + 1] = (dp[r][g][max + 1] + dp[r][g][b]) % mod;
            }
        }
    }

    for (int i = 0; i < n; i++) {
        for (int j = 0; j < n; j++) {
            ret = (ret + dp[n][i][j] + dp[i][n][j] + dp[i][j][n]) % mod;
        }
    }

    std::cout << ret << std::endl;

    return 0;
}

Measured memory_bytes: 227712
#include<bits/stdc++.h>
using namespace std;
#define int long long
#define sz(x) (int)(x.size())
const int N = 52;
int comb[N][N] = {0};
void pascal() {
    for (int i = 0; i < N; i++) {
        comb[i][0] = 1;
        comb[i][1] = i;
    }
    for (int i = 2; i < N; i++) {
        for (int j = 2; j <= i; j++) {
            comb[i][j] = comb[i - 1][j - 1] + comb[i - 1][j];
        }
    }
}

signed main() {
    ios::sync_with_stdio(false); cin.tie(nullptr);
    pascal();
    int n, p;
    cin >> n >> p;
    int a[n];
    int zoj = 0, fard = 0;
    for (int i = 0; i < n; i++) {
        cin >> a[i];
        if (a[i] % 2) fard++;
        else zoj++;
    }
    int fard_ans = 0;
    if (p && fard == 0) {
        cout << "0\n";
        return 0;
    }
    for (int i = p; i <= fard; i+= 2) {
        fard_ans += comb[fard][i];
    }
    cout << fard_ans * (int)pow(2, zoj) << "\n";
}

Measured memory_bytes: 256
#include <iostream>

using namespace std;

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

    if(a == 1) a += 13;
    if(b == 1) b += 13;
    if(a > b) cout << "Alice" << endl;
    else if(a < b) cout << "Bob" << endl;
    else cout << "Draw" << endl;
}


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


#define vi vector<int>
#define pb push_back
#define pii pair<int, int>
#define mp make_pair
#define ll long long


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

    int a, b, c, k;
    cin >> a >> b >> c >> k;

    if ( max(a, max(b, c)) == a ) {
    	a = a * pow(2, k);
    } else if ( max(a, max(b, c)) == b ) {
    	b = b * pow(2, k);
    } else {
    	c = c * pow(2, k);
    }

    cout << a + b + c << endl;

    return 0;
}


Measured memory_bytes: 256
use std::str::FromStr;
use std::fmt::Debug;
use std::cmp;
#[allow(dead_code)]
fn read_as_vec<T>() -> Vec<T>
where T: FromStr, <T as FromStr>::Err : Debug{
    let mut s = String::new();
    std::io::stdin().read_line(&mut s).unwrap();
    s.trim().split_whitespace().map(|c| T::from_str(c).unwrap()).collect()

}

#[allow(dead_code)]
fn read_as_string() -> String{
    let mut s = String::new();
    std::io::stdin().read_line(&mut s).unwrap();
    s.trim().to_string()
}

fn main(){
    let n = read_as_vec::<u64>()[0];

    let mut ans: u64 = 0;
    for i in 1..n+1{
        if i%3 != 0 && i%5 != 0{
            ans += i;
        }
    }

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


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

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

const int INF = 1001001001;

int main() {

    int n;

    cin >> n;
    vector<int> a(n);

    rep(i, n) {
        int c;
        cin >> c;
        c--;
        a[i] = c;
    }

    vector<int> indexes(n);

    rep(i, n) {
        indexes[a[i]] = i;
    }

    set<int> upper; // x より大きい赤丸

    ll ans = 0;

    for (int x = n - 1; x >= 0; x--) {
        upper.insert(indexes[x]);
        vector<int> l(2, -1);
        vector<int> r(2, n);
        { // left
            auto it = upper.find(indexes[x]);
            rep(i, 2) {
                if (it == upper.begin()) break;
                it--;
                l[i] = *it;
            }
        }
        { // right
            auto it = upper.find(indexes[x]);
            rep(i, 2) {
                it++;
                if (it == upper.end()) break;
                r[i] = *it;
            }
        }

        vector<int> ls(2);
        vector<int> rs(2);
        ls[0] = l[0] - l[1];
        ls[1] = indexes[x] - l[0];
        rs[0] = r[0] - indexes[x];
        rs[1] = r[1] - r[0];

        ll c = (ll) ls[0] * rs[0] + (ll) ls[1] * rs[1];
        ans += c * (x + 1);
    }

    cout << ans << endl;
}


Measured memory_bytes: 5760
#include <stdio.h>
#include <limits.h>

#define WHITE 0
#define BLACK 1

int main(){

  int n, G[100][100], d[100], pi[100], color[100];
  int i, j, u, mincost, sum = 0;

  scanf("%d", &n);

  for(i = 0; i < n; i++){
    d[i] = INT_MAX;
    pi[i] = 0;
    color[i] = WHITE;
    for(j = 0; j < n; j++) scanf("%d", &G[i][j]);
  }

  d[0] = 0;

  while(1){
    mincost = INT_MAX;
    for(i = 0; i < n; i++){
      if(color[i] != BLACK && d[i] < mincost){
	mincost = d[i];
	u = i;
      }
    }
    if(mincost == INT_MAX) break;
    color[u] = BLACK;
    for(i = 0; i < n; i++){
      if(G[u][i] != -1 && color[i] != BLACK && G[u][i] < d[i]){
	pi[i] = u;
	d[i] = G[u][i];
      }
    }
  }

  for(i = 0; i < n; i++) sum += d[i];
  printf("%d\n", sum);
  
  return 0;
}

Measured memory_bytes: 640
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.text.DecimalFormat;

public class Main {

	public static void main(String[] args) {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		String str;
		try {
			str = br.readLine();

			double r = Double.valueOf(str);

			double round = r*2*Math.PI;
			double area = r*r*Math.PI;

			DecimalFormat df = new DecimalFormat("0.000000");
			System.out.println(df.format(area) + " " + df.format(round));
		} catch (IOException e) {
			e.printStackTrace();
		}
	}
}

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

int main() {
    int64_t N;
    cin >> N;
    vector<int64_t> ans(N+1,0);
    
    int64_t num;
    for ( int64_t x = 1; x < N; ++x){
        for ( int64_t y = x; y < N; ++y){
            for ( int64_t z = y; y < N; ++z){
                num = (x+y) * (x+y) + (y+z) * (y+z) + (z+x) * (z+x);
                if ( num > 2 * N ) break;
                if ( num % 2 == 0 ){
                    if ( x == y and y == z ) {
                        ans[num/2] = ans[num/2] + 1;
                    } else if ( x == y or y == z or z == x ){
                        ans[num/2] = ans[num/2] + 3;
                    } else {
                        ans[num/2] = ans[num/2] + 6;
                    }
                }
            }
        }
    }
    
    for ( int i = 1; i <= N; ++i){
        cout << ans[i] << endl;
    }
    
    return 0;
}


Measured memory_bytes: 3596
#include<bits/stdc++.h>
using namespace std;
int main()
{
    int sum=500;
    int k,n;
    cin>>k>>n;
    sum=sum*k;
    if(sum>=n)
    {
        cout<<"Yes";
    }
    else{
        cout<<"No";
    }
    return 0;
}


Measured memory_bytes: 256
/*
 ▓█████▄  ▄████▄  ▓██   ██▓ ██▓███   ██░ ██ ▓█████  ██▀███
▒██▀ ██▌▒██▀ ▀█   ▒██  ██▒▓██░  ██▒▓██░ ██▒▓█   ▀ ▓██ ▒ ██▒
 ░██   █▌▒▓█    ▄   ▒██ ██░▓██░ ██▓▒▒██▀▀██░▒███   ▓██ ░▄█ ▒
 ░▓█▄   ▌▒▓▓▄ ▄██▒  ░ ▐██▓░▒██▄█▓▒ ▒░▓█ ░██ ▒▓█  ▄ ▒██▀▀█▄
 ░▒████▓ ▒ ▓███▀ ░  ░ ██▒▓░▒██▒ ░  ░░▓█▒░██▓░▒████▒░██▓ ▒██▒
  ▒▒▓  ▒ ░ ░▒ ▒  ░   ██▒▒▒ ▒▓▒░ ░  ░ ▒ ░░▒░▒░░ ▒░ ░░ ▒▓ ░▒▓░
  ░ ▒  ▒   ░  ▒    ▓██ ░▒░ ░▒ ░      ▒ ░▒░ ░ ░ ░  ░  ░▒ ░ ▒░
  ░ ░  ░ ░         ▒ ▒ ░░  ░░        ░  ░░ ░   ░     ░░   ░
    ░    ░ ░       ░ ░               ░  ░  ░   ░  ░   ░
  ░      ░         ░ ░
*/
//focus less on how much problem you should solve within a fixed time and focus more on getting the problem solved and
//learning something from it
#include<bits/stdc++.h>
using namespace std;
#define fast ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
#define rep(i,a,b) for(ll i=a; i<b; i++)
#define per(i,a,b) for(ll i=a; i>=b; i--)
#define ll long long int
#define ld long double
#define vi vector<ll>
#define vii vector <pair<ll,ll> >
#define sedes set <ll, greater <ll> >
#define seasc set <ll>
#define pb push_back
#define mkp make_pair
#define ff first
#define ss second
#define MOD 1000000007
#define prec(n) fixed<<setprecision(n)
#define maxpq priority_queue<int>
#define minpq priority_queue<int, vector<int>, greater<int> >
#define umap unordered_map<ll, ll>
#define map map<ll, ll>
#define autoit(x,it) for(auto it = x.begin(); it != x.end(); it++)
#define mems(a, i) memset(a, i, sizeof(a))
#define endl '\n'
#define all(v) v.begin(),v.end()
#define gcd(a,b) __gcd((a),(b))
#define lcm(a,b) ((a)*(b))/gcd((a),(b))
#define printx(x) printf("%lld\n",x);
#define printxy(x,y) cout << x << y <<endl;
#define printxyz(x,y,z) cout << x << y << z <<endl;
#define deba(a) cout << #a << a << endl;
#define debab(a,b) cout << #a << a << #b << b << endl;
int main()
{
	fast;
	ll n;
	cin >> n;
	ll a[n];
	rep(i, 0, n)
	cin >> a[i];
	ll k = -100, ans = INT_MAX;
	while (k <= 100)
	{
		ll res = 0;
		rep(i, 0, n)
		{
			res += pow((a[i] - k), 2);
		}
		ans = min(ans, res);
		k++;
	}
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 3616
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned long long;
//#define ll long long
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 (a>b) { a=b; return 1; } return 0; }
#define rep(i, n) REP(i, 0, n)
#define rep_rev(i, n) for (int (i) = (int)(n) - 1 ; (i) >= 0 ; --(i))
#define ALL(v) v.begin(), v.end()
#define MSG(a) cout << #a << " " << a << endl;
#define REP(i, x, n) for(int i = x; i < n; i++)
#define all(x) (x).begin(),(x).end()
ll t1,t2;
const ll mod = 1000000007;
const int INF = 1e9;
const ll INFLONG = 1e18;
void swap(ll *x,ll *y){
  ll tmp;
  tmp = *x;
  *x = *y;
  *y = tmp;
}

int main(){
  string s;
  ll k;
  cin >> s >> k;
  ull keta = s.size();
  ll zerocou = 0;
  //vector<vector<ll>> vec(keta+1,vector<ll>(k+1,0));
  vector<vector<vector<ll>>> vec(keta+1,vector<vector<ll>>(k+2,vector<ll>(2,0)));
  vec[0][0][0] = 1;

  rep(i,keta) {
    if (s[i] != '0') {
      zerocou++;
    }
    if (zerocou > k) {
      break;
    }
    vec[i + 1][zerocou][0]++;
  }
  rep(i,keta){
    rep(j,k+1){
      if(s[i] != '0'){
        vec[i+1][j][1] += vec[i][j][0];
        vec[i+1][j+1][1] += vec[i][j][0] * (s[i] - '0' - 1);
      }
      vec[i+1][j][1] += vec[i][j][1];
      vec[i+1][j+1][1] += vec[i][j][1] * 9;
    }
  }
//  rep(i,keta+1){
//    rep(j,k+1){
//      //cout << vec[i][j][0] << " ";
//      cout << vec[i][j][0] + vec[i][j][1] << " ";
//    }
//    cout << endl;
//  }
  cout << vec[keta][k][0] + vec[keta][k][1] << endl;
}

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

int main()
{
    int A,B,C,D,E,res;

    int ryo[5];
    int amari[5];

    int min_index = 999;
    int min = 10;

    REP(i,5)
    {
        cin >> ryo[i];
        amari[i] = ryo[i] % 10;
        if(amari[i] < min && amari[i] != 0)
        {
            min = amari[i];
            min_index = i;
        }
    }

    res = 0;
    //あまり最小の要素番号
    REP(i,5)
    {
        res += ryo[i];

        if(i != min_index && amari[i] != 0)
        {
            res += 10 - amari[i];
        }
    }
    cout << res << endl;
}



Measured memory_bytes: 256
with Ada.Text_IO, Ada.Integer_Text_IO, Ada.Float_Text_IO;
 use Ada.Text_IO, Ada.Integer_Text_IO, Ada.Float_Text_IO;

procedure main is
   N: Integer;
begin
   get(N);
   if (N rem 2 = 0) then
      put(0.5, 0, 6, 0);
   else
      put(Float(N / 2 + 1) / Float(N), 0, 6, 0);
   end if;
end main;


Measured memory_bytes: 3708
#include <stdio.h>

typedef long long int ll;

ll solve(ll n) {
    switch(n % 4) {
        case 0: return n;
        case 1: return 1;
        case 2: return n+1;
        case 3: return 0;
    }
}

int main() {
    ll a, b;
    scanf("%lld %lld", &a, &b);
    printf("%lld\n", solve(a-1)^solve(b));
    return 0;
}

Measured memory_bytes: 128
//#include"pch.h"
//#define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
#include<stdlib.h>
#include<cmath>
#include<math.h>
#include<string>
#include<string.h>
#include<algorithm>
#include<iostream>
using namespace std;

int main() {
	int D, N;
	cin >> D >> N;
	if(N==100)cout << (int)(N * pow(100, D) + pow(100, D))<<endl;
	else cout <<(int) (N * pow(100, D))<< endl;
	

	return(0);
}


Measured memory_bytes: 384
#include <stdio.h>

main(){
  int N, K;
  scanf("%d %d",&N,&K);
  int answer = 1;
  for ( int i = 0; i < N; i++ ){
    if ( answer <= K ){
    answer *= 2;
    }
    else {
    answer += K;
    }
  }
  printf ("%d\n",answer);
}

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

int lol[10];
int n;
int p[10];
int q[10];

int main(){
	scanf("%d",&n);
	for(int i=1;i<=n;i++) lol[i] = i;
	for(int i=1;i<=n;i++) scanf("%d",&p[i]);
	for(int i=1;i<=n;i++) scanf("%d",&q[i]);
	int cnt = 1;
	int ans = 0;
	do{
		bool ps = 1, qs = 1;
		for(int i=1;i<=n;i++){
			if(p[i] != lol[i]) ps = 0;
			if(q[i] != lol[i]) qs = 0;
		}
		if(ps) ans+=cnt;
		if(qs) ans-=cnt;
		cnt++;
	} while(next_permutation(lol+1,lol+n+1));
	printf("%d\n",abs(ans));
	return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define endl '\n'
#define pb push_back
#define mp make_pair
#define SZ(x) ((int)(x).size())
#define all(x) x.begin(),x.end()
#define mem0(s) memset(s,0,sizeof(s))
#define meminf(s) memset(s,0x3f,sizeof(s))
#define mp_insert(a,b,c) mp.insert(map<pair<int,int>,int>::value_type(make_pair(a,b),c))
double pi=acos(-1);
typedef long long ll;
typedef unsigned long long ull;
inline ll lowbit(ll x){return x&(-x);}
inline ll min(ll a,ll b){return a<b?a:b;}
inline ll max(ll a,ll b){return a>b?a:b;}
const int INF=0x3f3f3f3f,max_n=200005,mod=1e9+7;
inline ll gcd(ll a,ll b){return b==0?a:gcd(b,a%b);}
inline ll pow(ll a,ll b,ll mod){ll res=1;a%=mod;assert(b>=0);for(;b;b>>=1){if(b&1)res=res*a%mod;a=a*a%mod;}return res;}

int dad[max_n];
int deep[max_n];
int people[max_n];
int find(int x)
{
    if(dad[x]==x)return x;
    return dad[x]=find(dad[x]);
}
void link(int x,int y)
{
    x=find(x);
    y=find(y);
    if(x==y)
    {
        return;
    }
    else if(deep[x]<deep[y])
    {
        dad[x]=y;people[y]+=people[x];
    }
    else if(deep[x]>deep[y])
    {
        dad[y]=x;people[x]+=people[y];
    }
    else if(deep[x]==deep[y])
    {
        dad[x]=y;
        deep[y]++;
        people[y]+=people[x];
    }
}
struct Edge
{
    int from,to;
}e[200005];
int V,E,q;
int cnt;
int x;
int tt;
vector<int>v1;
long long ans;
int peng[200005];
int feng[200005];
int main()
{
    int V,m;cin>>V>>m;int a,b;
    for(int i=1;i<=V;i++)
    {
        dad[i]=i;people[i]=1;
    }
    for(int i=1;i<=m;i++)
    {
        cin>>a>>b;
        peng[a]++;
        peng[b]++;
        link(a,b);
    }
    cout<<*max_element(people+1,people+V);
}

Measured memory_bytes: 6744
import sys

lines = sys.stdin.readlines()

# lines = test.strip().split('\n')
num_a ,num_b, num_m = [int(v) for v in lines[0].split()]
# ----

a_list = [int(v) for v in lines[1].split()[:num_a+1]]
b_list = [int(v) for v in lines[2].split()[:num_b+1]]

res1 = [
    a_list[a_i-1]+b_list[b_i-1]-discount for a_i, b_i, discount in [
        map(int, l.split())  for l in lines[3:num_m+3]
    ]
]

res2 = min(a_list) + min (b_list)

print(min(min(res1), res2))

Measured memory_bytes: 72128
#include<bits/stdc++.h>
using namespace std;
int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  int n, l;
  cin >> n >> l;
  vector<string> s(n);
  for(int i = 0; i < n; i++) cin >> s[i];
  sort(s.begin(), s.end());
  for(int i = 0; i < n; i++) cout << s[i];
  cout << endl;
  return 0;
}

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

namespace id_0533cs
{
    class Program
    {
        static void Main(string[] args)
        {
            var wUnivScores = new List<int>();
            var kUnivScores = new List<int>();
            foreach(var i in Enumerable.Range(0, 10))
            {
                wUnivScores.Add(int.Parse(Console.ReadLine()));
            }
            foreach (var i in Enumerable.Range(0, 10))
            {
                kUnivScores.Add(int.Parse(Console.ReadLine()));
            }
            wUnivScores.Sort();
            wUnivScores.Reverse();
            kUnivScores.Sort();
            kUnivScores.Reverse();
            Console.WriteLine("{0} {1}",wUnivScores.Take(3).Sum(),
                kUnivScores.Take(3).Sum());
        }
    }
}



Measured memory_bytes: 9504
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.lang.Math;

public class Main {
    public static void main(String[] args) {
        try {
            BufferedReader stdReader = new BufferedReader(new InputStreamReader(System.in));
            
            String line;
            
            while((line = stdReader.readLine()) != null) {
                String[] input = line.split(" ", 0);
                int a = Integer.parseInt(input[0]);
                int b = Integer.parseInt(input[1]);
                
                int area = a * b;
                int round = (a + b) * 2;
                
                System.out.println(area + " " + round);
            }
            stdReader.close();
        } catch(Exception e) {
            e.getStackTrace();
            System.exit(-1);
        }
    }
}

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

using pii = pair<int,int>;
using ll = long long;
#define rep(i, j) for(int i=0; i < (int)(j); i++)
#define repeat(i, j, k) for(int i = (j); i < (int)(k); i++)
#define all(v) v.begin(),v.end()
#define debug(x) cerr << #x << " : " << x << endl

template<class T> bool set_min(T &a, const T &b) { return a > b  ? a = b, true : false; }
template<class T> bool set_max(T &a, const T &b) { return a < b  ? a = b, true : false; }
// vector
template<class T> istream&
operator >> (istream &is , vector<T> &v) { for(T &a : v) is >> a; return is; }
template<class T> ostream&
operator << (ostream &os , const vector<T> &v) { for(const T &t : v) os << "\t" << t; return os << endl; }
// pair
template<class T, class U> ostream&
operator << (ostream &os , const pair<T, U> &v) { return os << "<" << v.first << ", " << v.second << ">"; }

const int INF = 1 << 30;
const ll INFL = 1LL << 60;

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

    int N, K; cin >> N >> K;
    map<int, int> A;
    rep(i, N) {
        int a; cin >> a;
        A[a]++;
    }
    vector<int> cnt;
    for(auto &p : A) cnt.push_back(p.second);    
    sort(all(cnt), greater<int>());
    int ans = 0;
    for(int i = K; i < cnt.size(); i++) ans += cnt[i];
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 10744
n,m=input().split()
n=int(n)
m=int(m)
a=[]
for i in range(n):
    x=[int(k) for k in input().split()]
    a.append(x)
b=[]
for i in range(m):
    x=int(input())
    b.append(x)
for i in range(n):
    c=sum([a[i][k]*b[k] for k in range(m)])
    print(c)
    



Measured memory_bytes: 6016
#include <bits/stdc++.h>
#include <time.h>
#include <stdlib.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#define pb push_back
#define IOS ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define ll long long
#define ull unsigned long long
#define gcd(a,b) __gcd((a),(b))
#define lcm(a,b) ((a)*(b))/__gcd((a),(b))
#define clr(x) x.clear()
#define vi vector<int>
#define vll vector<long long>
#define vvi vector<vi>
#define mp make_pair
#define hell 1000000007
#define pii pair<int,int>
#define pll pair<ll,ll>
#define vpii vector<pii>
#define vpll vector<pll>
#define all(a) a.begin(),a.end()
#define ign cin.ignore();

#define o_set tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update>
#define o_setll tree<ll, null_type,less<ll>, rb_tree_tag,tree_order_statistics_node_update>
//member functions :
//1. order_of_key(k) : number of elements strictly lesser than k
//2. find_by_order(k) : k-th element in the set

using namespace std;
using namespace __gnu_pbds;

void __print(int x) {cerr << x;}
void __print(long x) {cerr << x;}
void __print(long long x) {cerr << x;}
void __print(unsigned x) {cerr << x;}
void __print(unsigned long x) {cerr << x;}
void __print(unsigned long long x) {cerr << x;}
void __print(float x) {cerr << x;}
void __print(double x) {cerr << x;}
void __print(long double x) {cerr << x;}
void __print(char x) {cerr << '\'' << x << '\'';}
void __print(const char *x) {cerr << '\"' << x << '\"';}
void __print(const string &x) {cerr << '\"' << x << '\"';}
void __print(bool x) {cerr << (x ? "true" : "false");}

template<typename T, typename V>
void __print(const pair<T, V> &x) {cerr << '{'; __print(x.first); cerr << ','; __print(x.second); cerr << '}';}
template<typename T>
void __print(const T &x) {int f = 0; cerr << '{'; for (auto &i: x) cerr << (f++ ? "," : ""), __print(i); cerr << "}";}
void _print() {cerr << "]\n";}
template <typename T, typename... V>
void _print(T t, V... v) {__print(t); if (sizeof...(v)) cerr << ", "; _print(v...);}
#ifndef ONLINE_JUDGE
#define debug(x...) cerr << "[" << #x << "] = ["; _print(x)
#else
#define debug(x...)
#endif

int main()
{
    IOS
    int a,b;
    cin>>a>>b;
    int num1=(a*100+7)/8,num2=(b*100+9)/10;
    int res=max(num1,num2);
    int c1=(res*8)/100,c2=res/10;
    if(c1==a&&c2==b){
        cout<<res<<"\n";
    }
    else cout<<"-1\n";
    return 0;
}


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

#define rep(i, a, b) for(int i = (a); i < (b); ++i)
#define per(i, a, b) for(int i = (b)-1; i >= (a); --i)
#define all(x) begin(x), end(x)
#define sz(x) (int)(x).size()
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define fst first
#define snd second

template<class T> bool ckmin(T& a, const T& b) { return b < a ? a = b, 1 : 0; }
template<class T> bool ckmax(T& a, const T& b) { return a < b ? a = b, 1 : 0; }

typedef long long ll;
typedef long double ld;
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef vector<pii> vii;

int main() {
  cin.tie(0)->sync_with_stdio(0);
  cin.exceptions(cin.failbit);

  int n;
  cin >> n;

  vi a(n);
  rep(i,0,n) cin >> a[i];


  map<int,int> occ;

  ll ans = 0;
  rep(i,0,n) {
    int sr = i-a[i];
    if (occ.find(sr) != occ.end()) ans += occ[sr];
    ++occ[a[i]+i];
  }
  cout << ans << '\n';
}

Measured memory_bytes: 13428
#include <stdio.h>
#define MAX 101
 
int n, ni = 1;
int A[MAX][MAX] = {0}, a[MAX] = {0}, b[MAX] = {0};
 
void serch(int x){
  int i;
   
  a[x] = ni++;
  for(i=1; i<=n; i++){
    if(a[i] == 0 && A[x][i] == 1)
      serch(i);
  }
  b[x] = ni++;
}
 
int main(){
  int i, j, k, x, y;
   
  scanf("%d", &n);
  for(i=1; i<=n; i++){
    scanf("%d%d", &x, &k);
    for(j=1; j<=k; j++){
      scanf("%d", &y);
      A[x][y] = 1;
    }
  }
  
  for(i=1; i<=n; i++){
    if(a[i] == 0)
      serch(i);
  }
   
  for(i=1; i<=n; i++){
    printf("%d %d %d\n", i, a[i], b[i]);
  }
  
  return 0;
}



Measured memory_bytes: 2768
#include<cstdio>
#include<cstring>
#include<cstdlib>
#include<cmath>
#include<iostream>
#include<algorithm>
#include<map>
#include<queue>
#include<vector>
using namespace std;
#define inf 0x3f3f3f
typedef long long ll;
const int maxn = 2e5+5;
int k,n,a[maxn];
int main(){
	cin >> k >> n; 
	for(int i = 1;i <= n;i++)	cin >> a[i];
	int ans = a[n] - a[1];
	for(int i = 1;i < n;i++){
		ans = min(ans,k+a[i]-a[i+1]);
	}
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 1024
#include<bits/stdc++.h>
using namespace std;
int gcd(int a, int b, int c) {
	int t, s;
	if (a < b) {
		t = a; 
		a = b;
		b = t;
	}
	t = b;
	while (a % b) {
		t = a % b;
		a = b;
		b = t;
	}
	if (t < c) {
		s = t;
		t = c;
		c = s;
	}
	while (t % c) {
		s = t % c;
		t = c;
		c = s;
	}
	return c;
}
int main() {
    int n;
    cin>>n;
    int x = 0;
    for (int i = 1; i <= n; i++) 
    	for (int j = 1; j <= n; j ++) 
    		for (int g = 1; g <= n; g++)
    		x+=gcd(i, j, g);
		
	cout<<x;
}

Measured memory_bytes: 3636
#!/usr/bin/env python
from __future__ import division, print_function

import os
import sys
from io import BytesIO, IOBase

if sys.version_info[0] < 3:
    from __builtin__ import xrange as range
    from future_builtins import ascii, filter, hex, map, oct, zip


def main():
    n = int(input())
    s = input()

    g = 1
    p = s[0]
    for i in s[1:]:
        if i != p:
            g += 1
            p = i

    print(g)


# region fastio

BUFSIZE = 8192


class FastIO(IOBase):
    newlines = 0

    def __init__(self, file):
        self._fd = file.fileno()
        self.buffer = BytesIO()
        self.writable = "x" in file.mode or "r" not in file.mode
        self.write = self.buffer.write if self.writable else None

    def read(self):
        while True:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            if not b:
                break
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines = 0
        return self.buffer.read()

    def readline(self):
        while self.newlines == 0:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            self.newlines = b.count(b"\n") + (not b)
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines -= 1
        return self.buffer.readline()

    def flush(self):
        if self.writable:
            os.write(self._fd, self.buffer.getvalue())
            self.buffer.truncate(0), self.buffer.seek(0)


class IOWrapper(IOBase):
    def __init__(self, file):
        self.buffer = FastIO(file)
        self.flush = self.buffer.flush
        self.writable = self.buffer.writable
        self.write = lambda s: self.buffer.write(s.encode("ascii"))
        self.read = lambda: self.buffer.read().decode("ascii")
        self.readline = lambda: self.buffer.readline().decode("ascii")


def print(*args, **kwargs):
    """Prints the values to a stream, or to sys.stdout by default."""
    sep, file = kwargs.pop("sep", " "), kwargs.pop("file", sys.stdout)
    at_start = True
    for x in args:
        if not at_start:
            file.write(sep)
        file.write(str(x))
        at_start = False
    file.write(kwargs.pop("end", "\n"))
    if kwargs.pop("flush", False):
        file.flush()


if sys.version_info[0] < 3:
    sys.stdin, sys.stdout = FastIO(sys.stdin), FastIO(sys.stdout)
else:
    sys.stdin, sys.stdout = IOWrapper(sys.stdin), IOWrapper(sys.stdout)

input = lambda: sys.stdin.readline().rstrip("\r\n")

# endregion

if __name__ == "__main__":
    main()


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

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

	int n;
	cin >> n;

	int t;
	multiset<int> ms;
	cin >> t;
	ms.insert(t);

	for (int i = 1; i < n; ++i) {
		cin >> t;
		if (*ms.begin() >= t) ms.insert(t);
		else {
			auto it = ms.lower_bound(t);
			it--;
			ms.erase(it);
			ms.insert(t);
		}
	}
	cout << ms.size() << '\n';
}

Measured memory_bytes: 4992
#pragma GCC optimize("Ofast,fast-math,unroll-loops")
  
#include <bits/stdc++.h>
//#include <ext/pb_ds/assoc_container.hpp>
//#include <ext/pb_ds/tree_policy.hpp>
  
#define int ll
//#define double long double
#define endl '\n'
#define all(C) (C).begin(), (C).end()
#define rall(C) (C).rbegin(), (C).rend()
#define mp make_pair 
#define pb emplace_back
#define dbg(x) cerr << #x << " : " << x << endl
//#define PI 3.141592653589
  
using namespace std;
//using namespace __gnu_pbds;
         
using ll = long long;
using ull = unsigned long long;
using ld = long double;
using pii = pair <int, int>;
using pll = pair <ll, ll>;
using pld = pair <ld, ld>;
 
/*
const ll MAX_MEM = 5e8;
char MEM[MAX_MEM];
ll MEM_POS = 0;
void* operator new(size_t x)
{
    auto ret = MEM + MEM_POS;
    MEM_POS += x;
    assert(MEM_POS < MAX_MEM);
    return ret;
}
void operator delete(void*)
{}
 
*/
 
template <class T>
istream& operator>> (istream &in, vector <T> &a)
{
    for (auto &i : a)
        in >> i;
    return in;
}
         
template <class T> 
ostream& operator<< (ostream &out, vector <T> a)
{
    for (auto &i : a)
        out << i << ' ';
    return out;
}
         
template <class T, class U>
istream& operator>> (istream &in, pair <T, U> &p)
{
    in >> p.first >> p.second;
    return in;
}
         
template <class T, class U>
ostream& operator<< (ostream &out, pair <T, U> p)
{
    out << p.first << " " << p.second << " ";
    return out;
}
         
inline void Start()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0), cout.tie(0);
    //freopen("circlecover.in", "r", stdin);
    //freopen("circlecover.out", "w", stdout);
}

signed main()
{
    Start();
    int n;
    cin >> n;
    vector <int> a(n);
    cin >> a;
    sort(rall(a));
    a.pb(0);
    for (int i = 0; i < n; ++i)
    {
        if (a[i + 1] <= i + 1)
        {
            int pos = n;
            for (int j = i; j < n + 1; ++j)
                if (a[j] <= i)
                {
                    pos = j;
                    break;
                }
            if ((a[i] - i) % 2 == 1 && (pos - i) % 2 == 1)
                cout << "Second";
            else
                cout << "First";
            return 0;
        }
    }
    return 0;
}



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

struct Edge
{
    public int to;
    public int dist;
}
struct FC
{
    public int now;
    public int from;
    public bool color;
}
class Program
{
    static void Main()
    {
        var N = int.Parse(ReadLine());
        var u = new int[N - 1];
        var v = new int[N - 1];
        var w = new int[N - 1];
        for (int i = 0; i < N - 1; i++)
        {
            var line = ReadLine().Split(' ');
            u[i] = int.Parse(line[0]) - 1;
            v[i] = int.Parse(line[1]) - 1;
            w[i] = int.Parse(line[2]);
        }

        var tree = new List<Edge>[N];
        for (int i = 0; i < tree.Length; i++)
        {
            tree[i] = new List<Edge>();
        }
        for (int i = 0; i < u.Length; i++)
        {
            tree[u[i]].Add(new Edge { to = v[i], dist = w[i] });
            tree[v[i]].Add(new Edge { to = u[i], dist = w[i] });
        }

        var vis = new bool[N];
        var col = new bool[N];
        var q = new Queue<FC>();
        q.Enqueue(new FC { from = -1, color = false });
        vis[0] = true;
        while (q.Count != 0)
        {
            var n = q.Dequeue();
            if (n.from != -1)
            {
                col[n.now] = n.color;
            }
            foreach (var s in tree[n.now])
            {
                if (!vis[s.to])
                {
                    q.Enqueue(new FC { now = s.to, color = s.dist % 2 == 0 ? n.color : !n.color });
                    vis[s.to] = true;
                }
            }
        }

        for (int i = 0; i < N; i++)
        {
            WriteLine(col[i] ? "0" : "1");
        }
    }
}


Measured memory_bytes: 32376
n = list(input())
a = int(n[0])
b = int(n[1])
c = int(n[2])
d = int(n[3])
tmp = 0
ans = ''
for i in range(8):
    j = i

    if bin(j & 1) == bin(1):
        tmp = a + b
        ans = str(a) + '+' + str(b)
    else:
        tmp = a - b
        ans = str(a) + '-' + str(b)
    if bin(j>>1 & 1) == bin(1):
        tmp += c
        ans += '+' + str(c)
    else:
        tmp -= c
        ans += '-' + str(c)
    if bin(j>>2 & 1) == bin(1):
        tmp += d
        ans += '+' + str(d)
    else:
        tmp -= d
        ans += '-' + str(d)
    # print(i,bin(j & 1),bin(j>>1),bin(j>>2),ans)

    if tmp == 7:
        print(ans + '=7')
        break


Measured memory_bytes: 3064
#include <iostream>

using namespace std;

int main() {
	int n;
	int m;
	int digit[4] = { 10,10,10,10 };
	cin >> n >> m;
	for (int i = 0; i < m; i++) {
		int s, c;
		cin >> s >> c;
		if (digit[s] == 10) digit[s] = c;
		else if (digit[s] != c){
			cout << -1;
			return 0;
		}
	}
	if ((digit[1]%10) == 0) {
		if (n == 1) {
			cout << 0;
			return 0;
		}
		else {
			if(digit[1] == 10) digit[1] = 1;
			else {
				cout << -1;
				return 0;
			}
		}
	}

	int answer = 0;
	for (int i = 1; i <= n; i++) {
		answer *= 10;
		answer += (digit[i] % 10);
	}
	cout << answer;
	return 0;
}

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

#define DEBUG(x) cout << #x << ": " << x << endl;
#define DEBUG_VEC(v)                                      \
  cout << #v << ":";                                      \
  for (int i = 0; i < v.size(); i++) cout << " " << v[i]; \
  cout << endl

typedef long long ll;
#define vi vector<int>
#define vl vector<ll>
#define vii vector<vector<int> >
#define vll vector<vector<ll> >
#define vs vector<string>
#define pii pair<int, int>
#define pis pair<int, string>
#define psi pair<string, int>
const int inf = 1000000001;
const ll INF = 1e18;
#define MOD 1000000007
#define mod 1000000009
#define pi 3.14159265358979323846
#define Sp(p) cout << setprecision(15) << fixed << p << endl;
int dx[4] = {1, 0, -1, 0}, dy[4] = {0, 1, 0, -1};
int dx2[8] = {1, 1, 0, -1, -1, -1, 0, 1}, dy2[8] = {0, 1, 1, 1, 0, -1, -1, -1};


int main() {
  int n, i, j;
  scanf("%d",&n);
  vl a(n);
  vl b(n);
  for (i = 0; i < n; i++) {
    scanf("%lld",&a[i]);
    a[i]--;
    b[a[i]] = i;
  }
  set<int> st;
  st.insert(-1); st.insert(n);
  //DEBUG_VEC(a);
  //DEBUG_VEC(b);
  ll ans = 0;
  for (i = 0; i < n; i++) {
    st.insert(b[i]);
    auto itr = st.find(b[i]);
    itr++;
    ll r = *itr;
    itr--; itr--;
    ll l = *itr;
    ans += (i + 1) * (b[i] - l) * (r - b[i]);
  }
  cout << ans << endl;
}


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

using LD = long double;

LD dp[234567];

int main() {
	int N,K;
	cin>>N>>K;
	for(int i=0;i<234567;++i)dp[i]=1.;
	LD ans=0;
	for(int x=K-1;x>=1;--x){
		dp[x]=dp[x+x]*0.5;
	}
	for(int x=1;x<=N;++x){
		ans+=dp[x];
	}
	ans/=N;
	cout<<fixed;
	cout.precision(20);
	cout<<ans<<endl;
	return 0;
}

Measured memory_bytes: 3968
var
	S:String;
	A,B:int64;
	i:Longint;
begin
	readln(S);
	i:=1;
	while S[i]<>' 'do begin
		A:=A*10+ord(S[i])-48;
		inc(i);
	end;
	B:=(ord(S[i+1])-48)*100+(ord(S[i+3])-48)*10+ord(S[i+4])-48;
	writeln(A*B div 100);
end.


Measured memory_bytes: 1348
#include<iostream>
#include<bits/stdc++.h>
#include<algorithm>
#include<stdio.h>
#include<math.h>
#include<stdlib.h>
#include<string.h>
using namespace std;
typedef long long ll;

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
//    cout<<fixed;
//    cout<<setprecision(10);

    string st;
    cin>>st;
    bool chk=true;
    if (st[2]!=st[3] || st[4]!=st[5]) cout<<"No"<<endl;
    else cout<<"Yes"<<endl;


    return 0;
}


Measured memory_bytes: 256
/*
 * sto Qingyu orz
 * 感谢真神sqy无私的教诲。膜时队者处处阿克，只因大师sqy在他背后。不膜大师者违背了真神的旨意，真神必将降下天谴,
 * 使其天天爆零
 * 我不由自主地膜拜真神sqy。
 * Author: RainAir
 * Time: 2019-10-16 19:59:13
 */
#include <algorithm>
#include <iostream>
#include <cstring>
#include <climits>
#include <cstdlib>
#include <cstdio>
#include <bitset>
#include <vector>
#include <cmath>
#include <ctime>
#include <queue>
#include <stack>
#include <map>
#include <set>

#define fi first
#define se second
#define U unsigned
#define P std::pair
#define LL long long
#define pb push_back
#define MP std::make_pair
#define all(x) x.begin(),x.end()
#define CLR(i,a) memset(i,a,sizeof(i))
#define FOR(i,a,b) for(int i = a;i <= b;++i)
#define ROF(i,a,b) for(int i = a;i >= b;--i)
#define DEBUG(x) std::cerr << #x << '=' << x << std::endl

#define int LL
inline LL S(LL n){
    int res = 0;
    while(n) res += n%10,n /= 10;
    return res;
}

inline LL f(LL n){
    double mn = n/S(n);int ans = n;
    for(int d = 1;d <= n;d *= 10){
        int t = n/d*d+d*10-1;
        double gx = 1.0*t/S(t);
        if(gx < mn){
            mn = gx;
            ans = t;
        }
    }
    return ans;
}

signed main(){
    int n;scanf("%lld",&n);
    LL now = 1;
    while(n--){
        printf("%lld\n",now);
        now = f(now+1);
    }
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define rep(i,n) for(int i=0;i<n;i++)
#define rep1(i,n) for(int i=1;i<=n;i++)
#define rep2(i,n) for(int i=0;i<=n;i++)
#define repr(i,a,n) for(int i=a;i<n;i++)
#define all(a) a.begin(),a.end()
#define P pair<long long,long long>
#define double long double
#define INF 1e10
#define MOD 1e9+7
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; }
using Graph = vector<vector<int>>;
int fg(int k){
    int sum = 1;
    for (int i = 1; i <= k; ++i)
    {
        sum *= i;
    }
    return sum;
}
signed main(){
 int a;
  cin>>a;
  vector <int> vec(a);
  rep(i,a){
    cin>>vec[i];
  }
  int sum=0;
  rep(j,a){
    for(int k=j+1;k<a;k++){
      for(int l=k+1;l<a;l++){
        if(vec[j]!=vec[k]&&vec[k]!=vec[l]&&vec[j]!=vec[l]&&vec[j]+vec[k]>vec[l]&&vec[j]+vec[l]>vec[k]&&vec[l]+vec[k]>vec[j]){
          sum++;
        }
      }
    }
  }
    cout<<sum;
}   

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

int main() {
  int n,m;
  cin >> n >> m;
  int res = 0;
  for (int i=0; i<n; ++i) {
    bool used = (m==1);
    for (int j=0; j<m; ++j) {
      bool a; cin >> a;
      a ^= ((i==0)^(j==0||j==m-1));
      res += a;
      if (!used && !a) {
        used = 1;
        res++;
      }
    }
    if (!used && m >= 3) res--;
  }
  cout << res << endl;
}

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

int main() {
  int a, b;
  cin >> a >> b;
  int c = a;
  int ans = 1;

  if(b == 1) cout << 0;
  else {
    while(c < b){
      c += a - 1;
      ans++;
    }
    cout << ans;
  }
}

Measured memory_bytes: 256
// Author : MohamedSameh
#include <bits/stdc++.h>
using namespace std ;
typedef long long ll ;
int n , m ;
int a[1000][2];
int dp[1000][(1<<12)];
int solve (int i = 0, int mask =0  )
{
    if (mask == (1<<n) - 1 )return 0;
    if (i == m )return 1e9 ;
    int &ret = dp[i][mask];
    if (~ret)return ret ;
    ret = solve(i+1 , mask );
    ret = min (ret , a[i][0] + solve(i+1 , mask | a[i][1] ));
    return ret;
}
int main ()
{
    scanf ("%d%d" , &n , &m  );
    for (int i= 0 ; i < m  ;i++)
    {
        int b , id ;
        scanf ("%d%d" , a[i] , &b );
        while (b--)
        {
            scanf ("%d" , &id );
            id--;
            a[i][1] |= (1 << id );
        }
    }
    memset(dp , -1 ,sizeof dp);
    int ans = solve();
    if (ans > 1e8 )ans = -1 ;
    printf ("%d\n" , ans);
  return 0 ;
}


Measured memory_bytes: 16256
#include <iostream>
#include <string.h>
#include <string>
#include <algorithm>
#include <math.h>
using namespace std;

void b_counting_roads(void) {
	int n, m;
	int a[100];
	int b[100];
	int cnt[100] = { 0 };
	cin >> n >> m;
	for (int i = 0; i < m; i++) cin >> a[i] >> b[i];

	for (int i = 0; i < m; i++) {
		cnt[a[i]]++;
		cnt[b[i]]++;
	}

	for (int i = 1; i <= n; i++) cout << cnt[i] << endl;
}

int main()
{
	b_counting_roads();
    return 0;
}

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

int a,b,cnt;

int main(){
	cin>>a>>b;
	int tmp=b;
	while(tmp) {++cnt; tmp/=10;}
	if(cnt==1) tmp=10;
	if(cnt==2) tmp=100;
	if(cnt==3) tmp=1000;
	a=a*tmp+b;
	b=sqrt(a);
	if(b*b==a) cout<<"Yes";
	else cout<<"No";
}

Measured memory_bytes: 256
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <climits>
#include <vector>
#include <string>
#include <queue>
#include <deque>
#include <list>
#include <stack>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <algorithm>

#define int long long
#define MOD 1000000007

#define rep(i, n) for (int i = 0; i < (n); i++)
#define itrep(i, a) for (auto i = (a).begin(); i != (a).end(); i++)
#define REP(i, a, n) for (int i = (a); i <= (n); i++)
#define all(a) (a).begin(), (a).end()
#define mp(a, b) make_pair((a), (b))

using namespace std;

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

template<class T> void inputVector(vector<T>& v, int n) {
    v.resize(n);
    for (int i = 0; i < v.size(); i++) cin >> v[i];
}

int N, K;
vector<vector<int>> nexts;

int dp[60][60][100];
int memo[60][100];

int f(int now, int bit) {
    if (bit == -1) return 1;
    if (memo[now][bit] != -1) return memo[now][bit];

    int ret = 0;

    if ((K & (1LL << bit))) {
        rep(i, N) {
            ret += dp[now][i][bit] * f(i, bit - 1);
            ret %= MOD;
        }
    } else {
        ret = f(now, bit - 1);
    }

    memo[now][bit] = ret;
    //cerr << "f(" << now << ", " << bit << ") = " << ret << endl;

    return ret;
}

signed main() {
    rep(i, 60) rep(j, 100) memo[i][j] = -1;

    cin >> N >> K;

    nexts.resize(N);

    rep(i, N) {
        rep(j, N) {
            bool con;
            cin >> con;
            if (con) {
                nexts[i].push_back(j);
            }
        }
    }

    rep(i, N) {
        for (int next : nexts[i]) {
            dp[i][next][0] = 1;
        }
    }

    REP(i, 1, 62) {
        rep(j, N) {
            rep(x, N) {
                rep(k, N) {
                    dp[j][k][i] += dp[j][x][i - 1] * dp[x][k][i - 1];
                    dp[j][k][i] %= MOD;
                }
            }
        }
    }

    int ret = 0;

    rep(i, N) {
        ret += f(i, 62);
        ret %= MOD;
    }

    cout << ret << endl;

    return 0;
}


Measured memory_bytes: 2432
#include <bits/stdc++.h>
#include<iostream>
#include<string>
#include<queue>
#include<vector>
#define FOR(i,a,b) for(int i=(a);i<(b);i++)//初期値a,i<bの範囲でループ
#define REP(i,n) FOR(i,0,n)//初期値0,i<nの範囲でループ
using namespace std;
typedef long long ll;//int64
typedef unsigned long long ull;

int n;
ll c[100010];
int cnt,flag;
int cc;
int main(){
    cin>>n;
    REP(i,n){
        cin>>c[i];
        
/*
        REP(j,i){
            if(c[j]==c[i]){
                cout<<"kaburi"<<endl;
                c[j]=0;
                c[i]=0;
            }
        }
        */
    }
    sort(c,c+n);


    REP(i,n){
        if(c[i]==c[i+1]){
            cnt++;
        }else{
            if(cnt%2==0)cc++;
            cnt=0;
        }
    }
    cout<<cc;
    

    return 0;
}

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

using ll    = long long;
using ull   = unsigned long long;
using veci  = vector<int>;
using vecll = vector<ll>;
#define EPS (1e-7)
#define INF (1e9)
#define PI  (acos(-1))
#define FOR(i,a,b) for(int i = (a);i < (b); ++i)
#define REP(i,n) for(int i= 0;i<(int)(n);++i)
#define pb push_back

veci enum_div(int n){
	veci ret;
	ret.pb(1);
	for(int i=1;i*i<n;i++){
		if(n%i==0){
			ret.pb(i);
			if(i != n/i){ret.pb(n/i);}
		}
	}
	ret.pb(n);
	return ret;
}
int gcb(int a,int b){return ((b == 0)? a : gcb(b,a%b));}
int gcd(int a,int b){return (a*b) / gcb(a,b);}

int main(){
    string s;
    cin >> s;
    int ans = 0;
    REP(i,s.size()){
        if(s[i] == '+'){
            ans++;
        }else{
            ans--;
        }
    }
    cout << ans << endl;
	return 0;
}



Measured memory_bytes: 256