akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
#include <string>
#include <queue>
#include <stack>
#include <algorithm>
#include <list>
#include <vector>
#include <complex>
#include <utility>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <climits>
#include <bitset>
#include <ctime>
#include <map>
#include <unordered_map>
#include <set>
#include <unordered_set>
#include <cassert>
#include <cstddef>
#include <iomanip>
#include <numeric>
#include <tuple>
#include <sstream>
#include <fstream>
#include <functional>

using namespace std;
#define REP(i, n) for (int (i) = 0; (i) < (n); (i)++)
#define FOR(i, a, b) for (int (i) = (a); (i) < (b); (i)++)
#define RREP(i, a) for(int (i) = (a) - 1; (i) >= 0; (i)--)
#define FORR(i, a, b) for(int (i) = (a) - 1; (i) >= (b); (i)--)
#define DEBUG(C) cerr << #C << " = " << C << endl;
using LL = long long;
using VI = vector<int>;
using VVI = vector<VI>;
using VL = vector<LL>;
using VVL = vector<VL>;
using VD = vector<double>;
using VVD = vector<VD>;
using PII = pair<int, int>;
using PDD = pair<double, double>;
using PLL = pair<LL, LL>;
using VPII = vector<PII>;
template<typename T> using VT = vector<T>;
#define ALL(a) begin((a)), end((a))
#define RALL(a) rbegin((a)), rend((a))
#define SORT(a) sort(ALL((a)))
#define RSORT(a) sort(RALL((a)))
#define REVERSE(a) reverse(ALL((a)))
#define MP make_pair
#define FORE(a, b) for (auto &&a : (b))
#define EB emplace_back
#define GREATER(T) T, VT<T> greater<T>
template<typename T> inline bool chmax(T &a, T b){if (a < b){a = b;return true;}return false;}
template<typename T> inline bool chmin(T &a, T b){if (a > b){a = b;return true;}return false;}

const int INF = 1e9;
const int MOD = INF + 7;
const LL LLINF = 1e18;

int main(void) {
    int N, M, X;
    cin >> N >> M >> X;
    VI C(N);
    VVI A(N, VI(M));
    REP(i, N) {
        cin >> C[i];
        REP(j, M) {
            cin >> A[i][j];
        }
    }

    int ans = INF;
    REP(i, (1 << N)) {
        int pre = 0;
        VI score(M);
        REP(j, N) if (i & (1 << j)) {
            pre += C[j];
            REP(k, M) score[k] += A[j][k];
        }

        bool ok = true;
        REP(j, M) {
            if (score[j] < X) {
                ok = false;
            }
        }
        if (ok) {
            chmin(ans, pre);
        }
    }

    if (ans == INF) ans = -1;
    cout << ans << endl;
}


Measured memory_bytes: 3628
#include <bits/stdc++.h>
#include<math.h>
using namespace std;
typedef long long ll;
#define REP(i,n) for(int i=0; i<(n); i++)
#define REP2(i,x,n) for(int i=x; i<(n); i++)
#define REP3(i,x,n) for(int i=x; i>(n); i--)
#define ALL(n) begin(n),end(n)
#define MAX 500000
#define SENTINEL 2000000000
struct cww{cww(){ios::sync_with_stdio(false);cin.tie(0);}}star;
const long long INF = numeric_limits<long long>::max();


struct Point{double x,y;};

void koch(ll n,Point a,Point b){
    if(n == 0)return;
    Point s,t,u;
    double theta = M_PI*60.0/180.0;
    s.x = (2.0 * a.x + 1.0 * b.x)/3.0;
    s.y = (2.0 * a.y + 1.0 * b.y)/3.0;
    t.x = (1.0 * a.x + 2.0 * b.x)/3.0;
    t.y = (1.0 * a.y + 2.0 * b.y)/3.0;
    u.x = (t.x - s.x) * cos(theta) - (t.y-s.y) * sin(theta) + s.x;
    u.y = (t.x - s.x) * sin(theta) + (t.y-s.y) * cos(theta) + s.y;

    koch(n-1,a,s);
    printf("%.8f %.8f\n",s.x,s.y);
    koch(n-1,s,u);
    printf("%.8f %.8f\n",u.x,u.y);
    koch(n-1,u,t);
    printf("%.8f %.8f\n",t.x,t.y);
    koch(n-1,t,b);
}

int main(){
    Point a,b;
    ll n;
    scanf("%lld",&n);
    a.x = 0;    a.y = 0;
    b.x = 100;  b.y = 0;
    printf("%.8f %.8f\n",a.x,a.y);
    koch(n,a,b);
    printf("%.8f %.8f\n",b.x,b.y);
    return 0;
}


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

using E = System.Linq.Enumerable;

public class Program
{
    public static void Main()
    {
        var n = int.Parse(Console.ReadLine());
        var seqA = Console.ReadLine().Split().Select(x => int.Parse(x)).ToArray();
        var seqB = Console.ReadLine().Split().Select(x => int.Parse(x)).ToArray();

        var k = 0L;
        for (int i = 0; i < seqB.Length; ++i)
        {
            if (seqA[i] > seqB[i])
            {
                k += seqB[i];
                seqB[i] = 0;
            }
            else
            {
                k += seqA[i];
                seqB[i] -= seqA[i];
                if (i + 1 < seqB.Length)
                {
                    k += Math.Min(seqA[i + 1], seqB[i]);
                    seqA[i + 1] = Math.Max(seqA[i + 1] - seqB[i], 0);
                }
            }
        }
        k += Math.Min(seqA.Last(), seqB.Last());

        Console.WriteLine(k);
    }
}


Measured memory_bytes: 36292
import collections
s = list(raw_input())
r = 0
mod = 10 ** 9 + 7
h= collections.Counter()
h[0] += 1
for v in s:

	v = int(v) if v != '?' else v
	hh = collections.Counter()
	for u in range(13):
		if v != '?':
			hh[(u * 10 + v) % 13] += h[u]

		else:
			for vv in range(10):
				hh[(u * 10 + vv) % 13] += h[u]
	for k in hh:
		hh[k] %= mod
	h = hh
print h[5]

Measured memory_bytes: 37592
using System;
// using System.Collections.Generic;
// using System.Globalization;
// using System.IO;
// using System.Linq;
// using System.Text;
// using System.Text.RegularExpressions

class Program
{
    static void Main()
    {
        string[] arr = Console.ReadLine().Split();
        int A, B;
        A = int.Parse(arr[0]);
        B = int.Parse(arr[1]);
        Console.WriteLine((A + B) % 2 == 0 ? ((A + B) / 2).ToString() : "IMPOSSIBLE");
        return;
    }
}

Measured memory_bytes: 27364
#include <stdio.h>

int main(void){
	int a, b;

	while(1){
		scanf("%d %d", &a, &b);
		if(a == 0 && b == 0){
			break;
		}
		if(a > b){
			int temp;
			temp = a;
			a = b;
			b = temp;
		}

		printf("%d %d\n", a, b);
	}

	return 0;
}

