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

vector<ll> divisor(int64_t n) {
  vector<ll> ret;
  for(ll i = 1; i * i <= n; i++) {
    if(n % i == 0) {
      ret.push_back(i);
      if(i * i != n) ret.push_back(n / i);
    }
  }
  sort(begin(ret), end(ret));
  return (ret);
}

ll gcd(ll a,ll b){
  if(a < b){
    ll temp = a+b;
    a = temp - a;
    b = temp - b;
  }
  ll c = 1;
  if(b == 0)return a;
  while(c != 0){
    c = a%b;
    if(c == 0)return b;
    a = b;
    b = c;
  }
}

bool pjudge(ll p){
    bool judge = true;
    for(int i = 2;i <= sqrt(p);i++){
        if(p % i == 0){
            judge = false;
            break;
        }
    }
    return judge;
}

int main(){
    ll a,b;
    cin >> a >> b;
    vector<ll> d;
    ll x = gcd(a,b);
    d = divisor(x);
    ll siz = d.size();
    ll ans = 0;
    for(int i = 0;i < siz;i++){
        if(pjudge(d[i]) == true)ans++;
    }
    cout << ans << endl;
    //cin >> a;      
}

Measured memory_bytes: 384
void main() {
  auto ip = readAs!(ulong[]), X = ip[0], Y = ip[1], Z = ip[2], K = ip[3];
  auto A = readAs!(ulong[]), B = readAs!(ulong[]), C = readAs!(ulong[]);
  A.sort!"a > b"();
  B.sort!"a > b"();
  C.sort!"a > b"();
  
  ulong[] arr;
  foreach(i; 0..X) foreach(j; 0..Y) foreach(k; 0..Z) {
    if((i+1) * (j+1) * (k+1) > K) continue;
    arr ~= A[i] + B[j] + C[k];
  }
  arr.sort!"a > b"();
  arr[0..K].each!(i => i.writeln);
}
// ===================================

import std.stdio;
import std.string;
import std.functional;
import std.algorithm;
import std.range;
import std.traits;
import std.math;
import std.container;
import std.bigint;
import std.numeric;
import std.conv;
import std.typecons;
import std.uni;
import std.ascii;
import std.bitmanip;
import core.bitop;

T readAs(T)() if (isBasicType!T) {
	return readln.chomp.to!T;
}
T readAs(T)() if (isArray!T) {
	return readln.split.to!T;
}

T[][] readMatrix(T)(uint height, uint width) if (!isSomeChar!T) {
	auto res = new T[][](height, width);
	foreach(i; 0..height) {
		res[i] = readAs!(T[]);
	}
	return res;
}

T[][] readMatrix(T)(uint height, uint width) if (isSomeChar!T) {
	auto res = new T[][](height, width);
	foreach(i; 0..height) {
		auto s = rs;
		foreach(j; 0..width) res[i][j] = s[j].to!T;
	}
	return res;
}

int ri() {
	return readAs!int;
}

double rd() {
	return readAs!double;
}

string rs() {
	return readln.chomp;
}


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

#define int long long
#define double long double
#define ff first
#define ss second
#define endl '\n'
#define ii pair<int, int>
#define mp make_pair
#define mt make_tuple
#define DESYNC ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0)
#define pb push_back
#define vi vector<int>
#define vii vector< ii >
#define EPS 1e-9
#define INF 1e18
#define ROOT 1
#define M 1000000007
const double PI = acos(-1);

using namespace std;

inline int mod(int n, int m){ int ret = n%m; if(ret < 0) ret += m; return ret; }

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

int32_t main(){
  DESYNC;
  int n;
  cin >> n;
  vector<int> v(n);
  for(int i=0; i<n; i++){
    cin >> v[i];
  }
  sort(v.begin(), v.end());
  int ans = 0;
  for(int i=0; i<n; i++){
    for(int j=i+1; j<n; j++){
      ans += lower_bound(v.begin(), v.end(), v[i]+v[j]) - (v.begin()+j) - 1;
    }
  }
  cout << ans << endl;
}




Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i, n) for (lli i = 0; i < (n); i++)
#define rrep(i, n) for (lli i = (n)-1; i >= 0; i--)
#define vall(x) (x).begin(), (x).end()
using namespace std;
using lli = long long int;
void YESNO(bool), YesNo(bool);
template <class T1, class T2> bool chmin(T1 &l, const T2 &r);
template <class T1, class T2> bool chmax(T1 &l, const T2 &r);
template <class T1, class T2> void vadd(vector<T1> &v, T2 x);

#define int long long int

void solve(long long K, std::string S) {
  if (S.size() <= K)
    cout << S << endl;
  else {
    cout << S.substr(0, K) + "..." << endl;
  }
}

signed main() {
  long long K;
  scanf("%lld", &K);
  std::string S;
  std::cin >> S;
  solve(K, S);
  return 0;
}

// -- lib
void YESNO(bool b) { cout << (b ? "YES" : "NO") << endl; }
void YesNo(bool b) { cout << (b ? "Yes" : "No") << endl; }

template <class T1, class T2> bool chmin(T1 &l, const T2 &r) {
  return (l > r) ? (l = r, true) : false;
}

template <class T1, class T2> bool chmax(T1 &l, const T2 &r) {
  return (l < r) ? (l = r, true) : false;
}

template <class T1, class T2> void vadd(vector<T1> &v, T2 x) {
  for (auto &s : v)
    s += T2(x);
}


Measured memory_bytes: 3680
#include <bits/stdc++.h>
using namespace std;
const int MAXN = 200005;
const int MAXT = 530000;
using lint = long long;
using pi = pair<int, int>;
const int mod = 1e9 + 7;

int n, m;
pi a[MAXN];
struct seg{
	int tree[MAXT], lazy[MAXT];
	void lazydown(int p){
		tree[2*p] += lazy[p];
		tree[2*p+1] += lazy[p];
		lazy[2*p] += lazy[p];
		lazy[2*p+1] += lazy[p];
		lazy[p] = 0;
	}
	void init(int s, int e, int p){
		if(s == e){
			tree[p] = s;
			return;
		}
		int m = (s+e)/2;
		init(s, m, 2*p);
		init(m + 1, e, 2*p+1);
		tree[p] = max(tree[2*p], tree[2*p+1]);
	}
	void add(int s, int e, int ps, int pe, int p, int v){
		if(e < ps || pe < s) return;
		if(s <= ps && pe <= e){
			tree[p] += v;
			lazy[p] += v;
			return;
		}
		int pm = (ps + pe) / 2;
		lazydown(p);
		add(s, e, ps, pm, 2*p, v);
		add(s, e, pm+1, pe, 2*p+1, v);
		tree[p] = max(tree[2*p], tree[2*p+1]);
	}
}seg;

int main(){
	scanf("%d %d",&n,&m);
	for(int i=0; i<n; i++){
		scanf("%d %d",&a[i].first,&a[i].second);
	}
	sort(a, a + n);
	seg.init(1, m + 1, 1);
	int mtch = 0;
	for(int i=0; i<n; i++){
		seg.add(1, a[i].second, 1, m + 1, 1, 1);
		if(seg.tree[1] > m + 1 + a[i].first){
			seg.add(1, a[i].second, 1, m + 1, 1, -1);
		}
		else{
			mtch++;
		}
	}
	mtch = min(mtch, m);
	cout << n - mtch << endl;
}


