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

using namespace std;

int main() {

    long N;
    cin >> N;

    long X = ceil((float) N / 1.08);

    long S = floor((float) X * 1.08);

    if (S == N) {
        cout << X << endl;
    } else {
        cout << ":(" << endl;
    }
    
    return 0;
}

Measured memory_bytes: 256
mod = 10**9+7
def hmf(n, k, k1):
    x = n//k
    if not x:
        return 0
    return x + hmf(n, k*k1, k1)

primes = [i for i in range(10**3+1)]
primes[1] = 0 

for p in primes:
    if p > int(10**(3/2)): break
    if p == 0: continue
    for non_prime in range(2 * p, 10**3+1, p): 
        primes[non_prime] = 0
    prime = [prime for prime in primes if prime != 0]

N = int(input())
ans = 1
for p in prime:
    c = hmf(N, p, p)
    if not c:
        break
    ans = ans*(1+hmf(N, p, p))%mod
print(ans)

Measured memory_bytes: 3064
#include <iostream>

using namespace std;

int main()
{
    int d;
    cin>>d;
    if(d==25)   cout<<"Christmas";
    else if(d==24)  cout<<"Christmas Eve";
    else if(d==23)  cout<<"Christmas Eve Eve";
    else if(d==22)  cout<<"Christmas Eve Eve Eve";

    return 0;
}


Measured memory_bytes: 256
N = int(input())

monster_list = list(map(int,input().split()))

tmp = monster_list[0]

def gcd(x,y):
    if y == 0:
        return x
    else:
        return gcd(y,x % y)

for i in range(len(monster_list)):
    if i == 0:
        continue
    else:
        tmp = gcd(tmp,monster_list[i])
 

print(tmp)

Measured memory_bytes: 14252
// #pragma GCC optimize(3,"Ofast","inline")
// #pragma GCC optimize(2)
#include <cstdio>
#include <cmath>
#include <cstring>
#include <algorithm>
#include <queue>
#include <map>
#include <set>
#include <stack>
#include <vector>
#include <string>
#include <iostream>
#include <list>
#include <cstdlib>
#include <bitset>
#include <assert.h>
#include <time.h>
#include <iomanip>
// #define getchar() (p1 == p2 && (p2 = (p1 = buf) + fread(buf, 1, 1 << 21, stdin), p1 == p2) ? EOF : *p1++)
// char buf[(1 << 21) + 1], * p1 = buf, * p2 = buf;
// #define int long long
#define lowbit(x) (x & (-x))
#define lson root << 1, l, mid
#define rson root << 1 | 1, mid + 1, r
#define pb push_back
typedef unsigned long long ull;
typedef long long ll;
typedef std::pair<int, int> pii;
typedef std::pair<ll, ll> pll;
typedef std::vector<ll> VI;
#define rep(i, a, n) for (int i = a; i < n; ++i)
#define SZ(x) ((int)((x).size()))
#define bug puts("BUG")
const long long INF = 0x3f3f3f3f3f3f3f3fLL;
const int inf = 0x3f3f3f3f;
const int mod = 998244353;
const double eps = 1e-6;
template <class T>
inline void read(T &x)
{
    int sign = 1;char c = getchar();x = 0;
    while (c > '9' || c < '0'){if (c == '-')sign = -1;c = getchar();}
    while (c >= '0' && c <= '9'){x = x * 10 + c - '0';c = getchar();}
    x *= sign;
}
#ifdef LOCAL
    FILE* _INPUT=freopen("input.txt", "r", stdin);
    // FILE* _OUTPUT=freopen("output.txt", "w", stdout);
#endif
using namespace std;
const int maxn = 2e5 + 10;
struct EDGE
{
    int next, to;
} edge[maxn << 1];
int head[maxn], tot;
inline void addedge(int u,int v)
{
    edge[tot].next = head[u];
    edge[tot].to = v;
    head[u] = tot++;
}
int a[maxn], ans[maxn];
int lis[maxn], cnt;
void dfs(int u, int pre)
{
    int p = lower_bound(lis, lis + cnt, a[u]) - lis;
    if (p == cnt)
    {
        lis[cnt++] = a[u];
        ans[u] = max(ans[u], cnt);
        for (int i = head[u]; ~i; i = edge[i].next)
        {
            int v = edge[i].to;
            if (v == pre)
                continue;
            ans[v] = ans[u];
            dfs(v, u);
        }
        --cnt;
    }else
    {
        int cur = lis[p];
        lis[p] = a[u];
        ans[u] = max(ans[u], p + 1);
        for (int i = head[u]; ~i; i = edge[i].next)
        {
            int v = edge[i].to;
            if (v == pre)
                continue;
            ans[v] = ans[u];
            dfs(v, u);
        }
        lis[p] = cur;
    }
}

int main()
{
    int n;
    int u, v;
    read(n);
    memset(head, -1, sizeof head);
    for (int i = 1; i <= n; ++i)
    {
        read(a[i]);
    }
    for (int i = 1; i < n; ++i)
    {
        read(u), read(v);
        addedge(u, v);
        addedge(v, u);
    }
    dfs(1, -1);
    for (int i = 1; i <= n; ++i)
    {
        printf("%d\n", ans[i]);
    }
}

Measured memory_bytes: 23620
(defun read-list (x &optional ret)
  (if (< x 1)
    ret
    (read-list (1- x) (cons (read) (cons (read) ret)))))

(defun count-people (lst &optional (ans 0))
  (if (null lst)
    ans
    (count-people (cddr lst) (+ (1+ (- (cadr lst) (car lst))) ans))))

(let* ((n (read))
       (l (read-list n)))

  (format t "~A~%"
          (count-people l)))


Measured memory_bytes: 25348
n,m=map(int,input().split())
grid=[list(input()) for i in range(n)]
ans=[[0]*m for i in range(n)]
mod=10**9 +7
ans[0][0]=1
for i in range(1,n):
    if grid[i][0]=='.':
        ans[i][0]=ans[i-1][0]
for i in range(1,m):
    if grid[0][i]=='.':
        ans[0][i]=ans[0][i-1]


for i in range(1,n):
    for j in range(1,m):
        if grid[i][j]=='.':
            ans[i][j]=(ans[i-1][j]+ans[i][j-1])%mod


print(ans[n-1][m-1]%mod)


Measured memory_bytes: 87536
use std::collections::HashMap;
/// Rustで競技プログラミングの入力をスッキリ記述するマクロ
///
/// https://qiita.com/tanakh/items/0ba42c7ca36cd29d0ac8
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        let mut next = || { iter.next().unwrap() };
        input_inner!{next, $($r)*}
    };
    ($($r:tt)*) => {
        let stdin = std::io::stdin();
        let mut bytes = std::io::Read::bytes(std::io::BufReader::new(stdin.lock()));
        let mut next = move || -> String{
            bytes
                .by_ref()
                .map(|r|r.unwrap() as char)
                .skip_while(|c|c.is_whitespace())
                .take_while(|c|!c.is_whitespace())
                .collect()
        };
        input_inner!{next, $($r)*}
    };
}