Measured memory_bytes: 600
object Main extends App {
  val Array(a, b, c, d) = scala.io.StdIn.readLine.split(" ").map(_.toLong)


  def oldans() = {
    //    println((a to b).toList)
    //    println("LCM:" + lcm(c, d))
    // cの倍数でない
    println(b / c)
    // dの倍数でない
    println(b / d)
    // cとdの倍数を二回引いているので1回たす
    println(b / lcm(c, d))

    // a以下の↑の数を引く


    // ---
    //cの倍数の数
    println(a / c)
    // dの倍数の数
    println(a / d)
    // cとdの倍数の数
    println(a / lcm(c, d))


    // cの倍数の数
    // a - (a / c) - (a / d) + (a / (c * d))
    (b - (b / c) - (b / d) + (b / lcm(c, d))) - (a - (a / c) - (a / d) + (a / lcm(c, d)))
    //-6 + -5 + 1
    //40 - (10個 - 1 1 1

    // List(10, 11, 13, 14, 15, 17, 19, 20, 21, 22, 23, 25, 26, 27, 28, 29, 31, 33, 34, 35, 37, 38, 39)
    //List(10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40)

    // bまでの削除数
    //-(6 + 5 -1) => -10
    // aまでの削除数
    // (1 + 1 + 0) => 2
    //-(10 -2)
    // => -8 これが削除される倍数の数
    //=> b - 削除数 - (a - 1)

    val aa = a - 1

    println((b / c) + (b / d) - (b / lcm(c, d)))
    println((aa / c) + (aa / d) - (aa / lcm(c, d)))
    println((aa - 1))

    b - ((b / c) + (b / d) - (b / lcm(c, d)) - ((aa / c) + (aa / d) - (aa / lcm(c, d)))) - aa
  }

  val ans = {
    val aa = a - 1

    //println((b / c) + (b / d) - (b / lcm(c, d)))
    //println((aa / c) + (aa / d) - (aa / lcm(c, d)))
    //println((aa - 1))

    b - ((b / c) + (b / d) - (b / lcm(c, d)) - ((aa / c) + (aa / d) - (aa / lcm(c, d)))) - aa
  }

  println(ans)

  def gcd(a: Long, b: Long): Long = {
    if (b == 0) a else gcd(b, a % b)
  }

  def lcm(m: Long, n: Long): Long = {
    m * n / gcd(m, n)
  }

}


Measured memory_bytes: 27300
#include <iostream>
#include <vector>
using namespace std;
const long long INF = (1ull<<62) - 1;

int main() {
	long long n, k;
	cin >> n >> k;
	vector<long long> p(n), c(n);
	for (int i = 0; i < n; i++) {
		cin >> p[i];
		p[i]--;
	}
	for (int i = 0; i < n; i++) {
		cin >> c[i];
	}
	long long ans = -INF;
	for (int i = 0; i < n; i++) {
		vector<bool> f(n, false);
		int cycle;
		for (int j = 0, x = i; ; j++) {
			if (f[x] == true) {
				cycle = j;
				break;
			}
			f[x] = true;
			x = p[x];
		}
		if (k < cycle) {
			long long s = 0;
			for (int j = 0, x = i; j < k; j++) {
				s += c[x];
				ans = max(ans, s);
				x = p[x];
			}
		} else {
			long long s = 0;
			for (int j = 0, x = i; j < cycle; j++) {
				s += c[x];
				ans = max(ans, s);
				x = p[x];
			}
			s = s * (k / cycle - 1);
			int r = k % cycle + cycle;
			for (int j = 0, x = i; j < r; j++) {
				s += c[x];
				ans = max(ans, s);
				x = p[x];
			}
		}
	}
	cout << ans << endl;
	return 0;
}

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

using namespace std;

int main()
{
    int a, b, c, k;
    cin >> a >> b >> c >> k;
    int cc = 0;
    if(b <= a) {
        cc = floor(log2(a/b)) + 1;
        b *= pow(2, cc);
    }
    if(c <= b)
        cc += floor(log2(b/c)) + 1;
    if(cc <= k) cout << "Yes";
    else cout << "No";
    return 0;
}


Measured memory_bytes: 3816
// #define _GLIBCXX_DEBUG // for STL debug (optional)
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <string>
#include <cstring>
#include <deque>
#include <list>
#include <queue>
#include <stack>
#include <vector>
#include <utility>
#include <algorithm>
#include <map>
#include <set>
#include <complex>
#include <cmath>
#include <limits>
#include <cfloat>
#include <climits>
#include <ctime>
#include <cassert>
#include <numeric>
#include <fstream>
#include <functional>
#include <bitset>
using namespace std;
using ll = long long int;
using int64 = long long int;
 
template<typename T> void chmax(T &a, T b) {a = max(a, b);}
template<typename T> void chmin(T &a, T b) {a = min(a, b);}
template<typename T> void chadd(T &a, T b) {a = a + b;}
 
int dx[] = {0, 0, 1, -1};
int dy[] = {1, -1, 0, 0};
const int INF = 1LL << 29;
const ll LONGINF = 1LL << 60;
const ll MOD = 1000000007LL;

bool is_prime[1000010];
int cnt[1000010];
int main() {
    int N; scanf("%d", &N);
    vector<int> A(N);
    for(int i=0; i<N; i++) {
        scanf("%d", &A[i]);
        cnt[ A[i] ]++;
    }

    if(cnt[1] >= 2) {
        puts("0");
        return 0;
    }
    if(cnt[1] == 1) {
        puts("1");
        return 0;
    }

    fill(is_prime, is_prime + 1000005, true);
    for(int i=2; i<=1000000; i++) {
        if(!is_prime[i]) continue;
        for(int k=i<<1; k<=1000000; k+=i) {
            is_prime[k] = false;
            cnt[k] += cnt[k/i];
        }
    }

    int ans = 0;
    for(int i=0; i<N; i++) {
        if(cnt[ A[i] ] == 1) ans++;
    }
    printf("%d\n", ans);
    return 0;
}


Measured memory_bytes: 9060
module ddd;import std.stdio, std.array, std.string, std.conv, std.algorithm;
import std.typecons, std.range, std.random, std.math, std.container;
import std.numeric, std.bigint, core.bitop, core.stdc.string;

immutable long MOD = 10^^9 + 7;

void main() {
    auto N = readln.chomp.to!int;
    auto G = new int[][](N);
    foreach (i; 0..N-1) {
        auto s = readln.split.map!(to!int);
        G[s[0]-1] ~= s[1]-1;
        G[s[1]-1] ~= s[0]-1;
    }
    auto A = readln.split.map!(to!long).array;
    A.sort!"a > b";

    auto ans = new long[](N);
    int cnt = 0;

    void dfs(int n, int p) {
        ans[n] = A[cnt++];
        foreach (m; G[n]) {
            if (m != p) {
                dfs(m, n);
            }
        }
    }

    dfs(0, -1);
    A[1..$].sum.writeln;
    ans.map!(to!string).join(" ").writeln;
}

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

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