Measured memory_bytes: 5888
#coding: utf-8

def str_comp(s,t)
  if s == t then
    return true
  else
    return false
  end
end


def str_count( n , s , t)
  for i in 0..n do
    if str_comp( s[i, n - i], t[0,n - i]) then
      return n - i
    end
  end

  return 0
end


N = STDIN.gets.to_i
s = STDIN.gets
t = STDIN.gets

p 2 * N - str_count(N,s,t)


Measured memory_bytes: 1788
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		while(scan.hasNext()){
			int n = Integer.parseInt(scan.nextLine());
			String str = scan.nextLine();
			char[] cs =new char[n];
			cs=str.toCharArray();
			StringBuilder stb =new StringBuilder();
			stb.append(cs[0]);
			for(int i=1;i<cs.length;i++){
				if(cs[i]==stb.charAt(stb.length()-1))
					continue;
				else
					stb.append(cs[i]);
			}
			System.out.println(stb.length());
		}
	}
}


Measured memory_bytes: 27244
n,m,k=map(int,input().split())
a=[int(i) for i in input().split()]
b=[int(i) for i in input().split()]
ans=chk=0
w=-1
for i in range(n):
    if k>=a[i]:
        chk+=1
        k-=a[i]
        w=i
        ans=max(ans,chk)
    else:
        break

for i in range(m):
    if k<b[i]:
        while w>=0:
            if k>=b[i]: break
            k+=a[w]
            chk-=1
            w-=1
    if k>=b[i]:
        chk+=1
        k-=b[i]
        ans=max(ans,chk)
    else:
        break
print(ans)

Measured memory_bytes: 118068
import java.util.Scanner;

public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    String ss;
    char ac,bc;
    ss = sc.next();
    ac = ss.charAt(0);
    ss = sc.next();
    bc = ss.charAt(0);
    
    int a = ac - '0';
    int b = bc - '0';
    int s = b;
    char wakame = ac;
    if(a>b){
      s = a; wakame = bc;
    }
    
    for(int i=0; i<s; ++i){
      System.out.print(wakame);
    }
  }
}

Measured memory_bytes: 21844
#include <bits/stdc++.h>
//#include <ext/numeric>
#include <ext/pb_ds/assoc_container.hpp> // Common file
#include <ext/pb_ds/tree_policy.hpp> // Including tree_order_statistics_node_update
#define oo 0x3f3f3f3f
#define OO 0x3f3f3f3f3f3f3f3f
#define popcount(n) __builtin_popcount(n)
#define popcountll(n) __builtin_popcountll(n)

using namespace std;
//using namespace __gnu_cxx;
using namespace __gnu_pbds;
template<typename T>
using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;

const double PI = acos(-1.0), EPS = 1e-6;
const long long inf = 2e12 + 12;
const int MAXN = 1000006, MAXM = 1003, Mod = 1000000007 , MAXLog = 20;

int main() {
#ifndef ONLINE_JUDGE
//    freopen("input.txt", "rt", stdin);
//    freopen("output.txt", "w", stdout);
#endif
    ios::sync_with_stdio(false), cin.tie(0), cout.tie(0), cout.precision(4), cout << fixed;

    int x, a;
    cin >> x >> a;
    if (x < a) {
        cout << 0 << '\n';
    } else {
        cout << 10 << '\n';
    }


    return 0;
}

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

#define SORT(v, n) sort(v, v+n);
#define VSORT(v) sort(v.begin(), v.end());
#define llong long long
#define pb(a) push_back(a)
#define INF 999999999

using namespace std;
typedef pair<int, int> P;
typedef pair<llong, llong> LP;
typedef pair<int, P> PP;
typedef pair<llong, LP> LPP;

int iy[]={0, 0, 1, -1};
int ix[]={1, -1, 0, 0};

int n, m;
int a[101], fl, sum, b[10];

int main(){
	cin >> n;
	for(int i=0;i<n;i++){
		cin >> a[i];
		if(a[i]>3199){
			fl++;
		}else{
			b[a[i]/400]=1;
		}
	}
	for(int i=0;i<9;i++){
		if(b[i]==1){
			sum++;
		}
	}
	if(sum!=0){
		cout << sum << ' ';
	}else{
		cout << 1 << ' ';
	}
	cout << sum+fl <<endl;

	return 0;
}

Measured memory_bytes: 256
//参考：http://ehafib.hatenablog.com/entry/2015/12/23/164517
//インクルード
#include<algorithm>//sort,二分探索,など
#include<bitset>//固定長bit集合
#include<cmath>//pow,logなど
#include<complex>//複素数
#include<deque>//両端アクセスのキュー
#include<functional>//sortのgreater
#include<iomanip>//setprecision(浮動小数点の出力の誤差)
#include<iostream>//入出力
#include<map>//map(辞書)
#include<numeric>//iota(整数列の生成),gcdとlcm(c++17)
#include<queue>//キュー
#include<set>//集合
#include<stack>//スタック
#include<string>//文字列
#include<unordered_map>//イテレータあるけど順序保持しないmap
#include<unordered_set>//イテレータあるけど順序保持しないset
#include<utility>//pair
#include<vector>//可変長配列

using namespace std;
typedef long long ll;

//マクロ
#define REP(i,n) for(ll i=0;i<(ll)(n);i++)
#define REPD(i,n) for(ll i=(ll)(n)-1;i>=0;i--)
#define FOR(i,a,b) for(ll i=(a);i<=(b);i++)
#define FORD(i,a,b) for(ll i=(a);i>=(b);i--)
#define ALL(x) (x).begin(),(x).end() //sortなどの引数を省略したい
#define SIZE(x) ((ll)(x).size()) //sizeをsize_tからllに直しておく
#define MAX(x) *max_element(ALL(x))
#define INF 1000000000000
#define MOD 10000007
#define PB push_back
#define MP make_pair
#define F first
#define S second

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

  ll n, m;
	cin >> n >> m;
  ll a[n];
  ll count = 0;
  ll sum = 0;
  FOR(i, 0, n-1) {
    ll at;
    cin >> at;
    a[i] = at;
    sum += at;
  }
  // ll border = sum/(4*m);
  FOR(i, 0, n-1) {
    if (a[i]*4*m >= sum) {
      count++;
    }
  }
  if (count >= m) {
    cout << "Yes" << "\n";
  } else {
    cout << "No" << "\n";
  }
}


Measured memory_bytes: 256
import java.util.*;
import java.lang.*;

public class Main{
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int x = sc.nextInt();
		long n = 0;
		for (int i = 0; i <= x; i++) {
			n++;
			n *= 2;
		}
		System.out.println(n);
	}
}

Measured memory_bytes: 21972
#include <iostream>
#include <algorithm>

int main()
{
	int N;
	std::cin >> N;
	int a[100];
	for (int i=0; i<N; i++) std::cin >> a[i];
	std::sort(a, a+N, std::greater<int>());
	int res = 0;
	for (int i=0; i<N; i+=2) res += a[i];
	for (int i=1; i<N; i+=2) res -= a[i];
	std::cout << res << std::endl;
	return 0;
}