macro_rules! input_inner {
    ($next:expr) => {};
    ($next:expr, ) => {};

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

macro_rules! read_value {
    ($next:expr, ( $($t:tt),* )) => {
        ( $(read_value!($next, $t)),* )
    };

    ($next:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($next, $t)).collect::<Vec<_>>()
    };

    ($next:expr, chars) => {
        read_value!($next, String).chars().collect::<Vec<char>>()
    };

    ($next:expr, usize1) => {
        read_value!($next, usize) - 1
    };

    ($next:expr, $t:ty) => {
        $next().parse::<$t>().expect("Parse error")
    };
}

#[inline]
#[allow(dead_code)]
fn gcd(mut m: u64, mut n: u64) -> u64 {
    if m < n {
        std::mem::swap(&mut m, &mut n);
    }

    loop {
        let k = m % n;
        if k == 0 {
            return n;
        }

        m = n;
        n = k;
    }
}

#[inline]
#[allow(dead_code)]
fn lcm(m: u64, n: u64) -> u64 {
    m / gcd(m, n) * n
}

macro_rules! eprint(
    ($($arg:tt)*) => { {
        use std::io::Write;
        let r = write!(&mut ::std::io::stderr(), $($arg)*);
        r.expect("failed printing to stderr");
    } }
);

macro_rules! eprintln(
    ($($arg:tt)*) => { {
        use std::io::Write;
        let r = writeln!(&mut ::std::io::stderr(), $($arg)*);
        r.expect("failed printing to stderr");
    } }
);

macro_rules! dbg {
    ($val:expr) => {
        // Use of `match` here is intentional because it affects the lifetimes
        // of temporaries - https://stackoverflow.com/a/48732525/1063961
        match $val {
            tmp => {
                eprintln!(
                    "[{}:{}] {} = {:#?}",
                    file!(),
                    line!(),
                    stringify!($val),
                    &tmp
                );
                tmp
            }
        }
    };
}

fn main() {
    input! {
        n: usize,
        a_v: [u64; n],
    }

    let mut counts = HashMap::new();
    for a in a_v {
        *counts.entry(a).or_insert(0u64) += 1;
    }

    let mut answer = 0u64;
    for (num, count) in counts {
        if num < count {
            answer += count - num;
        } else if num > count {
            answer += count;
        }
    }

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


Measured memory_bytes: 12540
#include<iostream>
#include<cstdio>
#include<algorithm>
#define N 500010
using namespace std;
int n,a[N],dp[N];
char s[N];
int main()
{
    scanf("%d%s",&n,s+1);
    for(int i=1;i<=n;i++)
	{
        if (s[i] == '0') a[i] = i;
        else a[i] = a[i-1];
    }
    for(int i=1;i<=n;i++)
	{
        dp[i] = dp[i-1];
        if(s[i] == '1')
		{
            if(s[i-1] == '0' && s[i-2] == '1')
			{
                dp[i] = max(dp[i],dp[a[i-2]]+(i-2)-a[i-2]);
                dp[i] = max(dp[i],dp[a[i-2]+1]+(i-2)-(a[i-2]+1));
            }
            else if(a[i]>1 && s[a[i]-1] == '1')
				dp[i] = max(dp[i],dp[a[i]-2]+i-a[i]);
        }
    }
    printf("%d",dp[n]);
    printf("\n");
    return 0;
}

Measured memory_bytes: 4608
import bisect
N = int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
c = list(map(int, input().split()))
a.sort()
c.sort()
ans = 0
def find_lt(a, x):
    'Find rightmost value less than x'
    i = bisect.bisect_left(a, x)
    if i:
        return i
    return 0
def find_gt(a, x):
    'Find leftmost value greater than x'
    i = bisect.bisect_right(a, x)
    if i != len(a):
        return len(a)-i
    return 0
for bs in b:
  ans += find_lt(a, bs)*find_gt(c,bs)
print(ans)
    
    

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

#define ll long long
#define ld long double
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define PI 3.14159265358979323846
#define sz(x) ((int)(x).size())

const int INF = 1e9;
const int MOD = 1e9 + 7;
const ll LINF = 1e18;
int main()
{
    ll h;
    cin >> h;
    ll count = 0;
    int ans = 0;
    ll sum = 0;
    count = pow(2,ans);
    while (count<=h)
    {
        sum += count;
        ans++;
        count = pow(2,ans);
    }
    cout << sum << endl;
    

}

Measured memory_bytes: 384
#include <iostream>
#include <algorithm>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <iomanip>

using namespace std;

int v[2001][2001];
int n,k;
int num(int x1,int y1,int x2,int y2){
    return v[x2][y2] - v[x2][y1] - v[x1][y2] + v[x1][y1];///前缀和 减去左边 下边和左下边的k宫格前缀和  容斥定理：左边和下边都包含了左下边 需要加上一个左下边
}
int main()
{
    int x,y;
    char ch;
    scanf("%d%d",&n,&k);
    for(int i = 1;i <= n;i ++){
        scanf("%d%d %c",&x,&y,&ch);
        x %= 2 * k;///把所有点都移动到 2k * 2k 的区域
        y %= 2 * k;
        x += k * (ch == 'W');///x可以变成y W 也可以变成 B 这里白色都变成黑色的 如果转换后的黑色是满足的那么原来的白色也一定是满足的
        v[x % (2 * k) + 1][y % (2 * k) + 1] ++;///求前缀和要求从（1,1）开始
    }
    for(int i = 1;i <= 2 * k;i ++)///求前缀和
        for(int j = 1;j <= 2 * k;j ++)
            v[i][j] += v[i - 1][j] + v[i][j - 1] - v[i - 1][j - 1];///加上左边下边和左下角的和  容斥定理：左边和下边的都包含了左下边的  要减去一个左下边的
    int ans = 0,sum;
    for(int i = 1;i <= k;i++)///k * k个格子依次做为起点构成新的k宫格 也就是移动k宫格 看看有几个黑色点包含在内 （默认黑色 可互换）
        for(int j = 1;j <= k;j++)
        {
            ///斜对角的k宫格是相同颜色 2k * 2k区域最多有五个这样的区域
            sum = num(0,0,i,j) + num(i,j,k + i,k + j) + num(k + i,k + j,2 * k,2 * k) + num(k + i,0,2 * k,j) + num(0,k + j,i,2 * k);
            ans = max(ans,max(sum,n - sum));///黑白色可以互换
        }
    printf("%d\n",ans);
}


Measured memory_bytes: 15872
#include<bits/stdc++.h>
#define REP(i,n) for(int i=0;i<(n);++i)
#define ALL(v)   (v).begin(),(v).end()
#define debug(x) cerr<<#x<<": "<<(x)<<endl
#define INF      (int)1e9
#define MOD      ((int)1e9+7)
using namespace std;
typedef long long     llong;
typedef vector<int>   vi;
typedef vector<vi >   vvi;
typedef vector<vvi >  vvvi;
typedef pair<int,int> pii;
template<class Type_a,class Type_b> bool chmax(Type_a &a,const Type_b &b){if(a<b){a=b;return true;}return false;}
template<class Type_a,class Type_b> bool chmin(Type_a &a,const Type_b &b){if(a>b){a=b;return true;}return false;}
template<class Type> Type igcd(Type x,Type y){if(x==0||y==0)return (x>y)?x:y;return (y%x)?igcd(y%x,x):x;}
template<class Type> Type ilcm(Type x,Type y){return x/igcd(x,y)*y;}
template<class Type> void line(const Type &a){int cnt=0;for(const auto &elem:a){if(cnt++)cout<<' ';cout<<elem;}cout<<endl;}

int main(){
	int n;
	cin>>n;
	
	map<string,int> mp;
	int hoge=0;
	REP(i,n){
		string s;
		cin>>s;
		hoge=max(hoge,++mp[s]);
	}
	
	for(auto elem:mp){
		if(elem.second==hoge) cout<<elem.first<<endl;
	}
}

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

int main()
{
    int n;
    cin >> n;
    int x[102], y[102], h[102];
    for(int i = 0; i < n; i++) cin >> x[i] >> y[i] >> h[i];
    for(int i = 0; i <= 100; i++){
        for(int j = 0; j <= 100; j++){
            bool ans = true;
            int hei = 0;
            for(int k = 0; k < n; k++){
                if(h[k] != 0){
                    hei = h[k] + abs(i - x[k]) + abs(j - y[k]);
                }
            }
            if(hei == 0){
                cout << i << " " << j << " " << 1 << endl;
                break;
            }
            for(int k = 0; k < n; k++){
                if(h[k] != max(hei - (abs(i - x[k]) + abs(j - y[k])), 0)) ans = false;
            }
            if(ans) cout << i << " " << j << " " << hei << endl;
        }
    }
}

Measured memory_bytes: 256
var GET=(function(){function f(s){return new g(s);}function g(s){this._s=s.trim().split("\n");this._y=0;}g.prototype.a=function(f){var s=this._s, y=this._y, r;if(typeof s[y]==="string")s[y]=s[y].split(" ").reverse();r=s[y].pop();if(!s[y].length)this._y++;return f?r:+r;};g.prototype.l=function(f){var s=this._s[this._y++].split(" ");return f?s:s.map(a=>+a);};g.prototype.m=function(n,f){var r=this._s.slice(this._y,this._y+=n).map(a=>a.split(" "));return f?r:r.map(a=>a.map(a=>+a));};g.prototype.r=function(n,f){var r=this._s.slice(this._y,this._y+=n);return f?r:r.map(a=>+a);};return f;})();
var o=GET(require("fs").readFileSync("/dev/stdin","utf8"));

console.log(main());
function main(){
  var a = o.a();
  var b = o.a();
  var c = o.a();
  var d = a + b + 1;
  if(d >= c)return b + c;
  return b + d;
}

Measured memory_bytes: 22076
#include <stdio.h>
#include <algorithm>

using namespace std;

int main(){
	int H,W;
	while(true){
		scanf("%d %d",&H,&W);
		if(H == 0 && W == 0) break;
		for(int i = 0; i < W; i++) printf("#");
		printf("\n");

		for(int i = 1; i < H-1; i++){
			printf("#");
			for(int j = 1; j < W-1; j++) printf(".");
			printf("#\n");
		}

		if(H > 1){
			for(int i = 0; i < W; i++) printf("#");
			printf("\n");
		}
		printf("\n");
	}
}



Measured memory_bytes: 2604
N = int(input())
# 約数
def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)
    return divisors