int main() {
  string s;
  cin >> s;
  ll one = 0, zero = 0;
  rep(i, s.size()) {
    if (s[i] == '0') zero++;
    else one++;
  }
  cout << min(one, zero)*2 << endl;
  return 0;
}

Measured memory_bytes: 512
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <string.h>
#include <algorithm>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <string>
#include <vector>
#include <bits/stdc++.h>
using namespace std;
 
const double TL = 1.5 * CLOCKS_PER_SEC;
mt19937 rng((unsigned int) chrono::steady_clock::now().time_since_epoch().count());
#define clr(x, y) memset(x, y, sizeof(x))
#define forn(i, n) for (int i = 0; i < n; i++)
#define LL long long
const double pi = acos(-1.0);

const LL mod = 998244353;

int n;
int a[1000005], p[1000005];

int main() {
#ifdef LOCAL
  auto start_clock = clock();
  freopen("in", "r", stdin);
#endif
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    scanf("%d", &a[i]);
  }
  sort(a, a + n);

  int ans = 0;
  for (int i = 0; i < n; i++) {
    if (i < n - 1 && a[i] == a[i + 1]) {
      p[a[i]] = 1;
      continue;
    }
    bool flag = true;
    for (int j = 1; j * j <= a[i]; j++) {
      if (a[i] % j == 0 && (p[j] || p[a[i] / j])) {
        flag = false;
        break;
      }
    }
    if (flag) {
      ans += 1;
    }
    p[a[i]] = 1;
  }
  printf("%d\n", ans);


#ifdef LOCAL
 auto end_clock = clock();
 cout << "Time:" << (end_clock - start_clock) / CLOCKS_PER_SEC << endl;
#endif
  return 0;
}

Measured memory_bytes: 8456
// Template
#include <iostream>
#include <string>
#include <vector>
#include <utility>
#include <functional>
#include <numeric>
#include <list>
#include <set>
#include <map>
#include <algorithm>
#include <cmath>

using namespace std;
const int MOD = 1000000007;

#define v_exists(elem, v) find(v.begin(),v.end(),elem)!=v.end()
#define s_exists(elem, s) s.find(elem)!=s.end()
#define mod_mul(x, y) x*y%MOD
#define mod_add(x, y) (x+y)%MOD
#define mod_sub(x, y) (x-y)%MOD
#define REP(i, n) for(int i = 0;i < n;i++)
#define INF 1 << 10


long gcd(long a, long b) {
    return b == 0 ? a : gcd(b, a % b);
}

long lcm( long m, long n ){
    if ( ( 0 == m ) || ( 0 == n ) )
        return 0;

    return ((m / gcd(m, n)) * n);
}



int main(){
    int n; cin >> n;
    std::vector<int> v(n+1);
    std::vector<int> t(n+1);
    for(int i=1; i<=n; i++){
        cin >> t[i];
        t[i] += t[i-1];
    }

    for(int i=1; i<=n; i++){
        cin >> v[i];
    }
    v.push_back(0);

    std::vector<double> maxv(2*t[n]+1);

    int ti = 1;
    for(int i=1; i<=n ; i++){
        while(ti < 2*t[i]){
            maxv[ti] = v[i];
            ti++;
        }
        maxv[ti] = min(v[i], v[i+1]);
        ti++;
    }

    for(int i = 1; i < 2*t[n]; i++) {
        maxv[i] = min(maxv[i], maxv[i-1]+0.5);
    }

    for(int i=2*t[n]-1; i>=0; i--){
        maxv[i] = min(maxv[i], maxv[i+1]+0.5);
    }

    double ans = 0;
    for (int i = 0; i < 2*t[n]; i++) {
        ans += 0.25*(maxv[i]+maxv[i+1]);
    }

    cout << fixed << ans << endl;



    return 0;

}


Measured memory_bytes: 512
#include <iostream>
#include <cstdlib>
#include <algorithm>
using namespace std;
int main(void){
    int a[5],k=10;
    int lastNum=0;
    for(int i=0;i<5;i++){
        cin >> a[i];
        
        if(0 < a[i]%10 && a[i]%10 < k){
            lastNum = i;
            k = a[i] % 10;
        }
    }
    
    int res=0;
    for(int i=0;i<5;i++){
        while(i != lastNum){
            if(a[i]%10 == 0){
                break;
            }
            a[i]++;
        }
        res += a[i];
    }
    
    cout << res << endl;
}


Measured memory_bytes: 256
#pragma GCC optimize("Ofast")
#include "bits/stdc++.h"
using namespace std;
using ll = long long;
using ull = unsigned long long;
#define PI 3.141592
#define all(a) (a).begin(), (a).end()


int main(){
    ull X;
    cin >> X;
    ull yen = 100;
    ll count = 0;
    while(yen < X){
        yen+=yen/100;
        count++;
    }
    cout << count << endl;
}


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

int main() {
  string s;
  cin>>s;
  int n=s.size();
  int a=0,b=0,c=0;
  rep(i,n){
    if(s[i]=='a'){
      a++;
    }
    if(s[i]=='b'){
      b++;
    }
    if(s[i]=='c'){
      c++;
    }
  }
  ////////////
  int m=min(min(a,b),c);
  a-=m;
  b-=m;
  c-=m;
  if(a>1 ||b>1||c>1){
    cout<<"NO"<<endl;
  }
  else{
    cout<<"YES"<<endl;
  }
  
  
  
  
}






Measured memory_bytes: 764
from collections import deque


n = int(input())
a = list(map(int, input().split()))
a.sort(reverse=True)
d = deque()
d.append(a[0])
ans = 0

for i in range(1, n):
    x = d.popleft()
    ans += x
    d.append(a[i])
    d.append(a[i])

print(ans)


Measured memory_bytes: 32480
import math

n,k = input().split()
p = input().split()

n = int(n)
k = int(k)
#p = [int(s) for s in p]

#print(p)

ex =0
ext = []
ext2 = []
for f in range(n):
    pi = int(p[f])
    xs =(pi+1)/2
    ext.append(xs)

ext2.append(ext[0])
for i in range(1,n):
    ext2.append(ext2[i-1]+ext[i])

ex = ext2[k-1]
for j in range(1,n-k+1):
    ext3 =ext2[j+k-1]-ext2[j-1]
    if ext3 > ex: ex = ext3

print('{:.12f}'.format(ex))

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

#define CPP_STR(x) CPP_STR_I(x)
#define CPP_CAT(x,y) CPP_CAT_I(x,y)
#define CPP_STR_I(args...) #args
#define CPP_CAT_I(x,y) x ## y

using i8  = int8_t;
using u8  = uint8_t;
using i16 = int16_t;
using u16 = uint16_t;
using i32 = int32_t;
using u32 = uint32_t;
using i64 = int64_t;
using u64 = uint64_t;

using f32 = float;
using f64 = double;