Measured memory_bytes: 3596
let solve c n m =
  let dp = Array.make_matrix (m + 1) (n + 1) max_int in
  for i = 1 to m do dp.(i).(0) <- 0 done;
  for i = 1 to m do
    for j = 1 to n do
      dp.(i).(j) <-
        if j - c.(i-1) < 0 then dp.(i-1).(j)
        else min dp.(i-1).(j) (dp.(i).(j - c.(i-1)) + 1)
    done
  done;
  dp.(m).(n)

let () =
  let n, m = Scanf.scanf "%d %d " (fun n m -> n, m) in
  let c = Array.init m (fun _ -> Scanf.scanf "%d " (fun i -> i)) in
  solve c n m |> Printf.printf "%d\n"

Measured memory_bytes: 10776
N, M = map(int, input().split())
L = [0 for i in range(M)]
R = [0 for i in range(M)]
for i in range(M):
    L[i], R[i] = map(int,input().split())
maxL = max(L)
minR = min(R)
ans = max(minR-maxL+1, 0)
print(ans)

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

using namespace std;

#define rep(i, n) for(int i = 0; i < n; i++)
#define MOD 1000000007
#define el endl
typedef long long ll;

ll l_max(ll a, ll b){
    return a < b ? b : a;
}

int main() {
    ll a,b,k;
    cin >> a >> b >> k;
    ll ans_a,ans_b;
    ans_a = l_max(0, a-k);
    if(ans_a == 0){
        k -= a;
        ans_b = l_max(0, b-k);
    }else{
        ans_b = b;
    }
    cout << ans_a << " " << ans_b << el;
}


Measured memory_bytes: 256
S = input()

# a aa c ca c a b a ab a b c
cnt = 0
prev = ''
i = 0
while i < len(S):
    if i == len(S) - 1 and S[i] == prev:
        break
    if S[i] == prev:
        cnt += 1
        prev = S[i: i + 2]
        i += 2
    else:
        cnt += 1
        prev = S[i]
        i += 1
print(cnt)


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

int main(){
	int n, coin[6] = {500,100,50,10,5,1};
	while( cin >> n , n ){
		int ans=0;
		n = 1000 - n;
		for(int i=0 ; i < 6 ; i++ ){
			while( n >= coin[i] ){
				n -= coin[i];
				ans++;
			}
		}
		cout << ans << endl;
	}
}

Measured memory_bytes: 0
#include <algorithm>
#include <cfloat>
#include <climits>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <functional>
#include <iostream>
#include <map>
#include <memory>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <utility>
#include <vector>
#include <iomanip>
using namespace std;

typedef long long ll;

#define sz size()
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define all(c) (c).begin(), (c).end()
#define rep(i,a,b) for(int i=(a);i<(b);++i)
#define per(i,a,b) for(ll i=(b-1);i>=(a);--i)
#define clr(a, b) memset((a), (b) ,sizeof(a))
#define ctos(c) string(1,c)
#define print(x) cout<<#x<<" = "<<x<<endl;

#define MOD 1000000007