divs = make_divisors(N)
ans = 0
for div in divs:
    x = N//div-1
    if x > 0 and N // x == div:
        ans += x
print(ans)

Measured memory_bytes: 3272
#include <iostream>
#include <algorithm>
#include <cmath>
#include <vector>
#include <complex>
#include <queue>
#include <deque>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <iomanip>
#include <assert.h>
#include <array>
#include <cstdio>
#include <cstring>
#include <random>
#include <functional>
#include <numeric>
#include <bitset>

using namespace std;

#define REP(i,a,b) for(int i=a;i<(int)b;i++)
#define rep(i,n) REP(i,0,n)
#define all(c) (c).begin(), (c).end()
#define zero(a) memset(a, 0, sizeof a)
#define minus(a) memset(a, -1, sizeof a)
template<class T1, class T2> inline bool minimize(T1 &a, T2 b) { return b < a && (a = b, 1); }
template<class T1, class T2> inline bool maximize(T1 &a, T2 b) { return a < b && (a = b, 1); }

typedef long long ll;
int const inf = 1<<28;

struct union_find {
  vector<int> rank_;
  vector<int> size_;
  vector<int> rid_;

  union_find(int n) { rank_.resize(n); rid_.assign(n, -1); size_.resize(n, 1); }

  void unite(int u, int v) {
    u = root(u), v = root(v);
    if(u == v) { return; }
    size_[u] = size_[v] = size_[u] + size_[v];
    if(rank_[u] < rank_[v]) { rid_[u] = v; }
    else { rid_[v] = u; if(rank_[u] == rank_[v]) { rank_[u]++; } }
  }

  bool same(int u, int v) { return root(u) == root(v); }
  int root(int x) { if(rid_[x] < 0) return x; else return rid_[x] = root(rid_[x]); }
  int operator[](int x) { return root(x); }
  int size_of(int x) { return size_[x]; }
  
};

int main() {

  int N, M; cin >> N >> M;

  union_find uf(N);

  rep(i, M) {
    int s, t; cin >> s >> t; s--, t--;
    uf.unite(s, t);
  }

  int vils = 0;
  set<int> cities;

  rep(i, N) {
    if(uf.size_of(i) == 1) { vils ++; }
    else { cities.insert(uf[i]); }
  }

  cout << abs(vils - (int)cities.size()) << endl;

  return 0;
}

Measured memory_bytes: 3128
H, W, N = map( int, input().split())
sx, sy = map( int, input().split())
sx, sy = sy-1, sx-1
S = input()
T = input()
ans = "YES"
x = sx
for i in range(N):#left
    if S[i] == "L":
        x -= 1
    if x < 0:
        ans = "NO"
        break
    if T[i] == "R":
        if x < W-1:
            x += 1
x = sx
for i in range(N):#right
    if S[i] == "R":
        x += 1
    if x > W-1:
        ans = "NO"
        break
    if T[i] == "L":
        if x > 0 :
            x -= 1
y = sy
for i in range(N):#up
    if S[i] == "U":
        y -= 1
    if y < 0:
        ans = "NO"
        break
    if T[i] == "D":
        if y < H-1 :
            y+= 1

y = sy
for i in range(N):#down
    if S[i] == "D":
        y += 1
    if y > H-1:
        ans = "NO"
        break
    if T[i] == "U":
        if y > 0 :
            y-= 1            
print(ans)


Measured memory_bytes: 3888
#include <stdio.h>

long long con(long long n);