#define FOR(i, start, end) for(i64 i = (start), CPP_CAT(i,xxxx_end)=(end); i < CPP_CAT(i,xxxx_end); ++i)
#define REP(i, n) FOR(i, 0, n)
#define REPS(i, n) for(i64 i = 1; i <= n; ++i)
#define RREP(i, n) for(i64 i = n - 1; i >= 0 ; --i)
#define RREPS(i, n) for(i64 i = n; i >= 1; --i)

#define ALL(f,c,...) (([&](decltype((c)) cccc) { return (f)(std::begin(cccc), std::end(cccc), ## __VA_ARGS__); })(c))

#define UNIQUE(v) v.erase( unique(v.begin(), v.end()), v.end() );

#define pb push_back
#define mp make_pair

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; }

template<typename C>
i64 SIZE(const C& c) { return static_cast<i64>(c.size()); }

template<typename T, size_t N>
i64 SIZE(const T (&)[N]) { return static_cast<i64>(N); }


struct ProconInit {
    static constexpr int IOS_PREC = 15;
    static constexpr bool AUTOFLUSH = false;

    ProconInit() {
        cin.tie(nullptr);
        ios::sync_with_stdio(false);
        cout << fixed << setprecision(IOS_PREC);
        if(AUTOFLUSH)
            cout << unitbuf;
    }
} PROCON_INIT;


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

    deque<char> deq;
    REP(i, S.length()) {
        if (S[i] == 'B') {
            if (deq.size() > 0) deq.pop_back();
        } else {
            deq.push_back(S[i]);
        }
    }

    for (char c : deq) cout << c;
    cout << endl;

    return 0;
}


Measured memory_bytes: 3616
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		int a = scanner.nextInt();
		int[][] array = new int[4][13];
		for (int i = 0; i < a; i++) {
			String b = scanner.next();
			int c = scanner.nextInt();
			if (b.equals("S"))
				array[0][c - 1] = 1;
			else if (b.equals("H"))
				array[1][c - 1] = 1;
			else if (b.equals("C"))
				array[2][c - 1] = 1;
			else
				array[3][c - 1] = 1;
		}
		for (int i = 0; i < 4; i++) {
			for (int j = 0; j < 13; j++) {
				if (array[i][j] == 0)
					if (i == 0)
						System.out.println("S " + (j + 1));
					else if (i == 1)
						System.out.println("H " + (j + 1));
					else if (i == 2)
						System.out.println("C " + (j + 1));
					else
						System.out.println("D " + (j + 1));
			}
		}
	}
}


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

int N,M;
bool visited[8];
vector<int> G[8];

int dfs(int s){
  bool all = true;
  for(int i=0;i<N;i++)
    if(!visited[i]) all = false;
  if(all) return 1;
  int ret = 0;
  for(int i=0;i<G[s].size();i++){
    int nx = G[s][i];
    if(visited[nx]) continue;
    visited[nx] = true;
    ret += dfs(nx);
    visited[nx] = false;
  }
  return ret;
}

int main(){
  N=4;
  M=3;
  for(int i=0;i<M;i++){
    int a,b;
    cin>>a>>b;
    a--,b--;
    G[a].push_back(b);
    G[b].push_back(a);
  }
  for(int i=0;i<4;i++){
    visited[i] = true;
    if(dfs(i)){
      cout<<"YES"<<endl;
      return 0;
    }
    for(int j=0;j<4;j++)
      visited[i] = false;
  }
  cout<<"NO"<<endl;
  return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
#define FOR(i,a,b)for(int i=(a),_b=(b);i<=_b;i++)
#define FORN(i,b,a)for(int i=(b);_a=(a);i>=_a;i--)
#define REP(i,n)for(int i=0,_n=n;i<n;i++)
#define ll long long
#define pii pair<int,int>
#define re return
#define vi vector<int>
#define pb push_back
#define si set<int>
#define in insert
#define fl float
#define db double
#define ld long double
#define X first
#define Y second
#define st string
#define ull unsigned long long
#define mod 1000000007
using namespace std;
inline void read(int &x)
{
	short negative=1;
    x=0;
    char c=getchar();
    while(c<'0' || c>'9')
    {
		if(c=='-')
			negative=-1;
		c=getchar();
	}
    while(c>='0' && c<='9')
        x=(x<<3)+(x<<1)+(c^48),c=getchar();
    x*=negative;
}
ll quickpower(ll n,ll k){
	ll ans=1;
	while(k){
		if(k%2){
			ans*=n;
			ans%=mod;
		}
		n*=n;
		n%=mod;
		k/=2;
	}
	return ans;
}
int main()
{
	ll n,a,b;
	cin>>n>>a>>b;
	ll res=1;
	ll ans;
	ans=quickpower(2,n)-1;
	ans%=mod;
	if(a>=n/2)a=n-a;
	if(b>=n/2)b=n-b;
	for(int i=n;i>=n-a+1;i--)
	{
		res*=i;
		res%=mod;
	}
	for(int i=1;i<=a;i++)
	{
		res*=quickpower(i,mod-2);
		res%=mod;
	}	
	ans=(ans-res+mod)%mod;
	res=1;
	for(int i=n;i>=n-b+1;i--)
	{
		res*=i;
		res%=mod;
	}
	for(int i=1;i<=b;i++)
	{
		res*=quickpower(i,mod-2);
		res%=mod;
		}	
	ans=(ans-res+mod)%mod;
	while(ans<0)
		ans+=mod;
	ans%=mod;
	cout<<ans<<endl;
	return 0;
}



Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i,n) for(int i = 0; i < (int)(n); i++)
#define fi first
#define se second
#define pb push_back
#define eb emplace_back
#define sz(x) (int)(x).size()
using namespace std;
using ll = long long;
using P = pair<int, int>;
using vi = vector<int>;
using vc = vector<char>;
using vb = vector<bool>;
using vs = vector<string>;
using vll = vector<long long>;
using vp = vector<pair<int, int>>;
using vvi = vector<vector<int>>;
using vvc = vector<vector<char>>;
using vvll = vector<vector<long long>>;
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 (b<a) {a=b; return 1;} return 0;}

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    
    int n, m;
    cin >> n >> m;
    vi a(m), b(m);
    int l1 = 1, r1 = m+1, l2 = m+2, r2 = 2*m + 1;
    rep(i, m) {
        if (l1 < r1) {
            a[i] = l1;
            b[i] = r1;
            l1++;
            r1--;
        } else {
            a[i] = l2;
            b[i] = r2;
            l2++;
            r2--;
        }
    }
    rep(i, m) cout << a[i] << " " << b[i] << endl;
}

Measured memory_bytes: 3956
#include <cstdio>

#define MAX_N 100001

/* -----------------------------------------------------------------------------
	大域データ
----------------------------------------------------------------------------- */
int N;			// マスの個数(1≦N≦10^5)
int h[MAX_N];	// マスの高さ(1≦h[i]≦10^5)

int main () {

	int ans = 1;

	// 整数の数の読込み
	scanf("%d", &N);

	// 
	int max = -1;
	for(int i = 0; i < N; i++) {
		scanf("%d", h + i);
		if(h[i] > max) { h[i]--; max = h[i]; }
	}

	for(int i = 1; i < N; i++) {
		if(h[i-1] > h[i]) ans = 0;
	}


	if(ans == 1) printf("Yes\n");
	else printf("No\n");

	return 0;
}

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