int main(void) {
	int n;
	cin>>n;
	vector<int> v;
	rep(i,0,n){
		int a;
		cin>>a;
		v.pb(a);
	}
	ll mx = 0;
	rep(i,0,v.sz){
		mx += v[i]-1;
	}
	cout << mx << endl;
	return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll mod=1e9+7;
int n;
int a[601];
ll dp[2][301][301];
int f[601];
int r[601];
bool one[601];
bool sk[601];
ll inv[601];
ll pw(ll x,ll y){
	if(y==0) return 1;
	if(y%2) return x*pw(x,y-1)%mod;
	ll res=pw(x,y/2);
	return res*res%mod;
}
int main(){
	ios::sync_with_stdio(false);
	cin >> n;
	for(int i=1; i<=2*n ;i++){
		cin >> a[i];
		if(a[i]!=-1) f[a[i]]=true;
	}
	for(int i=1; i<=2*n ;i++){
		if(f[i]) r[0]++;
		else r[i]++;
	}
	for(int i=1; i<=2*n ;i++){
		r[i]+=r[i-1];
		inv[i]=pw(i,mod-2);
	}
	int cnt=0;
	for(int i=1; i<=2*n ;i+=2){
		if(a[i]==-1 && a[i+1]==-1) continue;
		if(a[i]!=-1 && a[i+1]!=-1) continue;
		if(a[i]!=-1) one[a[i]]=true;
		if(a[i+1]!=-1) one[a[i+1]]=true;
		cnt++;
	}
	dp[0][0][0]=1;
	for(int i=1; i<=2*n ;i++){
		int c=i&1;int p=c^1;
		for(int j=0; j<=n ;j++){
			for(int k=0; k<=n ;k++) dp[c][j][k]=0;
		}
		if(f[i] && !one[i]){
			for(int j=0; j<=n ;j++){
				for(int k=0; k<=n ;k++) dp[c][j][k]=dp[p][j][k];
			}
		}
		else if(!f[i]){
			for(int j=0; j<=n ;j++){
				for(int k=0; k<=n ;k++){
					if(dp[p][j][k]==0) continue;
					int p1=(cnt-j)+k;
					int p2=(r[i-1]-p1)/2;
					int p0=n-p1-p2;
					{//puts on -1 -1
						if(p0>0) dp[c][j][k+1]=(dp[c][j][k+1]+dp[p][j][k]*p0)%mod;
					}
					{//puts on j
						if(cnt-j>0) dp[c][j+1][k]=(dp[c][j+1][k]+dp[p][j][k]*(cnt-j))%mod;
					}
					{//puts on k
						if(k>0) dp[c][j][k-1]=(dp[c][j][k-1]+dp[p][j][k])%mod;
					}
				}
			}
		}
		else{
			for(int j=0; j<=n ;j++){
				for(int k=0; k<=n ;k++){
					if(dp[p][j][k]==0) continue;
					int p1=(cnt-j)+k;
					int p2=(r[i-1]-p1)/2;
					int p0=n-p1-p2;
					ll w1=dp[p][j][k]*inv[cnt]%mod*j%mod;
					ll w2=dp[p][j][k]*inv[cnt]%mod*(cnt-j)%mod;
					if(w1) dp[c][j-1][k]=(dp[c][j-1][k]+w1)%mod;
					if(w2) dp[c][j][k+1]=(dp[c][j][k+1]+w2)%mod;
				}
			}
			cnt--;
		}
	}
	cout << dp[0][0][0] << '\n';
}

Measured memory_bytes: 1664
#include <iostream>
#include <string>
#include <vector>
#include <list>
#include <queue>
#include <map>
#include <set>
#include <algorithm>
#include <numeric>
#include <cmath>

using namespace std;
typedef long long ll;


int main(int argc, const char * argv[]) {
    ll N; cin >> N;
    ll m = (ll)sqrt(N);
    for (ll i = m; i >= 1; i--) {
        if (N % i == 0) {
            cout << i + (N / i) - 2 << endl;
            break;
        }
    }
    return 0;
}

Measured memory_bytes: 384
using System;

namespace B___Resistors_in_Parallel
{
    class Program
    {
        static void Main(string[] args)
        {
            var n = int.Parse(Console.ReadLine());
            var a = 0.0;
            var input = (Console.ReadLine().Split(' '));
            for (var i = 0; i < n; i++)
            {
                a += 1 / double.Parse(input[i]);
            }
            Console.WriteLine(1 / a);
        }
    }
}

Measured memory_bytes: 11092
//*/

#include <cstdio>
#include <cstring>
#include <cmath>
#include <climits>
#include <algorithm>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <string>
#include <cctype>
#include <complex>

#define N 505

using namespace std;

typedef long long int lld;

bool partis[N*N];
int shortest[N * N];
int edges[N * N][4];

void make_graph(int n) {
	int origin = n * n;
	shortest[origin] = 0;
	for (int i = 0; i < n; i++) {
		for (int j = 0; j < n; j++) {
			int min_x = min(j, n - 1 - j);
			int min_y = min(i, n - 1 - i);
			int pos = i * n + j;
			shortest[pos] = min(min_x, min_y);
			fill_n(&edges[pos][0], 4, origin);
			if (i > 0) {
				edges[pos][0] = pos - n;
			}
			if (i < n - 1) {
				edges[pos][1] = pos + n;
			}
			if (j > 0) {
				edges[pos][2] = pos - 1;
			}
			if (j < n - 1) {
				edges[pos][3] = pos + 1;
			}
		}
	}
}

void update(int node, int poids) {
	if (!partis[node]) {
		poids++;
	}
	for (int i = 0; i < 4; i++) {
		int other = edges[node][i];
		if (shortest[other] > poids) {
			shortest[other] = poids;
			update(other, poids);
		}
	}
}

int main() {
#ifdef LOCAL
	freopen("in.txt", "r", stdin);
	freopen("out.txt", "w", stdout);
#endif
	int n;
	scanf("%d", &n);
	make_graph(n);
	int total = 0;
	for (int i = 0; i < n * n; i++) {
		int pos;
		scanf("%d", &pos);
		pos--;
		total += shortest[pos];
		partis[pos] = true;
		update(pos, shortest[pos]);
	}
	printf("%d\n", total);
	return 0;
}

//*/ 

Measured memory_bytes: 18244
#include<bits/stdc++.h>
using namespace std;
int main(){
    while(1){
    int n;
    cin >> n;
    if(n==0)break;
    vector<double>s(n);
    double m=0;
    for(int i=0;i<n;i++){
        cin >> s[i];
        m+=s[i];
    }
    double heikin =m/n;
    double bunsan= 0;
    for(int i=0;i<n;i++){
        bunsan +=pow(s[i]-heikin,2);
    }
    bunsan/=n;
    double hyoujun =sqrt(bunsan);
    cout << fixed << setprecision(8) << hyoujun << endl;
    
    }
}



Measured memory_bytes: 3288
import java.util.Scanner;
class Main{
    public static void main(String arg[]){
        Scanner scn=new Scanner(System.in);
        int a = scn.nextInt();
        int b = scn.nextInt();
        int differ = b-a;
        int aLength = 0;
        for(int i=1;i<differ;i++){
            aLength+=i;
        }
        System.out.println(aLength-a);
    }
}


Measured memory_bytes: 21844
import sys

# import re
import math
import collections
# import decimal
import bisect
import itertools
import fractions
# import functools
import copy
import heapq
import decimal
# import statistics
import queue
# import numpy as np

# sys.setrecursionlimit(10000001)
INF = 10 ** 16
# MOD = 10 ** 9 + 7
MOD = 998244353


def ni(): return int(sys.stdin.readline())
def ns(): return map(int, sys.stdin.readline().split())
def na(): return list(map(int, sys.stdin.readline().split()))


# ===CODE===

class ModCombination:
    # https://atcoder.jp/contests/abc167/submissions/13058694
    # https://ikatakos.com/pot/programming_algorithm/number_theory/mod_combination

    def __init__(self, maxN, MOD):
        self._maxN = maxN
        self._MOD = MOD
        self.facts = [1]
        self.invs = [1]*(self._maxN+1)

        fact = 1
        for i in range(1, self._maxN+1):
            fact *= i
            fact %= self._MOD
            self.facts.append(fact)

        inv = pow(fact, self._MOD-2, self._MOD)
        self.invs[self._maxN] = inv
        for i in range(self._maxN, 1, -1):
            inv *= i
            inv %= self._MOD
            self.invs[i-1] = inv

    def nCr(self, n, r):
        return self.facts[n]*self.invs[r]*self.invs[n-r] % self._MOD


def main():

    n, m, k = ns()

    mc = ModCombination(n, MOD)

    result = 0

    for ki in range(k + 1):
        ans = 1
        ans *= m % MOD
        ans *= pow(m - 1, n - 1 - ki, MOD)
        ans %= MOD
        ans *= mc.nCr(n-1, ki)
        ans %= MOD
        result += ans
        result %= MOD

    print(result)


if __name__ == '__main__':
    main()


Measured memory_bytes: 26328
#include<stdio.h>
#include<stdlib.h>
#include<math.h>
#include<string.h>
#include<stdbool.h>
#include<assert.h>
typedef long long ll;
typedef long double ld;
#define rep(i,l,r)for(ll i=(l);i<(r);i++)
#define repp(i,l,r,k)for(ll i=(l);i<(r);i+=(k))
#define rrep(i,l,r)for(ll i=(l);i>=(r);i--)
#define INF (1LL<<60)
#define MOD1 1000000007
#define MOD2 998244353
#define MAX_N (1 << 17)
#define YES printf("Yes\n")
#define NO printf("No\n")
#define PN printf("\n")
#define charsize 100005 //10^5+5

void swap(ll *a, ll *b){ll c;c=*b;*b=*a;*a= c;}
ll max2(ll a,ll b){return a>=b?a:b;}
ll min2(ll a,ll b){return a>=b?b:a;}
ll min3(ll a, ll b, ll c){return (a<=b && a<=c) ? a : b<=c ? b : c;}
ll max3(ll a, ll b, ll c){return (a>=b && a>=c) ? a : b>=c ? b : c;}
ll minn(ll n, ll a[n]){ll b=INF;rep(i,0,n) b=min2(b,a[i]);return b;}
ll maxn(ll n, ll a[n]){ll b=-INF;rep(i,0,n) b=max2(b,a[i]);return b;}
ll ABS(ll a){return a>=0?a:(-a);}
ll POW(ll a, ll b){ll c=1;rep(i,0,b) c*=a;return c;}
ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}
ll lcm(ll a,ll b){return a/gcd(a,b)*b;}
ll mod_MOD1(ll n){n+= n<0?((-n)/MOD1+1)*MOD1:0; return n%=MOD1;}
ll mod_p(ll n ,ll p){n+= n<0?((-n)/p+1)*p:0; return n%=p;}
ll change_into_num(char s[] , ll len, ll p){ return !p ? 0 : POW(10,p-1)*(s[len-p]-'0') + change_into_num(s,len,p-1); }

int upll(const void*a, const void*b){return*(ll*)a<*(ll*)b?-1:*(ll*)a>*(ll*)b?1:0;}
int downll(const void*a, const void*b){return*(ll*)a<*(ll*)b?1:*(ll*)a>*(ll*)b?-1:0;}
void sortup(ll*a,int n){qsort(a,n,sizeof(ll),upll);}
void sortdown(ll*a,int n){qsort(a,n,sizeof(ll),downll);}