int main(){
    int n;
    scanf("%d",&n);
    int a[200000];
    int num[200000];
    for(int i = 0;i < n;i++){
        scanf("%d",&a[i]);
        a[i]--;
        num[i] = 0;
    }
    for(int i = 0;i < n;i++){
        num[a[i]]++;
    }
    long long result = 0;
    for(int j = 0;j < n;j++){
        result += con(num[j]);
    }

    for(int i = 0;i < n;i++){
        long long ans = result;
        ans -= con(num[a[i]]);
        ans += con(num[a[i]] - 1);
        printf("%lld\n",ans);
    }
    return 0;
}

long long con(long long n){
    return n*(n - 1)/2;
}

Measured memory_bytes: 4096
#include <algorithm>
#include <iostream>
#include <limits>
#include <vector>

using ::std::cin;
using ::std::cout;
using ::std::endl;
using ::std::string;
using ::std::vector;

using LL = long long;

vector<int> ReadIntVector(int n) {
  vector<int> xs(n);
  for (int i = 0; i < n; i++) {
    cin >> xs[i];
  }
  return xs;
}

vector<LL> ReadLLVector(int n) {
  vector<LL> xs(n);
  for (int i = 0; i < n; i++) {
    cin >> xs[i];
  }
  return xs;
}

LL LLVectorToSum(const vector<LL>& xs) {
  LL sum = 0;
  for (LL x : xs) {
    sum += x;
  }
  return sum;
}

string LLVectorToString(const vector<LL>& xs, const string& separator) {
  string output;
  for (int i = 0; i < xs.size(); i++) {
    if (i > 0) output.append(separator);
    output.append(std::to_string(xs[i]));
  }
  return output;
}

int main() {
  int n;
  cin >> n;
  vector<LL> ds = ReadLLVector(n);

  LL sum = LLVectorToSum(ds);

  LL subSum = 0;
  for (int i = 1; i <= n - 2; i += 2) {
    subSum += 2 * ds[i];
  }

  // cout << sum << " " << subSum << endl;

  vector<LL> xs(n);
  xs[0] = sum - subSum;
  for (int i = 1; i < n; i++) {
    xs[i] = (ds[i - 1] - xs[i - 1] / 2) * 2;
  }

  string output = LLVectorToString(xs, " ");
  cout << output << endl;
  return 0;
}

Measured memory_bytes: 4084
#include<iostream>
#include<string>
#include<iomanip>
#include<cmath>
#include<vector>
#include<algorithm>
#include<utility>

using namespace std;

#define int long long
#define endl "\n"

constexpr long long INF = (long long)1e18;
constexpr long long MOD = 1'000'000'007; 

struct fast_io {
	fast_io(){
		std::cin.tie(nullptr);
		std::ios::sync_with_stdio(false);
	};
} fio;

signed main(){
	cout<<fixed<<setprecision(12);
	
	const int NUM = 20000;
	// const int NUM = 20;
	const long double eps = 1e-10;
	const long double pi = acos(-1);
	long double ans = 0;
	int N;
	// vector<pair<long double,long double>> in;
	vector<pair<int, int>> in;
	
	cin>>N;
	
	in.resize(N);
	
	for(int i = 0; i < N; i++){
		cin>>in[i].first>>in[i].second;
	}
	
	for(int i = 0; i < NUM; i++){
		long double a = 2 * pi / NUM * i - pi;
		
		long double nx = cos(a), ny = sin(a);
		long double x = 0, y = 0;
		
		 long double z = atan2(ny, nx);
		
		int con= 0;
		 
		 
		 
		for(int j = 0; j < N; j++){
			if(abs(in[j].first) + abs(in[j].second) == 0) continue;
			
			long double t = atan2(ny - in[j].second, nx - in[j].first);
			long double T = atan2(in[j].second, in[j].first);
		
			if(fabs(T - a) - eps > pi/2 && fabs(T - a + pi * 2) - eps > pi/2 && fabs(T - a - pi * 2) - eps > pi/2) continue;
			con |= (1<<j);
			x += in[j].first;
			y += in[j].second;
		}
		
		ans = max(ans, sqrt(x * x + y * y));
	}
	
	cout<<ans<<endl;
	
	
	return 0;
}

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

vector<long long> answer;

vector<int> save(102);

void back(int d, int c, long long cur) {
    if (d == c) {
        answer.push_back(cur);
        return;
    }
    if (d == 0) {
        for (int i = 1; i <= 9; ++i) {
            save[d] = i;
            back(d + 1, c, i);
        }
        return;
    }
    for (int i = -1; i <= 1; ++i) {
        save[d] = save[d - 1] + i;
        if (0 <= save[d] && save[d] <= 9) {
            back(d + 1, c, cur * 10 + save[d]);
        }
    }
}

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

    for (int i = 1; i < 12; ++i) {
        back(0, i, 0);
    }
    sort(answer.begin(), answer.end());
    int k;
    cin >> k;
    cout << answer[k - 1] << "\n";
    return 0;
}


Measured memory_bytes: 10476
// #include "pch.h"
#include <iostream>
#include <algorithm>
#include <map>
#include <set>
#include <queue>
#include <bitset>
#include <climits>
#include <string>
#include <cmath>
#include <bitset>
#include <complex>
#include <functional>
#include <ctime>
#include <cassert>
#include <fstream>
#include <stack>
#include <random>

typedef long long ll;
typedef std::pair<int, int> Pii;
typedef std::pair<long long, long long> Pll;
typedef std::pair<double, double> Pdd;

#define rip(i, n, s) for (int i = (s);i < (int)( n ); i++)
#define all(a) a.begin(), a.end()
#define MM << " " <<

template<typename T>
using MaxHeap = std::priority_queue<T>;
template<typename T>
using MinHeap = std::priority_queue<T, std::vector<T>, std::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;
}

template<typename T>
void vdeb(std::vector<T> &da) {
    for (int i = 0;i < da.size();i++) {
        if (i == da.size() - 1) std::cout << da[i];
        else std::cout << da[i] << ' ';
    }
    std::cout << '\n';
}
template<typename T>
void vdeb(std::vector<std::vector<T>> &da) {
    for (int i = 0;i < da.size();i++) {
        std::cout << i << ' ';
        vdeb(da[i]);
    }
    std::cout << '\n';
}

using namespace std;


int main() {
    int n, x, t; cin >> n >> x >> t;
    cout << (n+x-1)/x*t << endl;
}

Measured memory_bytes: 3592
#include <cstdio>
#include <vector>
#include <queue>
#include <algorithm>
using namespace std;

vector<char> bfs(const vector<vector<int> > &G, int start){
	int v = G.size();
	vector<char> visit(v);

	queue<int> q;
	q.push(start);
	visit[start] = 1;

	while(!q.empty()){
		for(int i = 0; i < G[q.front()].size(); ++i){
			int t = G[q.front()][i];
			if(!visit[t]){
				visit[t] = 1;
				q.push(t);
			}
		}
		q.pop();
	}

	return visit;
}