#define rep(i,x,y) for(int i=(x);i<(y);++i)
#define debug(x) #x << "=" << (x)

#ifdef DEBUG
#define _GLIBCXX_DEBUG
#define dump(x) std::cerr << debug(x) << " (L:" << __LINE__ << ")" << std::endl
#else
#define dump(x)
#endif

typedef long long int ll;
typedef pair<int,int> pii;
//template<typename T> using vec=std::vector<T>;

const int inf=1<<30;
const long long int infll=1LL<<58;
const double eps=1e-8;
const int dx[]={1,0,-1,0},dy[]={0,1,0,-1};

template <typename T> ostream &operator<<(ostream &os, const vector<T> &vec){
    os << "[";
    for (const auto &v : vec) {
    	os << v << ",";
    }
    os << "]";
    return os;
}

void solve(){
    int n;
    long double r,theta;
    cin >> n >> r >> theta;
    theta=theta/360*2*3.141592653589793;
    const double cos_theta=cosl(theta);
    vector<long double> x(n),y(n);
    rep(i,0,n) cin >> x[i] >> y[i];

    int ans=0;
    long double dp[20][20];
    fill_n((long double*)dp,20*20,inf);
    rep(i,1,n) dp[0][i]=sqrtl((x[i]-x[0])*(x[i]-x[0])+(y[i]-y[0])*(y[i]-y[0]));
    while(true){
        if([&]{
            long double mini=inf;
            rep(i,0,n) rep(j,0,n) mini=min(mini,dp[i][j]);
            return mini;
        }()<r) ++ans;
        else break;

        long double prev[20][20];
        memcpy(prev,dp,sizeof(long double)*20*20);
        fill_n((long double*)dp,20*20,inf);
        rep(i,0,n) rep(j,0,n) rep(k,0,n){
            if(i==j or j==k) continue;
            const long double l1=sqrtl((x[j]-x[i])*(x[j]-x[i])+(y[j]-y[i])*(y[j]-y[i]));
            const long double l2=sqrtl((x[k]-x[j])*(x[k]-x[j])+(y[k]-y[j])*(y[k]-y[j]));
            if(((x[j]-x[i])*(x[k]-x[j])+(y[j]-y[i])*(y[k]-y[j]))/l1/l2<cos_theta) continue;
            dp[j][k]=min(dp[j][k],prev[i][j]+l2);
        }
    }
    cout << ans << endl;
}

int main(){
    std::ios::sync_with_stdio(false);
    std::cin.tie(0);
    cout << fixed << setprecision(8);
    solve();
    return 0;
}

Measured memory_bytes: 3612
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define MX 100005

int A[MX];
ll dp[MX];

ll recur(int pos){
    if (pos == 1){
        return dp[pos] = 0;
    }
    if (pos == 2){
        return dp[pos] = abs(A[2] - A[1]);
    }
    if (dp[pos] != -1) return dp[pos];
    dp[pos] = min(recur(pos - 1) + abs(A[pos] - A[pos-1]),
                  recur(pos - 2) + abs(A[pos] - A[pos-2]));
    return dp[pos];
}
int main()
{
    int n; scanf("%d", &n);
    for (int i = 1; i <= n; i++){
        scanf("%d", &A[i]);
        dp[i] = -1;
    }

    ll ans = recur(n);
    printf("%lld\n", ans);
    return 0;
}


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

int main(){
    int H,N;

    cin >> H >> N;

    int A[N];

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

    int sum = 0;

    for(int i=0; i<N; i++){
        sum += A[i];
    }

    if(sum >= H){
        cout << "Yes" << endl;
    }else{
        cout << "No" << endl;
    }

    return 0;
}

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

using boost::multiprecision::cpp_int;
using namespace std;

#if __has_include("print.hpp")
  #include "print.hpp"
#endif

#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define ALL(x) (x).begin(), (x).end()
#define RALL(x) (x).rbegin(), (x).rend()
#define MOD 1000000007

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; }

typedef long long ll;
typedef pair<ll, ll> p;


int main(){
  ios::sync_with_stdio(false);
  cin.tie(0);
  double m, n;
  cin >> n >> m;
  vector<double> v(n);
  rep(i, n) cin >> v[i];
  int count = 0;
  double sum = 0;
  rep(i, n){
    sum += v[i];
  }

  rep(i, n){
    if(v[i] >= sum / (4.0*m)) count++;
  }
  // cout << count << endl;

  if(count >= m) cout << "Yes" << endl;
  else cout << "No" << endl;

}


Measured memory_bytes: 256
/*Saurav Paul*/
#include<bits/stdc++.h>
#define endl '\n'
#define ll long long int
#define loop(i,a,b)           for(ll i=a;i<=b;++i)
#define boost		          ios_base::sync_with_stdio(0);
#define eb                    emplace_back
#define mp                    make_pair
#define clr(x)                x.clear()
#define MOD                   1e9+7
#define itoc(c)               ((char)(((int)'0')+c))
#define ctoi(c)               ((int)(((int)c)-'0'))
#define all(p)                p.begin(),p.end()
#define iscn(num)             scanf("%d",&num);
#define scn(num)              scanf("%lld",&num);
#define scn2(num,num2)        scanf("%lld%lld",&num,&num2);
using namespace std;

const int nax = 2000+1;
//~ char s[nax][nax];
string s[nax];
int dp[nax][nax];
int h , w;
int main()
{
	boost ;
	//~ scanf("%d%d",&h,&w);
	cin >> h >> w;
	for(int i =0 ; i < h ; i++)
		//~ scanf("%s",s[i]);
		cin >> s[i];
	
	int maxi = 0;
	for (int i = 0 ; i < h ; i++){
		for(int j= 0 ; j < w ; j++){					
			if(s[i][j]=='#')
				continue ;
			int cnt = 0,st= j;
			while(j < w){
				if(s[i][j]=='#')
					break;
				cnt++;
				j++;
			}
			for(st=st ; st < j ; st ++)
				dp[i][st] +=cnt ;
		}
	}

	for (int i = 0 ; i < w ; i++){
		for(int j= 0 ; j < h ; j++){	

			if(s[j][i]=='#')
				continue ;
			int cnt = 0,st= j;
			while(j < h){
				if(s[j][i]=='#')
					break;
				cnt++;
				j++;
			}
			for(st=st ; st < j ; st ++)
				dp[st][i] +=cnt ;
		}
	}

	for(int i = 0 ; i < h ; i++)
		for(int j = 0 ; j < w ; j++)
			maxi = max(maxi, (int)dp[i][j]);

	printf("%d\n",maxi-1);
    return 0;
}


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