typedef struct{ ll a , b;}fr;
int cmp1( const void *p, const void *q ) { return ((fr*)p) ->a - ((fr*)q)->a;}
int cmp2( const void *p, const void *q ) { return ((fr*)q) ->a - ((fr*)p)->a;}
void strsortup(fr*a,int n){qsort(a,n,sizeof(fr),cmp1);}
void strsortdown(fr*a,int n){qsort(a,n,sizeof(fr),cmp2);}

int main(void){
    // char ;
    ll n;
    // ll ans=0;
    scanf("%lld",&n);
    if(n==1){
        printf("1\n");
        return 0;
    }
    ll out=0,mark=1;
    rep(i,1,n+1){
        if( i*(i+1)/2>n ){
           out =  i*(i+1)/2 - n;
           mark=i;
           break;
        }
    }
    rep(i,1,mark+1){
        if(i!=out){
            printf("%lld\n",i);
        }
    }

    
    // printf("%lld\n");
    return 0;
}


Measured memory_bytes: 128
#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
int main()
{
	ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    ll n, k;
    cin >> n>>k;
    ll a[n];
    for (int i = 0; i < n; ++i)
    {
    	cin >> a[i];
    }
    ll dp[n];
    for (int i = 0; i < n; ++i)
    {
    	dp[i]=1e17;
    }
    dp[n-1]=0;
    for (int i = 2; i <=k+1; ++i)
    {
	    dp[n-i]=abs(a[n-1]-a[n-i]);
    }
    for(int i=n-k-2; i>=0; i--)
    {
    	for (int j = 1; j <=k; ++j)
    	{
	    	dp[i]=min(dp[i], abs(a[i]-a[i+j])+dp[i+j]);
    	}
    }
    cout << dp[0];
    return 0;
}

Measured memory_bytes: 1792
#include <stdio.h>
#include <stdlib.h>

int size=1; char *a;

int multiply(int m){
	int carry=0, i=0;

	while(carry>0 || size>i){
		if(i==size) a=realloc(a,++size), a[i]=0;
		carry=a[i]*m+carry;
		a[i]=carry%10, carry/=10;
		i++;
	}
}

int main(void){
	int n, i;
	a=malloc(sizeof(int)); a[0]=1;
	scanf("%d",&n);
	for(i=1;i<=n;i++) multiply(i);
	for(i=size-1; i>=0; i--) printf("%d",a[i]); printf("\n");
	return 0;
}

Measured memory_bytes: 0
#include <bits/stdc++.h>
#define rep(i, start, end) for (long long i = start; i < end; ++i)
#define all(x) (x).begin(), (x).end()
#define len(x) ((long long)(x).size())
#define g(a, b) __gcd((a), (b))
#define l(a, b) ((a) / __gcd((a), (b)) * (b))
using namespace std;
using ll = long long;
using ld = long double;
using vll = vector<ll>;
using vllvll = vector<vll>;
template<class T>void print1d(T x,ll n=-1){if(n==-1)n=x.size();rep(i,0,n){cout<<x[i]<<' ';}cout<<'\n';}
template<class T>void print2d(T x,ll r=-1,ll c=-1){if(r==-1)r=x.size();if(c==-1)c=x[0].size();rep(i,0,r)print1d(x[i],c);}
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<class T, class U>T rem(T a, U b) { return a - b*floor(a/b); }
template<class T>ld deg2rad(T deg) { return M_PI * deg / 180.0; }
template<class T>ld rad2deg(T rad) { return 180.0 * rad / M_PI; }
const long double pi = M_PI;
const long long big = 1LL << 50;
const long long inf = 1LL << 60;
const long long mod = 1e9 + 7;



int main()
{
    ll H1, M1, H2, M2, K;
    cin >> H1 >> M1 >> H2 >> M2 >> K;
    ll x = 60*(H2-H1) + (M2-M1);
    ll ans = x - K;
    cout << ans << endl;
}

Measured memory_bytes: 3636
S, T = $<.read.split

firstOccurrenceInS = [nil]*('z'.ord-'a'.ord+1)
firstOccurrenceInT = [nil]*('z'.ord-'a'.ord+1)
puts S.size.times.all?{|i|
	s, t = S[i], T[i]
	foS, foT = (firstOccurrenceInS[s.ord]||=i), (firstOccurrenceInT[t.ord]||=i)
	foS == foT
} ? 'Yes' : 'No'


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

int main() {
  long long a, b, c, ans;
  cin >> a >> b >> c;
  if(a%2==0 or b%2==0 or c%2==0) ans = 0;
  else ans = min({a*b, b*c, c*a});
  cout << ans << "\n";
}

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

#define MAX 100005

long long A[MAX], B[MAX], C[MAX], D[MAX], s[MAX];

int main() {
    int N;
    long long a;
    scanf("%d", &N);
    A[0] = B[0] = C[0] = D[0] = 0ll;
    for (int i = 1; i <= N; i++) {
        scanf("%lld", &a);
        A[i] = a;
        B[i] = a;
    }

    sort(B, B+N+1);
    int j = 0;
    int k = 0;
    for (int i = 1; i <= N; i++) {
        if (j < B[i]) {
            j = B[i];
            k++;
            C[k] = 0;
            D[k] = j;
        }
        C[k]++;
    }

    for (int i = 1; i <= N; i++) {
        C[i] += C[i-1];
    }

    int t = 0;
    int w = 0;
    for (int i = 1; i <= N; i++) {
        long long u = 0;
        while (t < A[i]) {
            t++;
            while (t > D[w]) w++;  
            u += C[N] - C[w-1];
        }
        s[i] = u;
    }

    for (int i = 1; i <= N; i++) {
        printf("%lld\n", s[i]);
    }

    return 0;
}

Measured memory_bytes: 4992
#include<iostream>
#include<algorithm>
#include<cmath>
#include<vector>
#include<map>
#include<set>
#include<string>
#include<queue>
#include<stack>
#include<iomanip>
#include<sstream>

#define fast_io ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);

using namespace std;

#define deb(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) { cout << '\n';}
template<typename T, typename... Args>
void err(istream_iterator<string> it, T a, Args... args) {
    cout << '[' << *it << " = " << a << "]  ";
    err(++it, args...);
}

#define fcout cout<<fixed<<setprecision(15)
#define repp(i,j,k) for(int i=j; i<k; ++i)
#define rep(i,j) repp(i,0,j)
#define rrep(i,j,k) for(int i=j; i>=k; --i)
#define all(x) (x).begin(), (x).end()
#define sort(x) sort(x.begin(), x.end())
#define lb(x,val) lower_bound(x.begin(), x.end(), val)
#define ub(x,val) upper_bound(x.begin(), x.end(), val)
#define pb(x) emplace_back(x);

typedef long long int lli;
typedef pair<int,int> pii;
typedef pair<lli,lli> pll;
typedef vector<int> vi;
typedef vector<lli> vl;
typedef tuple<lli, lli> tii;
typedef tuple<lli, lli, lli> tiii;

//const lli M=998244353ll;
const lli M=1000000007ll;
const double D=1.0;