bool solve(int m, int n){
	vector<int> d(n + 2);
	for(int i = 1; i <= n; ++i){
		scanf("%d", &d[i]);
	}

	vector<vector<int> > G(n + 2), rG(n + 2);
	for(int i = 0; i <= n; ++i){
		for(int j = 1; j <= m; ++j){
			int t = i + j;
			if(t > n + 1) break;
			t += d[t];

			if(t < 0){ t = 0; }
			else if(t > n + 1){ t = n + 1; }

			G[i].push_back(t);
			rG[t].push_back(i);
		}
	}

	vector<char> reach = bfs(G, 0), goal = bfs(rG, n + 1);
	for(int i = 0; i < n + 2; ++i){
		if(reach[i] && !goal[i]){
			return false;
		}
	}
	return true;
}

int main(){
	int n, m;
	while(scanf("%d%d", &m, &n) == 2){
		puts(solve(m, n) ? "OK" : "NG");
	}
}

Measured memory_bytes: 1080
#include<cstdio>
#include<vector>
#include<algorithm>
#include<utility>
#include<numeric>
#include<iostream>
#include<array>
#include<string>
#include<sstream>
#include<stack>
#include<queue>
#include<list>
#define _USE_MATH_DEFINES

#include<math.h>
#include<map>

#define SENTINEL 1000000001

#define min(a,b) (a)>(b)?(b):(a)
#define max(a,b) (a)>(b)?(a):(b)

using namespace std;

int dp[10001] = { 0 }, v[100], w[100];

int main()
{
	int N, W;

	cin >> N >> W;

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

	for (int i = 0; i < N; i++)
	{
		for (int j = 0; j <= W; j++)
		{
			if (j + w[i] <= W)
			{
				dp[j + w[i]] = max(dp[j] + v[i], dp[j + w[i]]);
			}
		}
	}

	cout << dp[W] << endl;

	return 0;
}


Measured memory_bytes: 3120
#include <iostream>

using namespace std;