int main(){
    int N,K;
    cin >> N >> K;
    vector<int>x(N);
    for(int i = 0; i < N; i++) {
        cin >> x[i];
    }
    int ans = 10000000000000;
    for(int i = 0; i < N-K+1; i++) {
        int hidari = x[i];
        int migi = x[i+K-1];
        int hajime = min(abs(0-hidari),abs(0-migi));
        ans = min(ans,migi-hidari+hajime);
    }
    cout << ans << endl;
}


Measured memory_bytes: 640
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <math.h>
#include <map>
#include <queue>
#include <cassert>
#include <iomanip>
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define ALL(a) (a).begin(), (a).end()
#define rALL(a) (a).rbegin(), (a).rend()
using namespace std;
using ll = long long;
using P = pair<ll, ll>;
const int iINF = 1001001001;
const long long llINF = 1LL << 60;
int main()
{
    /*int n, x, t; cin >> n >> x >> t;
    int ans = ceil(double(n) / x) * t;
    cout << ans << endl;
    */

    string n; cin >> n;
    int s = n.size();
    int num = 0;
    rep(i, s) {
        num += n[i] - '0';
    }
    if (num % 9 == 0) cout << "Yes" << endl;
    else cout << "No" << endl;
    return 0;
}

Measured memory_bytes: 3748
// g++ -std=c++11 a.cpp
#include<iostream>
#include<vector>
#include<string>
#include<algorithm>
#include<map>
#include<set>
#include<unordered_map>
#include<utility>
#include<cmath>
#include<random>
#include<cstring>
#include<queue>
#include<stack>
#include<bitset>
#include<cstdio>
#include<sstream>
#include<iomanip>
#include<assert.h>
#include<typeinfo>
#define loop(i,a,b) for(long long i=a;i<b;i++)
#define rep(i,a) loop(i,0,a)
#define FOR(i,a) for(auto i:a)
#define pb push_back
#define all(in) in.begin(),in.end()
#define shosu(x) fixed<<setprecision(x)
#define show1d(v) {rep(_,v.size())cout<<" "<<v[_];cout<<endl;}
#define show2d(v) {rep(__,v.size())show1d(v[__]);}
using namespace std;
//kaewasuretyuui
typedef long long ll;
#define int ll
typedef int Def;
typedef pair<Def,Def> pii;
typedef vector<Def> vi;
typedef vector<vi> vvi;
typedef vector<pii> vp;
typedef vector<vp> vvp;
typedef vector<string> vs;
typedef vector<double> vd;
typedef vector<vd> vvd;
typedef pair<Def,pii> pip;
typedef vector<pip>vip;
#define mt make_tuple
typedef tuple<int,int,int> tp;
typedef vector<tp> vt;
template<typename A,typename B>bool cmin(A &a,const B &b){return a>b?(a=b,true):false;}
template<typename A,typename B>bool cmax(A &a,const B &b){return a<b?(a=b,true):false;}
const double PI=acos(-1);
const double EPS=1e-9;
Def inf = sizeof(Def) == sizeof(long long) ? 2e18 : 1e9+10;
#define yes cout<<"YES"<<"\n"
#define no cout<<"NO"<<"\n"

signed main(){
	ios::sync_with_stdio(false);
	cin.tie(0);
	
	int a,b,c;
	cin>>a>>b>>c;
	cout<<(c/a)*b<<endl;
}











Measured memory_bytes: 256
/*
				C++
				encoding:UTF-8
				Modified: <19/May/2019 05:58:43 PM>

				✪ H4WK3yE乡
				Mohd. Farhan Tahir
				Indian Institute Of Information Technology (IIIT), Gwalior
*/

#include <bits/stdc++.h>

using namespace std;

// clang-format off

#define		 ll                     long long
#define		 mod                    1000000007
#define		 ve                     vector
#define		 pb                     push_back
#define		 umap                   unordered_map
#define		 pq                     priority_queue
#define		 endl                   "\n";
#define		 ff                     first
#define		 ss                     second
#define		 pii                    pair<int, int>
#define		 len(v)                 int(v.size())
#define		 all(v)                 v.begin(), v.end()
#define		 reset(a, b)            memset(a, b, sizeof(a));
#define		 sum(v)                 accumulate(v.begin(), v.end(), (ll)0);
#define		 pr1(x)                 cout<<x<<"\n"
#define		 pr2(x, y)              cout<<x<<" "<<y<<"\n"
#define		 pr3(x, y, z)           cout<<x<<" "<<y<<" "<<z<<"\n"
#define		 prv(v, s, n)           fr(i, s, n) cout<<v[i]<<" "; cout<<"\n"
#define		 fr(i, s, n)            for (ll i = s ; i < n ; ++i)
#define		 dfr(i, s, n)           for (ll i = s ; i > n ; --i)

ll powermod(ll _a,ll _b,ll _m) {ll _r=1;while(_b){if(_b%2==1)_r=(_r*_a)%_m;_b/=2;_a=(_a*_a)%_m;}return _r;}

// clang-format on

const int N = 1e5 + 5;
ve< int > graph[N];
map< pii, int > mp;
int n;
int c[N];

void dfs (int node, int parent) {
	for (int to : graph[node]) {
		if (to == parent) continue;
		if (mp[{node, to}] % 2 == 0)
			c[to] = c[node];
		else
			c[to] = 1 - c[node];
		dfs (to, node);
	}
}

signed main () {
	ios_base::sync_with_stdio (false), cin.tie (0);
	cin >> n;
	fr (i, 0, n - 1) {
		int u, v, w;
		cin >> u >> v >> w;
		graph[u].pb (v);
		graph[v].pb (u);
		mp[{u, v}] = w;
		mp[{v, u}] = w;
	}
	dfs (1, 1);
	fr (i, 1, n + 1) pr1 (c[i]);
	return 0;
}


Measured memory_bytes: 23168
import java.util.Scanner;


public class Main {
	public static void main(String[] args) {
		// TODO ?????????????????????????????????????????????
		Scanner sc = new Scanner(System.in);
		
		while(true){
			int a = sc.nextInt();
			String line = sc.next();
			char op = line.charAt(0);
			int b = sc.nextInt();
			
			if(op == '?'){
				break;
			}
			
			switch (op) {
			case '+':
				System.out.println(a + b);
				
				break;
			case '-':
				System.out.println(a - b);
				
				break;
			case '*':
				System.out.println(a * b);
				
				break;
			case '/':
				System.out.println(a / b);
				
				break;
			}
		}
		sc.close();
	}
}

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

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


Measured memory_bytes: 256
#include <algorithm>
#include <deque>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <set>
#include <string>
#include <vector>

using namespace std;
using LLONG = long long;

int main()
{
    string S;
    cin >> S;
    map<char, int> counts;
    for (const char &ch : S)
    {
        counts[ch] += 1;
    }
    if (counts.size() != 2)
    {
        cout << "No" << endl;
    }
    else
    {
        for (const auto &kvp : counts)
        {
            if (kvp.second != 2)
            {
                cout << "No" << endl;
                return 0;
            }
        }
        cout << "Yes" << endl;
    }
}