void solve(){
	lli n; cin>>n;
	lli s=0;
	repp(i,1,n+1){
		if(i%3!=0 and i%5!=0) s+=i;	
	}
	cout<<s;

}

int main(){
	fast_io
	int tc=1;
	//cin>>tc;
	while(tc--){solve();}
	return 0;
}

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

int main(){
    int N;
    // vector<int64_t> vp;
    int64_t vp[100010];
    string res;
    int64_t vp_xor = 0ll;


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

    res = "Yes";
    while (vp_xor > 0) {
        if (vp_xor % 2 == 1) res = "No";
        vp_xor >>= 1;
    }

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


Measured memory_bytes: 1024
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using str = string;
typedef vector<string> vs;
typedef vector<bool> vb;
typedef vector<char> vc;
typedef vector<ll> vll;
typedef vector<vll> vvll;
typedef vector<vs> vvs;
typedef vector<vc> vvc;
typedef vector<vb> vvb;
using P = pair<ll,ll>;
#define REP(i, n) for (ll i = 0; i < (int)(n); i++)
#define RREP(i, n) for (ll i = (int)(n)-1; i > -1 ; i--)
#define IN(T, x) T x;cin >> x;
#define AIN(T, a, n) vector<T> a(n);REP(i, n){cin >> a[i];}
#define A2IN(T1, a, T2, b, n) vector<T1> a(n);vector<T2> b(n);REP(i, n){cin >> a[i] >> b[i];}
#define ALL(a) (a).begin(),(a).end()
#define SORT(a) sort(ALL(a))
#define RSORT(a) SORT(a);reverse(ALL(a))
#define pb push_back
#define mp make_pair
#define PF first
#define PS second
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 A, size_t N, typename T>void Fill(A (&array)[N], const T &val){fill( (T*)array, (T*)(array+N), val );}
#define OUT(x) cout << x << endl;
#define OUTD(x) cout << fixed << x << endl;
#define BOUT(b) if(b){OUT("Yes");}else{OUT("No");}
const ll MOD = 1000000007;
const ll INF = 10e9;
#define PI 3.14159265369;
ll dx[4] = {1,-1,0,0};
ll dy[4] = {0,0,1,-1};
ll ddx[8] = {1,1,1,-1,-1,-1,0,0};
ll ddy[8] = {0,1,-1,0,1,-1,1,-1};

ll dp[1001][1001];

int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  
  IN(ll,A);
  IN(ll,B);
  if((A+B)%2){
    OUT("IMPOSSIBLE");
  }
  else{
    OUT((A+B)/2);
  }
}



Measured memory_bytes: 256
#include <bits/stdc++.h>
    using namespace std;
     
    int main() {
      int num, Max;
      int count = 0;
      cin >> num >> Max;
      for (int i = 0; i <= num; i++) {
       for (int j = 0; j <= num; j++) {
         if (i + j >= Max-num && i + j <=Max) {
          count++; 
         
        }
       }
      }
      cout << count << endl;
      return 0;  
    }

Measured memory_bytes: 256
cards = {
        'S': [0 for _ in range(13)],
        'H': [0 for _ in range(13)],
        'C': [0 for _ in range(13)],
        'D': [0 for _ in range(13)],
}
n = int(input())
for _ in range(n):
    (s, r) = input().split()
    cards[s][int(r) - 1] = 1
 
for s in ('S', 'H', 'C', 'D'):
    for r in range(13):
        if cards[s][r] == 0:
            print(s, r + 1)

Measured memory_bytes: 6724
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<n;i++)

using namespace std;
typedef long long ll;
typedef unsigned long ul;
typedef pair<ul, ul> P;

const int INF = 1e9;
const int MOD =1e9+7;
const ll LINF = 1e18;

int main(){
    int L, R;
    cin >> L >> R;

    int a = R - L;
    int min = INF;
    for(int i = 0; i < 2019; i++){
        for(int j = i + 1; j < 2019 && j <= a; j++){
            int m = ((ul)(L + i) * (ul)(L + j)) % 2019;
            if(m < min){
                min = m;
                if(min == 0) {
                    i += 2019;
                    j += 2019;
                }
            }
        }
    }
    cout << min << endl;
} 

Measured memory_bytes: 256
using namespace std;
#define _CRT_SECURE_NO_WARNINGS
#pragma target("avx")
#pragma optimize("O3")
#pragma optimize("unroll-loops")
#include<iostream>
#include<algorithm>
#include<ctime>
#include<vector>
#include<string>
#include<cmath>
#include<map>
#include<iomanip>
#include<numeric>
#include<queue>
#include<deque>
#include<cfloat>
#include<functional>
#include<tuple>
#include<math.h>
#include<bitset>
#include<stack>
#include<set>
#include<random>
#include<stdlib.h>
#define rip(i,n) for(ll i=0;i<n;i++)
#define Rip(i,n) for(ll i=1;i<n;i++)
#define all(V) V.begin(),V.end()
#define ll long long
#define ld long double
#define MOD 1000000007
#define mod MOD
#define sec setprecision
constexpr double eps = 1e-9;
constexpr double PI = 3.141592653589793238462643383279;
ll gcd(ll a, ll b) {
	if (a % b == 0)	return(b);
	else return(gcd(b, a % b));
}
ll lcm(ll a, ll b)
{
	return a * b / gcd(a, b);
}
const int MAX = 510000;
long long fac[MAX], finv[MAX], inv[MAX];
void cominit() {
	fac[0] = fac[1] = 1;
	finv[0] = finv[1] = 1;
	inv[1] = 1;
	for (ll i = 2; i < MAX; i++) {
		fac[i] = fac[i - 1] * i % MOD;
		inv[i] = MOD - inv[MOD % i] * (MOD / i) % MOD;
		finv[i] = finv[i - 1] * inv[i] % MOD;
	}
}
vector<ll> soinnsuubunnkai(ll n) {
	vector<ll>a;
	while (n % 2 == 0) {
		a.push_back(2);
		n /= 2;
	}
	ll f = 3;
	while (f * f <= n) {
		if (n % f == 0) {
			a.push_back(f);
			n /= f;
		}
		else f += 2;
	}
	if (n != 1)
		a.push_back(n);
	return(a);
}
long long com(ll n, ll k) {
	if (n < k) return 0;
	if (n < 0 || k < 0) return 0;
	return fac[n] * (finv[k] * finv[n - k] % mod) % mod;
}
ll pow(ll a, ll b) {
	a = a % mod;
	if (b == 0)return(1);
	else if (b % 2 == 0)return(pow((a * a) % mod, b / 2));
	else return(a * (pow(a, b - 1)));
}
void solve() {
}
int main() {
	int a, b, c, d, e;
	cin >> a >> b >> c >> d >> e;
	cout << 15 - a - b - c - d - e << endl;
}

Measured memory_bytes: 3632
solve c
  | c == 'a' = "vowel"
  | c == 'i' = "vowel"
  | c == 'u' = "vowel"
  | c == 'e' = "vowel"
  | c == 'o' = "vowel"
  | otherwise = "consonant"

main = do
  c <- getChar
  putStrLn $ solve c


Measured memory_bytes: 380
#include<iostream>
#include<string>
#include<vector>
#include<cmath>
#include<cstring>
#include<cctype>