int main() {
  int n, d, x;
  cin >> n >> d >> x;
  for (int i = 0; i < n; ++i) {
    int a;
    cin >> a;
    x += (d - 1) / a + 1;
  }
  cout << x << endl;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main() {
	long long n;
	scanf("%lld", &n);
	int t = 0;
	while (n) {
		t++;
		n /= 2;
	}
	long long ans=1;
	ans <<= t;
	ans--;
	cout << ans << endl;

	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int main()
{
    // 整数の入力
	int n;
  	string s;

    cin >> n ;
  	cin >> s;
  
  	if(n<3200){
		cout << "red" << endl;
    }else {
     	cout << s << endl;
    }
	
    return 0;
}

Measured memory_bytes: 256
//Never stop chasing!-MD.SOURAV.

// ░░░░░░░░( •̪●)░░░░░░░░░░░░░░░░░░░░░░░░
// ░░░░░░███████ ]▄▄▄▄▄▄▄▄▃░░░▃░░░░ ▃░
// ▂▄▅█████████▅▄▃▂░░░░░░░░░░░░░░░░░
// [███████████████████].░░░░░░░░░░░░░░
// ◥⊙▲⊙▲⊙▲⊙▲⊙▲⊙▲⊙◤...░░░░░░░░░░░░

#include <bits/stdc++.h>

#define yes            cout<<"YES"<<endl
#define no             cout<<"NO"<<endl
#define sz(x)          x.size()
#define ll             long long int
#define li             long int
#define start          ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define test           int t;cin>>t;while(t--)
#define f(i, a, n)     for(int i=a; i<n;i++)
#define gcd(a,b)       __gcd(a,b)
#define lcd(a,b)       (a*b)/gcd(a,b)
#define pb             push_back
#define mp(x,y)        make_pair(x,y)
#define rsrt(v)        sort(v.begin(),v.end(),greater<int>())
#define srt(v)         sort(v.begin(),v.end())
#define basrt(a,n)     sort(a,a+n,greater<int>())
#define asrt(a,n)      sort(a,a+n)
#define fact(n)        ll x=1;for(ll i=1;i<=n;i++){x=(x*i);}
#define F              first
#define S              second
#define deb(x)         cout << #x << ": " << x << endl;
#define enter(v,n)     for(ll i=0;i<n;i++){ll x;cin>>x;v.pb(x);}
#define INF 	       1000000007
#define unique(v)      v.erase(unique(v.begin(),v.end()),v.end())

using namespace std;

double pi=3.14159265358979323846264338327950288419716939937510582097494459230781640628620899862803482534211706798214808651328230664 ;
typedef vector<ll> vll ;
typedef vector<int> vii ;
typedef vector<pair<ll,ll>> vpll;
typedef vector<pair<int,int>> vpii;
typedef map<ll,ll> mpllll;
typedef map<char,ll> mpchll;
typedef map<string,ll>mpsll;

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

void solve()
{

       int n;
	   cin>>n;
       mpllll mp;
       for(int i=1;i<100;i++)
	   {
	   	for(int j=1;j<100;j++)
		{
			for(int k=1;k<100;k++)
			{
				ll x=(i*i)+(j*j)+(k*k)+(i*k)+(i*j)+(k*j);
				mp[x]++;

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







}

int main()
{
    ios_base::sync_with_stdio(0); cin.tie(0);cout.tie(0);
    ll test_case=1;
    //cin>>test_case ;
    while(test_case--)
	{
		 solve();
	}

	return 0;
}

Measured memory_bytes: 6000
#include<bits/stdc++.h>
using namespace std;
using i64 = int_fast64_t;
#define rep(i, N) for(int (i) = 0; (i) < (N); (i)++)
#define all(v) (v).begin(), (v).end()
#define eb emplace_back
#define Cout(s) cout << s << endl
string Yes(bool b) {if(b){return "Yes";} else {return "No";}}
string YES(bool b) {if(b){return "YES";} else {return "NO";}}

struct mint{
    using i64 = int_fast64_t;
    const i64 MOD = 1000000007;
    i64 x;

    mint(const i64 y = (i64)0) noexcept : x(y) { 
        if(x >= MOD) x %= MOD; 
        if(x < 0) x += MOD;
    }
    mint operator+() const noexcept {return x;}
    mint operator-() const noexcept {return x ? MOD - x : 0;}
    mint operator+(const mint y) const noexcept {return (mint)*this += y; }
    mint operator-(const mint y) const noexcept {return (mint)*this -= y; }
    mint operator*(const mint y) const noexcept {return (mint)*this *= y;}
    mint operator/(const mint y) const noexcept {return (mint)*this /= y;}

    mint operator=(const mint y) noexcept {
        x = y.x;
        if(x >= MOD) x -= MOD;
        if(x < 0) x += MOD;
        return *this;
    }
    mint operator=(const i64 y) noexcept {
        x = y;
        if(x >= MOD) x -= MOD;
        if(x < 0) x += MOD;
        return *this;
    }
    mint& operator+=(const mint y) noexcept {
        x += y.x; 
        if(x >= MOD) x -= MOD;
        return *this;
    }
    mint& operator-=(const mint y) noexcept {
        x -= y.x;
        if(x < 0) x += MOD;
        return *this;
    }
    mint& operator*=(const mint y) noexcept {
        x *= y.x;
        if(x >= MOD) x %= MOD;
        return *this;
    }
    mint& operator/=(mint y) noexcept {
        i64 exp = MOD - 2;
        while(exp){
            if(exp & 1) *this *= y;
            y *= y;
            exp /= 2;
        }
        return *this;
    }
    friend std::ostream& operator<< (std::ostream& os, const mint& m) noexcept {
        os << m.x;
        return os;
    }
    friend std::istream& operator>> (std::istream& in, mint& m) noexcept {
        const int mod = 1000000007;
        in >> m.x; 
        if(m.x < 0) m.x += mod;
        if(m.x >= mod) m.x %= mod;
        return in; 
    }
    friend mint mod_pow(mint n, i64 k) noexcept {
        mint res = 1;
        while(k){
            if(k&1) res *= n;
            n *= n;
            k >>= 1;
        }
        return res;
    }
};

int main(){
	int N;
	mint K;
	cin >> N >> K;
	vector<int> A(N);
	rep(i, N) cin >> A[i];

	mint ans = 0;
	for(int i = 0; i < N; i++){
		mint a = 0;
		mint b = 0;
		for(int j = 0 ; j < N; j++){
			if(i == j) continue;
			if(A[i] > A[j]) {
				a += 1;
				if(j > i) b += 1;
			}
		}
		ans += a * (K*(K-1)/2l);
		ans += K * b;
	}

	Cout(ans);
}


Measured memory_bytes: 256
#include <vector>
#include <array>
#include <algorithm>
#include <iostream>
#include <set>
#include <unordered_set>
#include <unordered_map>
#include <map>
#include <math.h>
#include <assert.h>
#include <queue>
#include <deque>
#include <iomanip>
#include <numeric>
#include <fstream>

using namespace std;

typedef long long ll;
typedef long double ld;

#define fi first
#define se second

#define mp make_pair
#define pb push_back
#define sz(x) ((int)(x).size())

typedef vector<int> vi;
typedef vector<double> vd;
typedef vector<ld> vld;
typedef vector<vector<int>> vvi;
typedef vector<ll> vl;
typedef vector<vector<ll>> vvl;
typedef vector<vector<ld>> vvd;
typedef vector<string> vs;
typedef vector<bool> vb;

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

bool ok(ll x) {
    ll d = 0;
    while (x > 0) {
        ++d;
        x /= 10;
    }
    return d % 2 == 1;
}

int main() {
    cout << setprecision(30);
    ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);

    ll n;
    cin >> n;
    ll ans = 0;
    for (int i = 1; i <= n; ++i) {
        ans += ok(i);
    }
    cout << ans << endl;

    return 0;
}


Measured memory_bytes: 256
import java.util.*;

class Main {

    static void solve (int n, int k, int[] needs, int[][] wants) {

        for (int i = 0; i < k; i++) {
            int sum = 0;
            for (int j = 0; j < n; j++) {
                sum += wants[j][i];
            }
            if (sum > needs[i]) {
                System.out.println("No");
                return;
            }
        }

        System.out.println("Yes");
    }

    public static void main (String [] args) {

        Scanner sc = new Scanner(System.in);

        while(true) {
            int n = sc.nextInt();
            int k = sc.nextInt();

            if (n == 0 && k == 0)   break;

            int [] needs = new int[k];

            for(int i = 0; i < k; i++)  needs[i] = sc.nextInt();
            
            int [][] wants = new int[n][k];

            for(int i = 0; i < n; i++) {
                for (int j = 0; j < k; j++) wants[i][j] = sc.nextInt();
            }

            solve(n, k, needs, wants);
        }

    }
}

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

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

  
  

Measured memory_bytes: 3596
code = r"""
# distutils: language=c++
# distutils: include_dirs=[/home/contestant/.local/lib/python3.8/site-packages/numpy/core/include, /opt/atcoder-stl]
from libcpp cimport bool
from libcpp.vector cimport vector
cdef extern from "<atcoder/twosat>" namespace "atcoder" nogil:
    cdef cppclass two_sat:
        two_sat(int n)
        void add_clause(int i, bool f, int j, bool g)
        bool satisfiable()
        vector[bool] answer()
from libcpp.pair cimport pair
from libc.stdlib cimport abs
from libc.stdio cimport getchar, printf
cdef int read() nogil:
    cdef int b, c = 0
    while 1:
        b = getchar() - 48
        if b < 0: return c
        c = c * 10 + b
cdef int n = read(), d = read(), i, j
cdef two_sat *ts = new two_sat(n)
cdef vector[pair[int, int]] z = vector[pair[int, int]](n)
cdef vector[bool] res
for i in range(n):
    z[i].first = read()
    z[i].second = read()
for i in range(n):
    for j in range(i + 1, n):
        if abs(z[i].first - z[j].first) < d: ts.add_clause(i, True, j, True)
        if abs(z[i].first - z[j].second) < d: ts.add_clause(i, True, j, False)
        if abs(z[i].second - z[j].first) < d: ts.add_clause(i, False, j, True)
        if abs(z[i].second - z[j].second) < d: ts.add_clause(i, False, j, False)
if ts.satisfiable():
    printf('Yes\n')
    res = ts.answer()
    for i in range(n):
        if res[i]: printf('%d\n', z[i].second)
        else: printf('%d\n', z[i].first)
else:
    printf('No\n')
"""
import os, sys
if sys.argv[-1] == 'ONLINE_JUDGE':
    open('solve.pyx', 'w').write(code)
    os.system('cythonize -i -3 -b solve.pyx')
import solve

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

int main(){
   double xA,yA,xB,yB,xC,yC,xD,yD;
   while(cin >> xA >> yA >> xB >> yB >> xC >> yC >> xD >> yD){
       double t = (yA-yB)*(yC-yD) + (xC-xD)*(xA-xB);
       if(abs(t) < 0.0000000001) cout << "YES" << endl;
       else cout << "NO" << endl;
   }
   return 0;
}

Measured memory_bytes: 1224
#include <iostream>
#include <vector>
#include <algorithm>
#include <map>
#include <numeric>
#include <string>
#include <cstdio>
#include <cstring>
#include <queue>
#include <stack>
#include <set>
#include <cmath>
#include <bitset>

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

#define FALSE printf("false\n");
#define TRUE printf("true\n");
#define all(x) (x).begin(),(x).end()
#define rep(i,n) for(int i = 0;i < ((int)(n));++i)
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define UNIQUE(v) v.erase( unique(v.begin(), v.end()), v.end() );
#define test(a) cout<<"line:"<<__LINE__<<"["<<(#a)<<": "<<(a)<<"]"<<endl

const int INF = 1e9+7;
const ll INFL = 9*1e18;
const int dx[4] = { 1, 0, -1, 0 };
const int dy[4] = { 0, 1, 0, -1 };

#define SUM(vec) accumulate(all(vec),0LL) // 配列の中身を全部足す
template<typename T>void print(T&& x){cout<<x<<endl;}// 改行付き出力
ll inline digit(ll num){int tmp = 0;while(num){tmp++;num/=10;}return tmp;} // 桁数
template<typename T>inline T digitSum(T num){T sum = 0;while(num){sum+=num%10;num/=10;}return sum;} // 各桁の和
template<typename T>inline T gcd(T a,T b){if(b == 0)return a;return gcd(b,a%b);} // 最大公約数
template<typename T>inline T lcm(T a, T b){T g = gcd(a,b);return a/g*b;} // 最小公倍数
template<typename T>inline T power(T a,T b){T tmp=1;rep(i,b){tmp*=a;}return tmp;} // 累乗
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 ctoi(char c){return c - '0';}

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

// TODO: write
int main() { 
  int n;cin>>n;
  ll ans = 0;
  vector<vector<int> > fl(10,vector<int>(10,0));
  rep(i,n+1){
    if(i%10 == 0)continue;
    int tmp = i;
    int first;
    
    while(tmp){
      first=tmp;
      tmp/=10;
    }

    fl[first][i%10]++;
    ans += fl[i%10][first];

    if(first == i%10)ans += fl[i%10][first]-1;
    else ans += fl[i%10][first];
    
  }
  
  print(ans);
  return 0;
}

Measured memory_bytes: 256
import math as mt
#import numpy as np

def ro(n):
  return mt.floor(mt.sqrt(n))
def ya():
  print("Yes")
  return
def na():
  print("No")
  return


#a,b=map(int,input().split())
lis=list(map(int,input().split()))
#n=int(input())
#s=input()
print(lis.index(0)+1)


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

int main() {
  ll H, W;
  cin >> H >> W;

  ll res;
  if (H == 1 || W == 1) res = 1;
  else {
    if (H * W % 2 == 0) res = H * W / 2;
    else res = (H * W / 2) + 1;
  }

  cout << res << endl;
  return 0;
}


Measured memory_bytes: 256
l,r=map(int,open(0).read().split())

if r-l>=2019:
    print(0)
    exit(0)

m=[]
for i in range(l,r+1):
    m.append(i%2019)

n=len(m)
ans=2019

for i in range(n):
    for j in range(i+1,n):
        ans=min(ans,(m[i]*m[j])%2019)
    
print(ans)

Measured memory_bytes: 65716
package main

import "fmt"

func main() {
	var n int
	fmt.Scan(&n)
	m := make(map[int]int, n)
	var to int
	for i := 1; i <= n; i++ {
		fmt.Scan(&to)
		m[i] = to
	}
	cnt := 0
	current := 1
L:
	for {
		switch m[current] {
		case 2:
			cnt++
			current = 2
			break L
		case 0:
			cnt = -1
			current = 0
			break L
		default:
			cnt++
			current, m[current] = m[current], 0
		}
	}
	fmt.Println(cnt)
}


Measured memory_bytes: 6784
#include<stdio.h>
 
int main()
 
{
    int n,x,t;
    scanf("%d%d%d",&n,&x,&t);
    if(n%x==0){
    	printf("%d\n",(n/x)*t);
    	}
  	else{
      	printf("%d\n",((n/x)*t)+t);
      	}
  	return 0;
}

Measured memory_bytes: 1732
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (n); i++)
#define repf(i, j, n) for (int i = (j); i < (n); i++)
int main() {
  int n;
  cin >> n;
  string s;
  cin >> s;
  s.push_back(s[0]);
  vector<int> a(n + 2, 0);
  rep(i, 4) {
    a[0] = i &1, a[1] = (i>>1)&1;
    rep(j, n) { a[j + 2] = a[j] ^ a[j + 1] ^ (s[j + 1] == 'x'); }
 
    if (a[n] == a[0] && a[n + 1] == a[1]) {
      string t = "";
      rep(k, n) { t.push_back("SW"[a[k]]); }
      cout << t << endl;
      return 0;
    }
  }
  cout << -1 << endl;
  return 0;
}

Measured memory_bytes: 1024
// #define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <string>
#include <vector>
#include <map>
#include <set>
#include <stack>
#include <cmath>
#include <cstdlib>
#include <functional>
#include <locale>
#include <cctype>
#include <sstream>	// istringstream
using namespace std;

void Output(vector<int> ans){
	for (int i = 0; i < 6; i++){
		cout << (i + 1) << ":";
		for (int j = 0; j < ans[i]; j++){
			cout << "*";
		}
		cout << endl;
	}
}

int main(){
	int n;
	double in;
	vector<int> ans(7, 0);

	cin >> n;
	for (int i = 0; i < n; i++){
		cin >> in;
		for (int i = 0; i < 6; i++){
			if (in < (165.0 + 5.0*i)){
				ans[i]++;
				break;
			}
		}
		/*
		if (in < 165.0)	ans[0]++;
		else if (in >= 165.0 && in < 170.0)	ans[1]++;
		else if (in >= 170.0 && in < 175.0)	ans[2]++;
		else if (in >= 175.0 && in < 180.0)	ans[3]++;
		else if (in >= 180.0 && in < 185.0)	ans[4]++;
		else			ans[5]++;
		*/
	}
	Output(ans);
	return 0;
}

Measured memory_bytes: 1248
#include<bits/stdc++.h>
using namespace std;
int main(){
int N,M;
  cin>>N>>M;
  int sum=0;
  for(int i=0;i<M;i++){
  int x;
    cin>>x;
    sum+=x;
  
  }
  if(sum<=N)
    cout<<N-sum<<endl;
  else
    cout<<-1<<endl;
   return 0;
}

Measured memory_bytes: 3584
#include <stdio.h>
#include <iostream>
#include <vector>
#include <assert.h>
#include <set>
#include <map>
#include <cmath>
#include <queue>
#include <stack>
#include <string>
#include <sstream>
#include <memory.h>
#include <time.h>
#include <string.h>
#include <stdlib.h>
#include <algorithm>
using namespace std;
typedef long long ll;
const int N = 51;
vector<int> can;
int dp[N][N][N];
int dp2[N][N][N];
int calc2(int a, int b, int can) {
	if (!can || a <= b)
		return a == b;
	int &ret = dp2[a][b][can];
	if (ret != -1)
		return ret;
	ret = calc2(a, b, can - 1);
	if (!ret)
		ret = calc2(a%can, b, can - 1);
	return ret;
}
int calc(int a, int b, int i) {
	if (i == can.size() - 1 || a <= b)
		return calc2(a, b, can.back() - 1);
	int &ret = dp[a][b][i];
	if (ret != -1)
		return ret;
	ret = calc(a, b, i + 1);
	if (!ret)
		ret = calc(a%can[i], b, i + 1);
	return ret;
}
int main()
{
	int n;
	cin >> n;
	vector<int> a(n), b(n);
	for (auto &x : a)
		cin >> x;
	for (auto &x : b)
		cin >> x;
	if (a == b) {
		cout << 0 << endl;
		return 0;
	}
	memset(dp2, -1, sizeof(dp2));
	for (int i = 0; i<n; ++i)
		if (!calc2(a[i], b[i], 50)) {
			puts("-1");
			return 0;
		}
	for (int i = 50; i > 0; --i) {
		memset(dp, -1, sizeof(dp));
		can.push_back(i);
		bool ok = true;
		for(int i=0;i<n;++i)
			if (!calc(a[i], b[i], 0)) {
				ok = false;
				break;
			}
		if (ok)
			can.pop_back();
	}
	ll res = 0;
	for (auto x : can)
		res |= 1ll << x;
	cout << res << endl;
	return 0;
}

Measured memory_bytes: 1280
#pragma GCC optimize("Ofast")
#include <bits/stdc++.h>

#define ll long long
#define ull unsigned long long

using namespace std;

int main() {
	int N, M, X;
	cin >> N >> M >> X;

	vector <int> C(N);
	vector<vector<int>> A(N, vector <int> (M));
	for (int ii = 0; ii < N; ++ii){
		cin >> C[ii];
		for (int jj = 0; jj < M; ++jj){
			cin >> A[ii][jj];
		}
	}

	int MAX = 1 << N;
	int ans = 100100100;
	for (int ii = 0; ii < MAX; ++ii){
		int ref = ii;
		int cnt = 0;
		int cost = 0;
		vector <int> v(M, 0);
		while (cnt < N) {
			if (ref & 1 == 1){
				for (int jj = 0; jj < M; ++jj){
					v[jj] += A[cnt][jj];
				}
				cost += C[cnt];
			}
			cnt++;
			ref = ref >> 1;
		}
		bool OK = true;
		for (int jj = 0; jj < M; ++jj){
			if (v[jj] < X){
				OK = false;
				break;
			}
		}
		if (OK){
			ans = min(cost, ans);
		}
	}

	if (ans == 100100100){
		cout << -1 << "\n";
	} else {
	cout << ans << "\n";

	}


	return 0;
}


Measured memory_bytes: 3628
#include<iostream>
using namespace std;
int main()
{
	int x=1,y=1,tmp;
	while(true)
	{
		cin>>x>>y;
      	if(x==0 && y==0) return 0;
		if(x>y)
		{
			tmp=y;
			y=x;
			x=tmp;
		}
		cout<<x<<" "<<y<<endl;
	}
}


Measured memory_bytes: 3092
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import accumulate, permutations, combinations, product, groupby
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

N = INT()
A = LIST()

A = [k for k, g in groupby(A)]
N = len(A)
i = 1
ans = 0

while i < N-1:
	if A[i-1] < A[i] > A[i+1] or A[i-1] > A[i] < A[i+1]:
		ans += 1
		i += 1
	i += 1
print(ans+1)


Measured memory_bytes: 16324
//
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vi = vector<int>;
using vvi = vector<vi>;
// #define MOD 1000000007
#define rp(i,n) for(int i=0;i<(n);i++)
#define up(i,s,e,d) for(int i=(s);i<(e);i+=(d))
#define ot(x) cout<<(x)
#define ote(x) cout<<(x)<<endl
#define all(x) (x).begin(),(x).end()

int main(){
	int d;
	cin>>d;
	if(d==25) ote("Christmas");
	if(d==24) ote("Christmas Eve");
	if(d==23) ote("Christmas Eve Eve");
	if(d==22) ote("Christmas Eve Eve Eve");
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
#include<boost/algorithm/string/replace.hpp>
#include<boost/multiprecision/cpp_int.hpp>
using namespace std;
using namespace boost::algorithm;
using namespace boost::multiprecision;
 
#define rep(i,n) for(int i=0 ; i<(n) ; i++)
#define repr(i,n) for(int i=(n) ; i>=0 ; i--)
#define ALL(x) (x).begin(),(x).end()

typedef long long ll;
typedef unsigned long long ull;
 
const ll INF = 1LL<<60;
const int MOD = 1e9+7;

template<typename T> bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<typename T> bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
//C++17以上
template<typename T>
T GCD(T a,T b){ return b ? GCD(b,a%b) : a ;}
template<typename T>
T LCM(T a,T b){ return a*b / GCD(a,b) ;}

template<typename T>//文字列の置換/Boost:replace_all()
T replace_str(T str, string target, string str_to) {
    string::size_type pos = 0;
    while (pos = str.find(target, pos), pos != string::npos) {
        str.replace(pos, target.length(), str_to);
        pos += str_to.length();
    }
    return str;
}

int main() {
    int n,d;cin >> n >> d;
    vector<vector<int>> x(n,vector<int>(d));
    rep(i,n)rep(j,d)cin >> x[i][j];
    int ans = 0;
    for(int i=0;i<n;i++){
        for(int j=i+1;j<n;j++){
            int sum = 0;
            for(int k=0;k<d;k++){
                int diff = abs(x[i][k] - x[j][k]);
                sum += diff*diff;
            }
            if(floor(sqrt(sum)) == ceil(sqrt(sum)))ans++;
        }
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 256
#include <stdio.h>

int main(void){
    int n;
    scanf("%d", &n);
    int a[n];
    for(int i = 0; i < n; i++){ //配列に要素を入れる
        scanf("%d", &a[i]);
        //printf("%d", a[i]);
    }

    double NUM = 0;
    for (int i = 0; i < n; i++){
        //printf("NUM:%f\n", NUM);
        //printf("%f\n", 1.0/a[i]);
        NUM = NUM + 1.0/a[i];
    }
    printf("%f\n", 1.0/NUM);

    return(0);
}

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

#define error(args...) { string _s = #args; replace(_s.begin(), _s.end(), ',', ' '); stringstream _ss(_s); istream_iterator<string> _it(_ss); err(_it, args); }

void err(istream_iterator<string> it) {}
template<typename T, typename... Args>
void err(istream_iterator<string> it, T a, Args... args) {
    cerr << *it << " = " << a << endl;
    err(++it, args...);
}

void code() {
    int n;
    cin>>n;
    if(n>=30)
        cout << "Yes\n";
    else
        cout << "No\n";


}

signed main() {
    std::ios_base::sync_with_stdio(false);
    int t=1;
    // cin>>t;
    for(int i=0; i<t; i++) {
        code();
    }
}


Measured memory_bytes: 3460
object Main extends App {
  import scala.io.StdIn._
  val n = readLong()
  val a = readLine().split(" ").map(_.toLong).toSeq
  val map = scala.collection.mutable.HashMap[Long,Int]()
  for(i <- a){
    map(i) = if(map.contains(i)) map(i) + 1 else 1
  }
  for(i <- 1L to(n)){
    println(if(map.contains(i)) map(i) else 0)
  }
}

Measured memory_bytes: 82308
import math
A, B, H, M = map(float,input().split())
H = H * 30 + M / 2
M = M * 6
C = abs(H - M)
if C == 0:
  print(A-B)
elif C == 180:
  print(A+B)
else:
  if C > 180:
    C = 360 - C
  print(math.sqrt(A**2 + B**2 - 2*A*B * math.cos(math.radians(C))))


Measured memory_bytes: 9392