Measured memory_bytes: 764
#include <stdio.h>
int main (){
	int angka;
	char kata[255];
	int temp =1;
	scanf ("%d", &angka);
	scanf("%s", kata);
	if(angka%2!=0){
		temp=-1;
	}
	for (int i=0;i<angka/2;i++){
		if(kata[i]!=(kata[(angka/2)+i])){
			temp=-1;
		}
		}
	if(temp==1){
		printf("Yes");
	}else if (temp==-1){
		printf ("No");
	}
}


Measured memory_bytes: 1728
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int n;
  long long d;
  cin >> n >> d;
  vector<long long> x(n),y(n);
  for(int i=0;i<n;i++){
    cin >> x.at(i) >> y.at(i);
  }
  int ans = 0;
  long long d2 = d*d;
//  cout << d2 << endl;
  for(int i=0;i<n;i++){
    long long dis2 = x.at(i)*x.at(i)+y.at(i)*y.at(i);
//    cout << dis2 << endl;
    if(d2 >= dis2)
      ans++;
  }
  cout << ans << endl;
}

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

#define FasterIO ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)

int main(){
    FasterIO;

    int n;

    while(cin>>n){
        int sum = 0, mx = INT_MIN;

        for(int i=0; i<n; i++){
            int val;
            cin>>val;
            sum+=val;
            mx = max(mx, val);
        }

        sum-=mx;

        if(sum>mx)
            cout<<"Yes\n";
        else
            cout<<"No\n";
    }

    return 0;
}


Measured memory_bytes: 256
#include<stdio.h>

int main()
{
  int n;
  
  scanf("%d",&n);
  
  long long l[n];
  int i;
  
  l[0]=2,l[1]=1;
  
  for(i=2;i<=n;i++)
  {
    l[i]=l[i-1]+l[i-2];
  }
  
  printf("%lld\n",l[n]);
  
  return 0;
}

Measured memory_bytes: 128
#include <iostream>
#include <string>
using namespace std;
int main(){

  string a ;
  cin >> a ;
  int counter = 0 ;
  if(a[0] == '1') counter++;
  if(a[1] == '1') counter = counter+1;
  if(a[2] == '1') counter = counter+1;
  
  cout << counter << endl;
  
  
  
}

Measured memory_bytes: 3536
a, b = list(map(int, input().split()))
s = input()
isOK = False
if s[:a].isdecimal():
    #print(s[:a],s[:a].isdecimal())
    if s[a] == '-':
        #print(s[a])
        if s[a+1:].isdecimal():
            #print(s[a+1:],s[a+1:].isdecimal())
            isOK = True
if isOK:
    print('Yes')
else:
    print('No')

Measured memory_bytes: 3060
#include <iostream>
#include<string>
#include<cmath>
#include<algorithm>
#include<cctype>
#include<queue>
#include<deque>
#include<regex>
#include<stack>
#include<stdio.h>
#include<vector>
#include<set>
#include<map>
#include<iomanip>

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

typedef int long long ll;
using namespace std;
typedef pair<int, int> P;
int dx[4] = {1, 0, -1, 0};
int dy[4] = {0, 1, 0, -1};
const ll MOD = 1e9 + 7;
static const int MAX = 100;
static const int INF = (1 << 23);

int main() {

    ll n;
    cin>>n;
    vector<ll> a(n);
    rep(i,n){cin>>a[i];}

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


    if(n%2){
        //sdsds
        ll ans = 0;
        for(int i=n/2+1;i<n;i++){
            ans+=a[i]*2;
        }
        //cout<<ans<<endl;
        ans-=(a[n/2]+a[n/2-1]);

        for(int i=0;i<n/2-1;i++){
            ans-=a[i]*2;
        }
       ll ans2=0;

        //dsdsd
        for(int i=0;i<n/2;i++){
            ans2-=a[i]*2;
        }
        for(int i=n/2;i<n/2+2;i++){
            ans2+=a[i];
        }
        for(int i=n/2+2;i<n;i++){
            ans2+=a[i]*2;
        }
    //    cout<<ans2<<ans<<endl;
        cout<<max(ans,ans2)<<endl;

    }else{
        //dsds
        ll ans=0;
        for(int i=0;i<n/2-1;i++){
            ans-=a[i]*2;
        }
        for(int i=n/2+1;i<n;i++){
            ans+=a[i]*2;
        }
        ans+=a[n/2]-a[n/2-1];
        cout<<ans<<endl;




    }

    return 0;
}


Measured memory_bytes: 1152
S = list(input())

s = ''
count = 0
while S:
    if s == S[-1]:
        if len(S) >= 2:
            S.pop()
            S.pop()
            s = ''
            count+=1
        else:
            break        
    else:
        s = S.pop()
        count+=1
        
print(count)

Measured memory_bytes: 4840
#include <cstdio>
#include<iostream>
#include<map>
#include<algorithm>
#include<vector>
#include <cmath>
#include <iomanip>
#include <regex>
#include <queue>
#include <set>
#include <cassert>
using namespace std;
using ll = long long;
using plong = pair<ll,ll>;
ll MOD=998244353;

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


int main(){
    ll N,X,Y;cin>>N>>X>>Y;X--;Y--;
    map<ll,ll>mp;
    for(ll i=0;i<N;i++){
        for(ll j=i+1;j<N;j++){
            ll dist = min(abs(j-i),abs(X-i)+1+abs(Y-j));
            dist = min(dist,abs(Y-i)+1+abs(X-j));
            mp[dist]++;
        }
    }
    for(ll i=1;i<=N-1;i++){
        cout<<mp[i]<<"\n";
    }


}

Measured memory_bytes: 384
#ifdef MY_LOCAL
#define MY_NAMESPACE(ns) namespace ns {
#define MY_NAMESPACE_    }
#define MY_DEBUG(s)      s
#else
#define MY_NAMESPACE(ns) 
#define MY_NAMESPACE_    
#define MY_DEBUG(s)      
#endif

#include <algorithm>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <random>
#include <set>
#include <string>
#include <tuple>
#include <unordered_map>
#include <utility>
#include <vector>

using namespace std;

typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;

#define EPS (1e-7)
#define IINF ((int)1e9)


MY_NAMESPACE(testbed)
int main()
{
	cin.tie(nullptr);
	ios::sync_with_stdio(false);

	int x, n;
	cin >> x >> n;
	vector<int> line(102);  // line[0] to line[101]
	for (int i = 0; i < n; i++)
	{
		int p;
		cin >> p;
		line[p] = 1;
	}

	int distance = 0;
	while (true)
	{
		if (line[x - distance] == 0)
		{
			cout << x - distance << "\n";
			break;
		}
		else if (line[x + distance] == 0)
		{
			cout << x + distance << "\n";
			break;
		}
		distance++;
	}
	return 0;
}
MY_NAMESPACE_

Measured memory_bytes: 3664
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define REP(i,n) for(ll i=0, i##_len=(n); i<i##_len; ++i)
#define REPR(i,n) for(ll i = n;i >= 0;--i)
#define FOR(i,m,n) for(ll i = m, i##_len=(n);i <i##_len; ++i)
#define all(x) (x).begin(),(x).end()
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; }
ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}
const int INF = 1e9;
const ll LLINF = 1e16;
 