using namespace std;

#define M 256
const double infty = 1e40;

bool eq(double a, double b){
  return abs(b-a) < 1e-9;
}

int main()
{
  while(true){
    int n;
    cin >> n;
    if( n == 0 ) break;
    vector<int> I;
    for(int i = 0; i < n; ++i){
      int t;
      cin >> t;
      I.push_back(t);
    }
    
    double minH = infty;
    pair<int,pair<int,int> > SAC;
    for(int S = 0; S <= 15; ++S){
      for(int A = 0; A <= 15; ++A){
	for(int C = 0; C <= 15; ++C){
	  int cnt[M];
	  vector<int> O;
	  vector<int> R;

	  for(int i = 0; i < M; ++i){
	    cnt[i] = 0;
	  }

	  for(int i = 0; i < n; ++i){
	    R.push_back( (A* (i-1<0?S:R[i-1])+C) % M );
	    O.push_back( (I[i]+R[i]) % M );
	    cnt[O[i]]++;
	  }
	  bool ng = false;
	  for(int i = 0; i < (int)O.size(); ++i){
	    if(!isupper(O[i])&&!islower(O[i]))ng=true;
	  }
	  //if(ng)continue;
	  
	  double H = 0;
	  for(int i = 0; i < M; ++i){
	    if( cnt[i] > 0 ){
	      double tl = (cnt[i]/(double)n) * log(cnt[i]/(double)n);
	      H += tl;
	    }
	  }
	  H = -H;
	  
	  /*
	  cout << S << ' ' << A << ' ' << C << ' ' << occ << ' ' << len << " : " << H << endl;
	  
	  for(int i = 0; i < (int)O.size(); ++i){
	    cout << O[i] << ' ';
	  }
	  cout << endl;
	  */
	  
	  if( eq(minH, H) ){
	    SAC = min(SAC,make_pair(S,make_pair(A,C)));
	    //cout << S << ' ' << A << ' ' << C << " : " << H << endl;
	  }else if( minH > H ){
	    minH = H;
	    SAC = make_pair(S,make_pair(A,C));
	    //cout << S << ' ' << A << ' ' << C << " : " << H << endl;
	  }
	}
      }
    }
    cout << SAC.first << ' ' << SAC.second.first << ' ' << SAC.second.second << endl;
  }
  return 0;
}

Measured memory_bytes: 928
#include <stdio.h>
#define N 100000
int n, k;
double T[N];
int check(double p){
  int i = 0, j = 0;
  double s;
  for(j=0;j<k;j++){
    s = 0.0;
    while(s+T[i] <= p){
      s += T[i];
      i++;
      if(i == n) return n;
    }
  }
  return i;
}

int solve(){
  double left = 0.0;
  double right = 100000*10000;
  double mid;
  int v;
  while(right - left > 1){
    mid = (left+right) / 2;
    v = check(mid);
    if(v >= n) right = mid;
    else left = mid;
  }
  return right;
}

int main(){
  int i;
  double ans;
  scanf("%d%d",&n,&k);
  for(i=0;i<n;i++) scanf("%lf", &T[i]);
  ans = solve();
  printf("%d\n",(int)ans);  
  return 0;
}



Measured memory_bytes: 2564
#include<iostream>
#include<stack>
#include<string>
#include<vector>
#include<algorithm>
using namespace std;


int main() {
    stack<int> S1;
    stack<pair<int, int>> S2;
    char ch;
    auto sum = 0;

    for(int i = 0; cin >> ch; i++)
    {
        if (ch == '\\') {
            S1.push(i);
        } else if (ch == '/' && S1.size() > 0) {
            auto j = S1.top();
            S1.pop();
            sum += i - j;
            auto a = i - j;
            while(S2.size() > 0 && S2.top().first > j){
                a += S2.top().second; 
                S2.pop();
            }
            S2.push(make_pair(j, a));
        }
    }
    
    vector<int> ans;
    auto total = 0;
    while(S2.size() > 0) {
        auto current_area = S2.top().second;
        ans.push_back(current_area);
        S2.pop();
    }

    reverse(ans.begin(), ans.end());
    cout << sum << endl;
    cout << ans.size();

    for (int i = 0; i < ans.size(); i++) {
        cout << " ";
        total += ans[i];
        cout << ans[i];
    }

    cout << endl;
    
    return 0;
}



Measured memory_bytes: 3212
#include <iostream>
#include <string.h>
#include <vector>

using namespace std;

#define MAX 114

vector<int> G[MAX];
int col[MAX];
bool found;

void dfs(int v)
{
    col[v] = 0;
    for(int i = 0 ; i < (int)G[v].size() ; i++){
        int to = G[v][i];
        if(col[to] == -1){
            dfs(to);
        }else if(col[to] == 0){
            found = true;            
            return;
        }
    }
    col[v] = 1;
}
    
int main()
{
    int M, N;
    cin >> M >> N;
    
    auto canGraph = [=](){
        int lb[MAX][MAX], ub[MAX][MAX];
        for(int i = 0 ; i < MAX ; i++){
            for(int j = 0 ; j < MAX ; j++){
                lb[i][j] = -1;
                ub[i][j] = 101;
            }
        }
        int K, s, t;
        string cond;
        bool possible = 1;
        for(int i = 0 ; i < M ; i++){
            cin >> K;
            for(int j = 0 ; j < K ; j++){
                cin >> s >> cond >> t;
                --s;
                if(cond == ">="){
                    lb[i][s] = max(lb[i][s], t);
                }else{
                    ub[i][s] = min(ub[i][s], t);
                }
            }
            for(int j = 0 ; j < N ; j++){
                if(lb[i][j] > ub[i][j]){
                    possible = 0;
                    break;
                }
            }
        }

        if(!possible) return false;

        auto isConnect = [=](int from, int to){
            for(int i = 0 ; i < N ; i++){
                if(ub[from][i] <= lb[to][i]){
                    return true;
                }
            }
            return false;
        };
        
        for(int from = 0 ; from < M ; from++){
            for(int to = 0 ; to < M ; to++){
                if(from == to) continue;
                if(isConnect(from, to)){
                    G[from].push_back(to);
                }
            }
        }
        found = false;
        memset(col, -1, sizeof(col));
        for(int i = 0 ; i < M ; i++){
            if(col[i] == -1){
                dfs(i);
            }
        }                                       
        return !found;
    };
    
    cout << (canGraph() ? "Yes" : "No") << endl;
    return 0;
}

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

int main() {
    string s;
    cin >> s;
    string ans = "";
    int i = 1;
    for (char c : s) {
        if (i % 2 != 0) {
            ans += c;
        }
        i++;
    }

    cout << ans << endl;
}


Measured memory_bytes: 512
#include <iostream>
#include <string>
#include <sstream>
#include <vector>
#include <algorithm>

int main()
{
    std::string w = "";
    std::cin >> w;

    std::string ww = w + '.';

    int count = 0;

    std::string t;
    while(1){
        std::cin >> t;

        if(t == "END_OF_TEXT") break;

        //to lower
        for(auto& s: t) s = tolower(s);
        
        if(t == w || t == w){
            ++count;
        }
    }

    std::cout << count << std::endl;

    return 0;
}



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

typedef long long ll;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef pair<ll,ll> pll;
typedef vector<bool> vb;
const ll oo = 0x3f3f3f3f3f3f3f3f;
const double eps = 1e-9;
#define sz(c) ll((c).size())
#define all(c) begin(c), end(c)
#define FOR(i,a,b) for (ll i = (a); i < (b); i++)
#define FORD(i,a,b) for (ll i = (b)-1; i >= (a); i--)
#define mp make_pair
#define pb push_back
#define eb emplace_back
#define xx first
#define yy second
#define TR(X) ({ if(1) cerr << "TR: " << (#X) << " = " << (X) << endl; })

int main() {
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	
	ll n; cin >> n;
	vl a(n);
	FOR(i,0,n) cin >> a[i];

	FORD(i,0,n-1) {
		if (a[i] > a[i+1]) a[i]--;
		if (a[i] > a[i+1]) {
			cout << "No" << endl;
			return 0;
		}
	}
	cout << "Yes" << endl;
}



Measured memory_bytes: 1024
import std.stdio, std.conv, std.functional, std.string;
import std.algorithm, std.array, std.container, std.range, std.typecons;
import std.numeric, std.math, std.random;
import core.bitop;

string FMT_F = "%.10f";

static string[] s_rd;
T RD(T = long)() { while(!s_rd.length) s_rd = readln.chomp.split; string res = s_rd[0]; s_rd.popFront; return res.to!T; }
string RDR()() { return readln.chomp; }
T[] ARR(T = long)(in string str, T fix = 0) { auto r = str.split.to!(T[]); r[] += fix; return r; }
size_t[] MAKE_IDX(alias less = "a < b", Range)(Range range) { auto idx = new size_t[](range.length); makeIndex!(less)(range, idx); return idx;}
size_t MIN_POS(alias less = "a < b", Range)(Range range) { auto r = minPos!(less)(range); return range.length - r.length; }

bool inside(T)(T x, T b, T e) { return x >= b && x < e; }
long lcm(long x, long y) { return x * y / gcd(x, y); }

long mod = 10^^9 + 7;
//long mod = 998244353;
//long mod = 1_000_003;
void moda(ref long x, long y) { x = (x + y) % mod; }
void mods(ref long x, long y) { x = ((x + mod) - (y % mod)) % mod; }
void modm(ref long x, long y) { x = (x * y) % mod; }

void main()
{
	auto A = RD;
	auto B = RD;
	A = A == 1 ? 14 : A;
	B = B == 1 ? 14 : B;

	writeln(A == B ? "Draw" : A < B ? "Bob" : "Alice");
	stdout.flush();
	debug readln();
}

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

int main(){
  long dp[11][1001];
  int n,s;
  dp[0][0]=1;
  for(int i=0;i<101;++i){
    for(int j=9;j>=0;--j){
      for(int k=0;k<1001-i;++k) dp[j+1][i+k]+=dp[j][k];
    }
  }
  while(cin>>n>>s&&n||s) cout<<dp[n][s]<<endl;
  return 0;
}

Measured memory_bytes: 1244
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Scanner;

public class Main {
    public static void main(String args[]) {
        Scanner scan = new Scanner(System.in);

        int n = scan.nextInt();
        int m = scan.nextInt();

        Map<Integer, Integer> map = new HashMap<>();
        for (int x = 1; x <= n; x++) {
            map.put(x, scan.nextInt());
        }

        HashSet<Integer> loserHash = new HashSet<>();
        for (int y = 0; y < m; y++) {
            int a = scan.nextInt();
            int b = scan.nextInt();

            if (map.get(a).equals(map.get(b))) {
                loserHash.add(a);
                loserHash.add(b);
            } else if (map.get(a) > map.get(b)) {
                loserHash.add(b);
            } else {
                loserHash.add(a);
            }
        }

        System.out.println(n - loserHash.size());
    }
}

Measured memory_bytes: 71504
#include <assert.h>
#include <ctype.h>
#include <errno.h>
#include <float.h>
#include <fstream>
#include <iomanip>
#include <iostream>
#include <set>
#include <queue>
#include <limits>
#include <deque>
#include <locale>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include <wchar.h>
#include <wctype.h>
#include <algorithm>
#include <bitset>
#include <map>
#include <iomanip>
#include <ios>
#include <iostream>
#include <vector>
#include <cwchar>
#include <cwctype>
#define mp make_pair
#define fs first
#define se second
#define memset(a,t) memset(a,t,sizeof(a))
#define all(v) v.begin(),v.end()
#define eprintf(...) fprintf(stderr, __VA_ARGS__),fflush(stderr)
#define MN 0LL
#define Mx 200000005
#define Mn -Mx
#define MX 20000000000000005
using namespace std;
int readint(){
	char c;
	while(c=getchar(),(c<'0'||c>'9')&&c!='-');
	bool flag=(c=='-');
	if(flag)c=getchar();
	int x=0;
	while(c>='0'&&c<='9'){
		x=x*10+c-48;
		c=getchar();
	}
	return flag?-x:x;
}
inline string tos(int x){
	string s;
	while(x) s=(char)(x%10+'0')+s,x/=10;
	return s;
}
long long a[5005],sum;
int main(){
	ios_base::sync_with_stdio(false);
	long long i,j,n,x,t,ans=0;
	cin>>n>>x;
	for(i=0;i<n;i++) cin>>a[i],sum+=a[i];
	if(sum<x){
		cout<<n<<endl;
		return 0;
	}
	sort(a,a+n);
//	reverse(a,a+n);
	for(i=0;i<n;i++){
		t=x;
		for(j=n-1;j>-1;j--){
			if(i!=j){
				if(t>a[j]) t-=a[j];
			}
		}
		if(t>a[i]) ans++;
	} 
	cout<<ans<<endl;
	return 0;
}


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

int main(){
    int w, a, b;
    cin >> w >> a >> b;
    if (b+w >= a && b <= a+w){
        cout << 0 << endl;
    }
    else if (b > a+w){
        cout << b-a-w << endl;
    }
    else{
        cout << a-b-w << endl;
    }
}

Measured memory_bytes: 256
#include <stdio.h>
#include <stdlib.h>
int main(){
  int N,i,count;
  count=0;
  scanf("%d",&N);
  int A[N+1];
  for(i=0;i<N;i++){
    scanf("%d",&A[i]);
    if(i%2==0 && A[i]%2==1) count++;
  }
  printf("%d",count);
  return 0;
}

Measured memory_bytes: 1732
#include<iostream>
#include<vector>
#include<algorithm>
#include<string>
#include<set>
#include<map>
#include<queue>
#include<cmath>
#define REP(i,a) for (int i = 0;i < (a);++i)
#define FOR(i,a,b) for (int i = (a);i < (b); ++i)
#define FORR(i,a,b) for (int i = (a);i >= (b); --i)
#define ALL(obj) (obj).begin(),(obj).end()
#define SORT(list) sort(ALL((list)));
#define MOD 1000000007
using namespace std;
using ll = long long;
int main(){
    int x,y,z;
    cin >> x >> y >> z;
    cout << z <<" " << x <<" "<< y << endl;
    return 0;
}

Measured memory_bytes: 3568