ll modinv(ll a, ll m) {
    ll b = m, u = 1, v = 0;
    while (b) {
        ll t = a / b;
        a -= t * b; swap(a, b);
        u -= t * v; swap(u, v);
    }
    u %= m;
    if (u < 0) u += m;
    return u;
}

int main(void)
{
    ll n, m;
    cin >> n >> m;

    vector<ll> a(n);
    vector<ll> b(n);
    vector<ll> gusuc(n, 0);
    REP(i, n)
    {
        cin >> a[i];
        b[i] = a[i] / 2;

        ll pow2 = 2;
        while (b[i] % pow2 == 0){
            gusuc[i]++;
            pow2 *= 2;
        }
    }



    bool flag = true;
    REP(i,n){
        if(gusuc[i] != gusuc[0]){
            flag = false;
            break;
        }
    }

    if(flag){
        ll pow2 = pow(2, gusuc[0]);
        REP(i, n)
        {
            b[i] /= pow2;
        }
        ll lcm = b[0];

        FOR(i,1,b.size()){
            lcm = lcm * b[i] / gcd(lcm, b[i]);
        }

        ll cnt = 0;
        ll kisu = 1;
        lcm *= pow2;

        while (kisu  <= m / lcm)
        {
            cnt++;
            kisu += 2;
        }
        cout << cnt << endl;
    }
    else{
        cout << 0 << endl;
    }


    return 0;
}

Measured memory_bytes: 2560
#include "bits/stdc++.h"
#include <iostream>
#include <string.h>
#include <stdio.h>
#include <map>
#include <vector>
#include <math.h>
#include <algorithm>
#include <queue>
#include <set>
#include <tuple>
using namespace std;

#define FOR(i,init,a) for(int i=init; i<a; i++)
#define rep(i,a) FOR(i,0,a)
#define rrep(i,a) for(int i=a; i>=0; i--)
#define rep1(i,a) for(int i=1; i<=a; i++)
#define cout1(a) cout << a << endl;
#define cout2(a,b) cout << a << " " << b << endl;
#define cout3(a,b,c) cout << a << " " << b << " " << c << endl;
#define cout4(a,b,c,d) cout << a << " " << b << " " << c << " " << d << endl;
#define mem(a,n) memset( a, n, sizeof(a))
#define all(a) a.begin(),a.end()
#define chmin(a,b) a=min(a,b);
#define chmax(a,b) a=max(a,b);

typedef long long ll;
typedef long double ld;
typedef pair<int,int> pii;
typedef vector<int> V;
typedef vector<V> VV;
typedef vector<VV> VVV;
const int INF = 1e9;
const int MOD = 1e9+7;
const ll LLINF = 1e18;
static const double pi = 3.141592653589793;

ll k,a,b;

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    
    cin>>k>>a>>b;
    ll dif = b-a;
    
    if(dif<=2){
        cout1(k+1)
    }else{
        ll ans=1;
        
        ll n = min(k,a-1);
        ans += n;
        k -= n;
        
        
        ll x = k/2;
        ans += dif*x;
        if(k%2) ans++;
        cout1(ans)
    }
}

Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <algorithm>
#include <cmath>
#include <map>
#include <vector>
#include <stack>
#include <queue>
#include <tuple>
#include <cassert>
#include <functional>
#include <set>
#include <deque>
#include <list>
using namespace std;
typedef long long ll;
int dx[4] = {0,0,1,-1};
int dy[4] = {1,-1,0,0};
#define LNF __LONG_LONG_MAX__
const ll MOD = 1000000007;
const int MAX = 200000;

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

// テーブルを作る前処理
void COMinit() {
    fac[0] = fac[1] = 1;
    finv[0] = finv[1] = 1;
    inv[1] = 1;
    for (int i = 2; i < MAX; i++){
        fac[i] = fac[i - 1] * i % MOD;
        inv[i] = MOD - inv[MOD%i] * (MOD / i) % MOD;
        finv[i] = finv[i - 1] * inv[i] % MOD;
    }
}

// 二項係数計算
long long COM(int n, int k){
    if (n < k) return 0;
    if (n < 0 || k < 0) return 0;
    return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
}
// 法mでのaの逆元を計算
long long modinv(long long a, long long m) {
    long long b = m, u = 1, v = 0;
    while (b) {
        long long t = a / b;
        a -= t * b; swap(a, b);
        u -= t * v; swap(u, v);
    }
    u %= m;
    if (u < 0) u += m;
    return u;
}
// a^n mod を計算する
long long modpow(long long a, long long n, long long mod) {
    long long res = 1;
    while (n > 0) {
        if (n & 1) res = res * a % mod;
        a = a * a % mod;
        n >>= 1;
    }
    return res;
}
//最大公約数
long long gcd(long long x, long long y){
    if(y==0) return x;
    else return gcd(y,x%y);
}
//最小公倍数
long long lcm(long long x, long long y){
    return x / gcd(x, y) * y;
}
// nが大きく,kが10^7程度の時の二項係数
long long com[200005];
void combination(long long n,long long k){
    com[0] = 1;
    for(int i=1;i<=k;i++){
        com[i] = (com[i-1]*(n-i+1)%MOD)*modinv(i,MOD)%MOD;
    }
}

int main(){
    ll a,b,x; cin >> a >> b >> x;
    ll s=b-a;
    ll c=a/x;
    if(a%x==0){
        cout << s/x+1 << endl;
    }else{
        s = b-c*x;
        cout << s/x << endl;
    }
    return 0;
}


Measured memory_bytes: 3628
#include <bits/stdc++.h>
using namespace std;
#define all(c) c.begin(),c.end()
#define init(c) memset(c,0,sizeof c)
#define S second
#define F first
typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef vector<int> vi;
typedef vector<ll> vl;
const int N=20000005;
ll n,k,x,t,a,b,m,c,d;
string s;
vi v;
bool big(ll md){
	return ll(a*md/b)-a*ll(md/b)>=0;
}
int main(){

	cin >> a >> b >> c;
	ll res=min(b-1,c);

	cout << ll(a*res/b)-a*ll(res/b);
	return 0;
}

Measured memory_bytes: 3632
program main
  implicit none
  character(10) :: s1,s2,s3,s
  character(3) :: ans

  read(*,*) s1,s2,s3

  ans(1:1) = char(ichar(s1(1:1))-32)
  ans(2:2) = char(ichar(s2(1:1))-32)
  ans(3:3) = char(ichar(s3(1:1))-32)

  write(*,*) ans
end program main


Measured memory_bytes: 2852
import itertools
n = int(input())
l = list(map(int,input().split()))
count = 0
for item in itertools.combinations(l, 3):
    if len(set(item)) == 3:
        if item[0] + item[1] > item[2] and item[1] + item[2] > item[0] and item[2] + item[0] > item[1]:
            count += 1
print(count)

Measured memory_bytes: 9196