akhauriyash/Code-Regression huggingface dataset:
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;
using namespace std;
#define all(x)     		(x).begin(),(x).end()
#define ub    			upper_bound
#define lb 				lower_bound
#define ins				insert
#define int 			long long
#define endl			'\n'
#define ff              first
#define ss              second
#define ull				unsigned long long
#define pb              push_back
#define mp              make_pair
#define pii             pair<int,int>
#define vi              vector<int>
#define si 				set<int>
#define usi 			unordered_set<int>		
#define mii             map<int,int>
#define umii			unordered_map<int ,int>
#define pqb             priority_queue<int>
#define pqs             priority_queue<int,vi,greater<int> >
#define rep(i,a,n)		for(int i=a;i<n;++i)
#define repd(i,a,n)		for(int i=a;i>n;--i)
#define setbits(x)      __builtin_popcountll(x)
#define zerobits(x)      __builtin_ctzll(x)
#define Mod             1000000007
#define inf             1e18
#define ps(x,y)         fixed<<setprecision(y)<<x
#define mk(arr,n,type)  type *arr=new type[n];
#define w(x)            int x; cin>>x; while(x--)
#define deb(x)			cout<<#x <<"="<<x<<endl;
#define deb2(x,y)		cout<<#x<<"="<<x<<"  "<<#y<<"="<<y<<endl;
mt19937                 rng(chrono::steady_clock::now().time_since_epoch().count());

typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> pbds;
int Pow(int a,int b){int res=1;while(b>0){if(b&1)res*=a;a*=a;b/=2;}return res;}
int MPow(int a,int  b){int res=1;while(b>0){if(b&1)res=(res*a)%Mod;a=(a*a)%Mod;b/=2;}return res%Mod;}
int log(int x){return 64-__builtin_clzll(x)-1;}

void c_p_p()
{
	ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#ifndef ONLINE_JUDGE
	freopen("in.txt", "r", stdin);
	freopen("out.txt", "w", stdout);
#endif
}
struct Node
{
	int a,b,c,d;
	
};
bool cmp(Node A,Node B)
{
	return A.a<B.a;
}
const int Max=1e5+1;

int32_t main()
{
	c_p_p();
	string a,b;
	cin>>a>>b;
	int ans=0;
	rep(i,0,a.size())
	{
		if(a[i]!=b[i])++ans;
	}
	cout<<ans;
	return 0;
}
	

Measured memory_bytes: 3816
#include <iostream>
#include <vector>
#include <algorithm>
#include <cassert>
#include <functional>
#include <numeric>
#include <limits>
#include <iomanip>
#include <queue>
#include <cmath>
#include <math.h>
#include <string>
#include <cmath>
#include <bitset>
#include <set>
using namespace std;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
const long long INF = 1LL << 60;
using pll = pair<long long, long long>;
typedef long long ll;
#define min(a, b) ((a) < (b) ? (a) : (b))
#define FOR(i, a, n) for (ll i = (ll)a; i < (ll)n; ++i)
#define REP(i, n) FOR(i, 0, n)

string getString(char x) {
	string s(1, x);
	return s;
}

int main() {
	cin.tie(nullptr);
	ios_base::sync_with_stdio(false);
	// cout << std::fixed << std::setprecision(15);

	int A, B, C;
	int X, Y;
	cin >> A >> B >> C >> X >> Y;
	C = 2 * C;
	int big = X;
	int small = X;
	chmax(big, Y);
	chmin(small, Y);
	long long res = INF;
	for (int i = 0; i <= big; i++) {
		long long tmpRes = 0;
		tmpRes += C * i;
		int countA = X;
		int countB = Y;
		if (X - i < 0) {
			countA = 0;
		}
		else {
			countA = X - i;
		}
		if (Y - i < 0) {
			countB = 0;
		}
		else {
			countB = Y - i;
		}
		tmpRes += A * (countA);
		tmpRes += B * (countB);
		chmin(res, tmpRes);
	}

	cout << res << endl;
}


Measured memory_bytes: 888
#include <algorithm>
#include <iostream>
#include <cstdlib>
#include <cstring>
#include <cstdio>
#include <cmath>
using namespace std;

typedef long long  LL;
LL n,x,y,ans;

void work()
{
	scanf("%lld %lld",&n,&x),ans=n,y=n-x;
	while (x)
		ans+=2*x*(y/x),y%=x,swap(x,y);
	printf("%lld",ans-y);
}

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


Measured memory_bytes: 256
#define _USE_MATH_DEFINES
#include <algorithm>
#include <cstdio>
#include <functional>
#include <iostream>
#include <cfloat>
#include <climits>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <map>
#include <queue>
#include <random>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <time.h>
#include <vector>
using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> i_i;
typedef pair<ll, int> ll_i;
typedef pair<double, int> d_i;
typedef pair<ll, ll> ll_ll;
typedef pair<double, double> d_d;
struct edge { int u, v; ll w; };

int INF = INT_MAX / 2;
ll MOD = 1000000007;
ll _MOD = 1000000009;
double EPS = 1e-10;

int main() {
	double d; cin >> d;
	double ans = d * sqrt(2);
	if (d >= 1) ans = max(ans, floor(d) + 1);
	printf("%.15f\n", ans);
}

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

int main(){
    int D;
    cin >> D;
    vector<int> c(27, 0);
    vector<int> sum(27, 0);
    rep(j, 26){
        cin >> c[j+1];
        sum[j+1] = sum[j] + c[j+1];
    }

    int s[D+1][27];
    rep(i, D){
        rep(j, 26){
            cin >> s[i+1][j+1];
        }
    }

    int val;

    rep(i, D){
        val = rand()%26 + 1;
        while (c[val] < 0){
            val = (val+1)%26 + 1;
        }
        cout << val << endl;
    }

    return 0;

}


Measured memory_bytes: 3656
#include <iostream>
#include <array>
#include <algorithm>
#include <vector>
#include <set>
#include <cmath>
#include <complex>
#include <deque>
#include <iterator>
#include <numeric>
#include <map>
#include <queue>
#include <stack>
#include <string>
#include <tuple>
#include <utility>
#include <limits>
#include <iomanip>
using namespace std;

using ll=long long;
template<class T> using V = vector<T>;
template<class T, class U> using P = pair<T, U>;
using vll = V<ll>;
using vvll = V<vll>;
#define rep(i, k, n) for (ll i=k; i<(ll)n; ++i)
#define REP(i, n) rep(i, 0, n)
template<class T> inline bool chmax(T& a, T b) {if (a<b) {a=b; return true;} return false;}
template<class T> inline bool chmin(T& a, T b) {if (a>b) {a=b; return true;} return false;}

const ll MOD = 1000000007;
const ll HIGHINF = (ll)1e18;

vll dc(13, 0), ddd(25, 0);

ll dfs(ll x) {
    if (x==12) {
        ll ret=HIGHINF;
        REP(i, 24) {
            rep(j, i+1, 24) {
                if (ddd[i]&&ddd[j]) ret = min({ret, j-i, 24-j+i});
            }
        }
        return ret;
    }
    if (dc[x]==0) return dfs(x+1);
    ddd[x]++;
    ll m1 = dfs(x+1);
    ddd[x]--; ddd[24-x]++;
    ll m2 = dfs(x+1);
    ddd[24-x]--;
    return max(m1, m2);
}

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    ll n; cin >> n;
    vll d(n); REP(i, n) cin >> d[i];
    ddd[0]++;
    REP(i, n) {
        dc[d[i]]++;
        if (d[i]==0 || dc[d[i]]>2 || (d[i]==12 && dc[d[i]]>1)) {
            cout << 0 << '\n'; return 0;
        } else if (dc[d[i]]==2) {
            ddd[d[i]]++; ddd[24-d[i]]++;
        }
    }
    if (dc[12]) ddd[12]++;
    cout << dfs(1) << endl;
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define int long long
const int mod = 1e9 + 7;
const int N = 1e6 + 444;
int re() {
    int x;
    scanf("%lld", &x);
    return x;
}
int val[N];
int tot;
int ans[N];
int fir[N], nxt[N], to[N];
int siz[N];
int jie[N];
int c[N], d[N];
void addedge(int x, int y) {
    nxt[++tot] = fir[x];
    fir[x] = tot;
    to[tot] = y;
    swap(x, y);
    nxt[++tot] = fir[x];
    fir[x] = tot;
    to[tot] = y;
}
int quick(int a, int b) {
    int ha = 1;
    while (b) {
        if (b & 1)
            ha = ha * a % mod;
        b >>= 1;
        a = a * a % mod;
    }
    return ha;
}
int ni(int a) { return quick(a, mod - 2); }
int cata(int n, int m) {
    if (n < m)
        return 0;
    return c[n] * d[m] % mod * d[n - m] % mod;
}
void Dfs1(int x, int fa) {
    val[x] = 1;
    siz[x] = 1;
    for (int e = fir[x]; e; e = nxt[e]) {
        int y = to[e];
        if (y == fa)
            continue;
        Dfs1(y, x);
        siz[x] += siz[y];
        val[x] = val[x] * val[y] % mod;
    }
    val[x] = val[x] * c[siz[x] - 1] % mod;
    for (int e = fir[x]; e; e = nxt[e]) {
        int y = to[e];
        if (y == fa)
            continue;
        val[x] = val[x] * d[siz[y]] % mod;
    }
}
int n;
void Dfs2(int x, int fa, int value) {
    if (x == 1) {
        ans[x] = val[x];
        value = value * d[siz[x] - 1] % mod * val[x] % mod;
        for (int e = fir[x]; e; e = nxt[e]) {
            int y = to[e];
            Dfs2(y, x, value * c[siz[y]] % mod * (c[siz[x] - 1 - siz[y]]) % mod * ni(val[y]) % mod);
        }
    } else {
        ans[x] = val[x] * d[siz[x] - 1] % mod * d[n - siz[x]] % mod * c[n - 1] % mod * value % mod;
        value = value * val[x] % mod * d[siz[x] - 1] % mod * d[n - siz[x]] % mod;
        for (int e = fir[x]; e; e = nxt[e]) {
            int y = to[e];
            if (y == fa)
                continue;
            Dfs2(y, x, value * c[siz[y]] % mod * c[n - siz[y] - 1] % mod * ni(val[y]) % mod);
        }
    }
}
signed main() {
    n = re();
    c[0] = 1;
    for (int i = 1; i <= n; i++) c[i] = c[i - 1] * i % mod;
    d[1] = 1;
    d[0] = 1;
    for (int i = 2; i <= n; i++) d[i] = d[mod % i] * (mod - mod / i) % mod;
    for (int i = 1; i <= n; i++) d[i] = d[i - 1] * d[i] % mod;
    for (int i = 1; i < n; i++) {
        int x = re(), y = re();
        addedge(x, y);
    }
    Dfs1(1, 0);
    Dfs2(1, 0, 1);
    for (int i = 1; i <= n; i++) printf("%lld\n", ans[i]);
    return 0;
}

Measured memory_bytes: 32512
#include<iostream>

using namespace std;

int main()
{
	int N;
	int A, B;

	cin >> N;

	if (N == 1)
	{
		cout << "Hello World" << endl;
	}
	else
	{
		cin >> A;
		cin >> B;

		cout << A + B << endl;
	}
	return 0;
}

Measured memory_bytes: 256
#include <iostream>

using namespace std;

int main(){
  int A,B,C,D;
  cin >> A >> B >> C >> D;
  if( ( A%D ? A/D+1 : A/D ) < ( C%B ? C/B+1 : C/B ) ){
    cout << "No";
  }else{
    cout << "Yes\n";
  }
  
}

Measured memory_bytes: 3604
#include "bits/stdc++.h"
using namespace std;
#define sim template < class c
#define ris return * this
#define dor > debug & operator <<
#define eni(x) sim > typename \
  enable_if<sizeof dud<c>(0) x 1, debug&>::type operator<<(c i) {
sim > struct rge { c b, e; };
sim > rge<c> range(c i, c j) { return rge<c>{i, j}; }
sim > auto dud(c* x) -> decltype(cerr << *x, 0);
sim > char dud(...);
struct debug {
#ifdef LOCAL
~debug() { cerr << endl; }
eni(!=) cerr << boolalpha << i; ris; }
eni(==) ris << range(begin(i), end(i)); }
sim, class b dor(pair < b, c > d) {
  ris << "(" << d.first << ", " << d.second << ")";
}
sim dor(rge<c> d) {
  *this << "[";
  for (auto it = d.b; it != d.e; ++it)
    *this << ", " + 2 * (it == d.b) << *it;
  ris << "]";
}
#else
sim dor(const c&) { ris; }
#endif
};
#define imie(...) " [" << #__VA_ARGS__ ": " << (__VA_ARGS__) << "] "

using ll = long long;

const int INF = 1e9 + 5;

int main() {
    int n;
    scanf("%d", &n);
int k;
cin>>k;
    vector<int> h(n);
    for(int& x : h) {
        scanf("%d", &x);
    }
    vector<int> dp(n, INF);
    dp[0] = 0;
    for(int i = 0; i < n; ++i) {
        for(int j =i+1;j<=i+k;j++) {
            if(j < n) {
                dp[j] = min(dp[j], dp[i] + abs(h[i] - h[j]));
            }
        }
    }
    printf("%d\n", dp[n-1]);
}

Measured memory_bytes: 1024
require'rational'
n,m=gets.split.map(&:to_i)
a=m.times.map{gets}
if a[0].split.length>1
	a=a[0].split.map(&:to_i)
else
	a=a.map(&:to_i)
end
puts a.reduce(n.to_i){|n,e|n=n.gcd(e%n)}==1?'Yes':'No'

Measured memory_bytes: 29420
/**
 *      ///----- My Info -----///
 *      Code by: Unk
 *      Codeforces User: Ernest0_0Abreu
 *      Country: Cuba
 *      E-mail: ernestoabreup@gmail.com
 *      CopyRight
**/
#include <bits/stdc++.h>
#ifdef Ernest0_0Abreu 
#include <debug/to_string.h>
#endif
#pragma GCC optimize("Ofast")
#pragma GCC target ("avx2")
#pragma GCC optimization ("O3")
#pragma GCC optimization ("unroll-loops")
using namespace std;
    	///----- My Template -----///
///===================================================================================================================================
/// Debug
#define _end cout << "\n"
#ifndef Ernest0_0Abreu
#define db(x) ;
#define dbrange(x,begin,end) ;
#define dbname(x) ;
#define dbnamerange(x,begin,end) ;
#define dbmat(x,begin_n,end_n,begin_m,end_m) ;
#define dbST(x,end) ;
#define db_end ;
#endif
///Function
#define pi (acos(-1))
#define lg2(x) 31-__builtin_clz(x)
#define lgx(x,b) log(b)/log(x)
/// Macros
#define fst first
#define scd second
#define left (node<<1)
#define right ((node<<1)+1)
#define sz(x) (int)(x.size())
#define all(x) x.begin(),x.end()
#define rall(x) x.rbegin(),x.rend()
/// Typedef
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
/// Constant
const ll MAXN = 1e2+7;
const int MOD = 1e9+7;
const ull BASE = 311;
const ld EPS = 1e-9;
const int INF = ((1<<30)-1);
const ll INFLL = ((1ll<<62ll)-1ll);
const ll oo = 2e18;
/// Hash Prime Numbers: 2, 277, 293, 307, 331, 337, 1009, 2027;
/// Module Prime Numbers: 3,1000033, 998244353, 1000000007, 1000000009, 1000000021;
///===================================================================================================================================
#define int long long
		///----- My code -----///

int c[MAXN], ar[MAXN][MAXN], curr[MAXN];

int32_t main(){
	
	ios_base::sync_with_stdio(false);cin.tie(nullptr);cout.tie(nullptr);

	int N, M, X;
	cin >> M >> N >> X;
	for(int i = 0; i < M; ++i){
		cin >> c[i];
		for(int j = 0; j < N; ++j){
			cin >> ar[i][j];
		}
	}
	int ans = INFLL;
	for(int mask = 0; mask < (1<<M); ++mask){
		int sum = 0;
		for(int k = 0; k <= N-1; ++k)
			curr[k] = 0;

		for(int j = 0; j < M; ++j){
			if(mask&(1<<j)){
				sum += c[j];
				for(int k = 0; k <= N-1; ++k){
					curr[k] += ar[j][k];
				}
			}
		}
		bool mk = true;
		for(int k = 0; k <= N-1; ++k){
			if(curr[k] < X) mk = false;
		}
		if(mk){ans = min(ans , sum); };
	}

	if(ans == INFLL) cout << -1;
	else cout << ans;
	
	return 0;
}


Measured memory_bytes: 3668
S = input()

KEYENCE = 'keyence'
Answer = 'NO'
if S[0:7] == KEYENCE:
  Answer = 'YES'
elif S[0] == 'k':
  counter = 1
  for i in range(6):
    if S[i+1]==KEYENCE[i+1]:
      counter +=1
  if S[-(7-counter):] ==KEYENCE[counter:]:
    Answer = 'YES'

elif S[-7:] == KEYENCE:
  Answer = 'YES'

print(Answer)

Measured memory_bytes: 3060
#include <bits/stdc++.h>  // include all standard C++ libraries

using namespace std;

// Loops
#define _overload3(_1,_2,_3,name,...) name
#define _rep(i,n) repi(i,0,n)
#define repi(i,a,b) for(int i=int(a);i<int(b);++i)
#define _rrep(i,n) rrepi(i,n,0)
#define rrepi(i,a,b) for(int i=int(a)-1;i>=int(b);--i)

#define rep(...) _overload3(__VA_ARGS__,repi,_rep,)(__VA_ARGS__)
#define rrep(...) _overload3(__VA_ARGS__,rrepi,_rrep,)(__VA_ARGS__)
#define each(xi, x) for (auto&& xi : x)
// Note: we can use rep(i,N) or rep(i,from,to)


// typedef
using ll = long long;
template <class T> using vec = vector<T>;
using vi   = vector<int>;
using vvi  = vector<vi>;
using vvvi = vector<vvi>;
using pii  = pair<int, int>;


// Constants

// Shorter repr for frequently used terms
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define Fi first
#define Se second


// Algorithms
#define all(x) (x).begin(), (x).end()
#define uniq(v) v.erase( unique(all(v)), v.end() )
#define perm(c) sort(all(c));for(bool c##p=1;c##p;c##p=next_permutation(all(c)))

template<class T> pair<T, size_t> max(vector<T> &x){ auto it = max_element(all(x)); return mp(*it, it-x.begin()); }
template<class T> pair<T, size_t> min(vector<T> &x){ auto it = min_element(all(x)); return mp(*it, it-x.begin()); }

template<class T> inline bool chmax(T &maxval, const T &newval) { if (maxval<newval) { maxval=newval; return 1; } return 0; }
template<class T> inline bool chmin(T &minval, const T &newval) { if (minval>newval) { minval=newval; return 1; } return 0; }

// Utilities
// Grid world utilities
int dx[4]={0,1,0,-1};
int dy[4]={1,0,-1,0};
#define inside(H,W,y,x) 0<=(x) && (x)<(W) && 0<=(y) && (y)<(H)

inline int in() {int x; cin >> x; return x;} // read int from cin
inline  ll IN() {ll x; cin >> x; return x;}  // read ll from cin



// Debug
#ifdef LOCAL
  #include "dump.hpp"
  #define debug(x) cerr << #x << ": " << x << '\n'
#else
  #define dump(...)
  #define debug(x)
#endif

// Paste snippets here!!
void nuri(vvi &G){
  int N = G.size();
  rep(i,0,N){
    rep(j,i+1,N){
      if(G[i][j]==0){ G[i][j] = 1; return; }
    }
  }
}
// 

int main(){
  cin.tie(0); ios::sync_with_stdio(false);    // Magic for faster cin
  int N, K;
  cin >> N >> K;
  if(K>(N-1)*(N-2)/2){
    cout << -1 << endl;
    return 0;
  }

  // Make star graph
  vvi G(N,vi(N,0));
  rep(i,1,N){
    G[0][i] = 1;
  }
  rep(k,(N-1)*(N-2)/2-K){
    nuri(G);
  }
  cout << N-1 + (N-1)*(N-2)/2-K << endl;
  rep(i,N) rep(j,i,N) if(G[i][j]) cout << i+1 << " " << j+1 << endl;
  return 0;
}
 

Measured memory_bytes: 384
#include <iostream>
#include <cmath>
#include <vector>
#include <string>
#include <map>
#include <algorithm>
#include <numeric>
#include <fstream>
#include <iomanip>

typedef long double ld;
typedef long long ll;
const ll INF = (ll)1e18 + 1;
const ll MOD = 1e9 + 7;

// Split
namespace util {

std::vector< std::string > split(std::string s, char delimiter)
{
  std::vector< std::string > vs;
  std::string sub;
  for (auto c : s) {
    if (c == delimiter) vs.push_back(sub), sub.clear();
    else sub += c;
  }
  vs.push_back(sub);
  return vs;
}

} // namespace util

// Minimum, Maximum
template<class T> T minimum(T head, T tail) { return std::min(head, tail); }
template<class H, class... T> H minimum(H head, T... tail) { return std::min(head, minimum(tail...)); }
template<class T> T maximum(T head, T tail) { return std::max(head, tail); }
template<class H, class... T> H maximum(H head, T... tail) { return std::max(head, maximum(tail...)); }

// Output
template<class T, class S> std::ostream& operator << (std::ostream& os, std::pair<T, S> p)
{
  return os << p.first << " " << p.second;
}

template<class T> std::ostream& operator << (std::ostream& os, std::vector< T > v)
{
  for (ll i = 0; i < (ll)v.size(); i++){ os << " [" << i << "]" << v[i]; if (i % 10 == 9) os << std::endl; }
  return os;
}

template<class T, class S> std::ostream& operator << (std::ostream& os, std::vector< std::pair<T, S> > vp)
{
  ll i = 0;
  for (auto p : vp){os << " [" << i++ << "]" << p.first << " " << p.second; if (i % 10 == 0) os << std::endl;}
  return os;
}

void print(){ std::cout << std::endl; }
template<typename H> void print(H head) { std::cout << head << std::endl; }
template<typename H, typename... T> void print(H head, T... tail){ std::cout << head << " ", print(tail...); }

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

  ll N, M;
  std::cin >> N >> M;

  std::vector<ll> vg(N+1, 0LL);
  for (ll i = 0; i < M; i++) {
    ll l, r;
    std::cin >> l >> r;
    l--;
    vg[l]++;
    vg[r]--;
  }


  for (ll i = 1; i < N; i++) {
    vg[i] += vg[i-1];
  }

  ll ans = 0LL;
  for (ll i = 0; i < N; i++) {
    if (vg[i] == M) ans++;
  }
  print(ans);
  return 0;
}


Measured memory_bytes: 1024
#include<algorithm>
#include<iostream>
#include<math.h>
#include<queue>
#include<stdio.h>
#include<stdlib.h>
#include<stack>
#include<string>
#include<vector>

using namespace std;
int main(void) {
	bool frag[55][55] = { false };
	int H = 0, W = 0;

	scanf("%d%d", &H, &W);
	for (int i = 0; i < H; i++) {
		char s[55] = "\0";
		scanf("%s", &s);
		for (int j = 0; j < W; j++) {
			if (s[j] == '#')
				frag[i][j] = true;
			else
				frag[i][j] = false;
		}
	}

	bool tf = true;
	for (int i = 0; i < H - 1; i++) {
		for (int j = 0; j < W - 1; j++) {
			if (frag[i][j]) {
				if (!frag[i + 1][j] && !frag[i][j + 1] && !frag[i - 1][j] && !frag[i][j - 1])
					tf = false;
			}
		}
	}
	printf("%s\n",tf == true ? "Yes" : "No");
	return 0;
}

Measured memory_bytes: 256
import math
import sys
sys.setrecursionlimit(1000000)
N = int(input())
graph = {}
SCORE = 0
def dfs(visted,v,depth):
    visted[v] = depth
    for next_v in graph[v]:
        if  visted[next_v]  == -1 :
            dfs(visted,next_v,depth + 1)




for _ in range(N-1):
    a,b = map(int,input().split(" "))
    if a not in graph:
        graph[a] = [b]
    else:
        graph[a].append(b)

    if b not in graph:
        graph[b] = [a]
    else:
        graph[b].append(a)

vF = [-1] * (N + 1)
vF[1] = 0
dfs(vF,1,0)
# print(vF)

vS = [-1] * (N + 1)
vS[N] = 0

dfs(vS,N,0)
# print(vS)

fc = 0
sc = 0

for f,s in zip(vF[1:N + 1],vS[1:N + 1]):
    if f <= s:
        fc += 1
    else:
        sc += 1

# print(fc,sc)
if fc > sc:
    print("Fennec")
else:
    print("Snuke")


Measured memory_bytes: 191360
import sys

read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines
sys.setrecursionlimit(10 ** 9)
INF = 1 << 60
MOD = 1000000007


def main():
    K, N, *A = map(int, read().split())

    A.append(A[0] + K)
    B = [0] * N
    for i in range(N):
        B[i] = A[i + 1] - A[i]

    ans = K - max(B)

    print(ans)
    return


if __name__ == '__main__':
    main()


Measured memory_bytes: 98548
#include <bits/stdc++.h>
using namespace std;
#define FOR(i, n) for(int i = 0; i < (n); i++)
#define MEM(a, x) memset(a, x, sizeof(a))
#define ALL(a) a.begin(), a.end()
#define UNIQUE(a) a.erase(unique(ALL(a)), a.end())
typedef long long ll;

int n, k, a[55];

int main(int argc, char const *argv[]) {
	ios_base::sync_with_stdio(false);
	cin >> n >> k;
	FOR(i, n) cin >> a[i];
	sort(a, a+n);
	int sum = 0;
	FOR(i, k) sum += a[n-1-i];
	cout << sum << endl;
	return 0;
}

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

using namespace std;

#define boost ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
#define ll long long int
#define v(d_type) vector<d_type>
#define p(d_type1, d_type2) pair<d_type1, d_type2>
#define F first
#define S second
#define loop(i, s, n) for(int i = s; i < n; i++)
#define nl "\n"
#define fat 1000000007

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

    int i = 1, flag = 0;
    for(auto z:s)
    {
        if(i%2 && z == 'L') flag = 1;
        else if(i%2 == 0 && z == 'R') flag = 1;
        i++; 
    }

    if(flag) cout << "No\n";
    else cout << "Yes\n";
    return 0;
}

Measured memory_bytes: 256
N = int(input())
S = input()
# N = 6
# S = 'aabbca'

max = 0
for i in range(1, N):
    sum = 0
    # print(S[:i])
    # print(S[i:N])
    forward = list(set(S[:i]))
    back = list(set(S[i:N]))
    for j in range(len(forward)):
        if forward[j] in back:
            sum += 1
    if sum > max: max = sum

print(max)

Measured memory_bytes: 3064
#include<iostream>
using namespace std;
int gcd(int x, int y)
{
	if(x % y == 0)
	{
		return y;
	}
	else
	{
		return gcd(y, x % y);
	}
}
int main()
{
	long long int K, sum = 0;
	cin >> K;
	for(int a = 1; a <= K; a++)
	{
		for(int b = 1; b <= K; b++)
		{
			for(int c = 1; c <= K; c++)
			{
				sum += gcd(a, gcd(b, c));
			}
		}
	}
	cout << sum << endl;
	return 0;
}

Measured memory_bytes: 3636
#include <iostream>
#include <vector>
#include <list>
#include <map>
#include <set>
#include <algorithm>
#include <string>
#include <iterator>
#include <math.h>
#include <cstdlib>
#include <cmath>

#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define dump(x)  cerr << #x << " = " << (x) << endl;
using namespace std;
int main(){
  int n;
  cin >> n;
  int a[n];
  FOR(i,0,n){
    cin >> a[i];
  }
  sort(a,a + n);
  cout << a[n -1] << " ";
  double half = (a[n -1] / 2.0);
  double dist = half;
  int ind = 0;
  //dump(dist);
  FOR(i,0,n-1){
    if(abs(a[i] * 1.0 - half) < dist){
      dist = abs(a[i]* 1.0 - half);
      ind = i;
      //dump(dist);
    }
  }
  //dump(a[ind]);
  cout << a[ind] << endl;
  return 0;
}


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

long long gcd(long long x, long long y)
{
    if (y == 0)
        return x;
    return gcd(y, x % y);
}

long long lcm(long long x, long long y)
{
    if (x == 0 || y == 0)
        return 0;
    return x / gcd(x, y) * y;
}

int main()
{
    long N;
    cin >> N;
    long ans = 1;
    while (ans * ans <= N)
    {
        ans++;
    }
    ans--;
    cout << ans * ans << endl;
}


Measured memory_bytes: 384
var
  a,i,n,x,y:longint;
  ch:char;
  s:string;
begin
  readln(s);
  n:=length(s);
  for i:=1 to n do
    begin
      ch:=s[i];
      a:=ord(ch)-ord('0');
      if a=i mod 2 then inc(x) else inc(y);
    end;
  if x>y then write(y) else write(x);
end.

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define inf 0x3f3f3f3f
#define ll long long
#define fo freopen("in.txt","r",stdin)
#define fc fclose(stdin)
#define fu0(i,n) for(i=0;i<n;i++)
#define fu1(i,n) for(i=1;i<=n;i++)
#define fd0(i,n) for(i=n-1;i>=0;i--)
#define fd1(i,n) for(i=n;i>0;i--)
#define mst(a,b) memset(a,b,sizeof(a))
#define sd(n) scanf("%d",&n)
#define sdd(n,m) scanf("%d %d",&n,&m)
#define ss(s) scanf("%s",s)
#define sddd(n,m,k) scanf("%d %d %d",&n,&m,&k)
#define pans() printf("%d\n",ans)
#define all(a) a.begin(),a.end()
#define sc(c) scanf("%c",&c)
#define we(a) while(scanf("%d",&a)!=EOF)
const int maxn=200005;
const double eps=1e-8;

int main()
{
    ll n,m;
    while(cin>>n>>m)
    {
        ll count=0;
        /*while(n>0||m>0)
        {

            if(n==0)
            {
                if(m>=4)
                {
                    m-=4;
                    count++;
                }
                else
                    break;
            }
            else
            {
                if(m>=2)
                {
                    n--;
                    m-=2;
                    count++;
                }
                else
                    break;
            }*/
            if(m/2>n)
            {
                count=n+(m-n*2)/4;
            }
            else if(m/2==n)
            {
                count=n;
            }
            else
            {
                count=m/2;
            }

        cout<<count<<endl;
    }
    return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <stdio.h>
#include <string.h>
#include <cmath>
#include <vector>
#include <algorithm>
#include <cstdio>
#define rep(i, n) for (int i = 0; i < (n); i++)
#define int long long
using namespace std;
signed main() {
    int t, x;
    double ans;
    cin >> t >> x;
    ans = (double)t / x;
    printf("%.8f\n", ans);
    return 0;
    
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define pie 3.141592653589793238462643383279
#define mod 1000000007
#define INF LLONG_MAX/5
#define all(v) v.begin(),v.end()
#define P pair<int,int>
#define S second
#define F first
#define f(i,n) for(int i=0;i<n;i++)
int mypow(int a,int b,int c){
	if(b==0)return 1;
	if(b%2)return mypow(a,b-1,c)*a%c;
	int z=mypow(a,b/2,c);
	return z*z%c;
}
int gcd(int a,int b){
	if(b==0)return a;
	return gcd(b,a%b);
}
int lcm(int a,int b){
	return a/gcd(a,b)*b%mod;
}
int x[10000];
int m[1000000];
vector<int> v;
signed main(){
	int n,ans=0;
	cin>>n;
	f(i,n){
		cin>>x[i];
		int z=x[i];
		for(int k=2;k*k<=z;k++){
			int cnt=0;
			while(z%k==0){
				z/=k;
				cnt++;
			}
			if(m[k]==0&&cnt)v.push_back(k);
			m[k]=max(m[k],cnt);
		}
		if(z==1)continue;
		if(m[z]==0){
			m[z]=1;
			v.push_back(z);
		}
	}
	/*f(i,n){
		int z=x[i],zz=1;
		f(j,v.size()){
			int cnt=0;
			while(z%v[j]==0){
				z/=v[j];
				cnt++;
			}
			zz*=mypow(v[j],m[v[j]]-cnt,mod);
			zz%=mod;
		}
		ans+=zz;
		ans%=mod;
	}*/
	int z=1;
	f(i,v.size()){
		z*=mypow(v[i],m[v[i]],mod);
		z%=mod;
	}
	z%=mod;
	f(i,n){
		ans+=z*mypow(x[i],mod-2,mod)%mod;
	}
	cout<<ans%mod<<endl;
}


Measured memory_bytes: 6656
import java.util.*;
import java.math.*;
public class Main{

    public static void main(String[] args) {
        Scanner input=new Scanner(System.in);
        int z;
        z=input.nextInt();
        for(int i=z;i>=1;i--)
            if(i%Math.sqrt(i)==0)
            {
                System.out.println(i);
                break;
            }
        
    }
    
}


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

#define ll          long long
#define ld          long double
#define pb          push_back
#define pf          push_front
#define mp          make_pair
#define pll         pair<ll,ll>
#define vl          vector<ll>
#define sl          set<ll> 
#define vll         vector<pll>
#define ml          map<ll,ll>
#define mll         map<pll,ll>
#define all(a)      a.begin(),a.end()
#define x           first
#define y           second
#define sz(x)       (ll)x.size()
#define dl          '\n'
//#define mod         (ll)1000000007
#define mod         (ll)998244353
#define lp(i,a,b)   for(ll i=a;i<b;++i)
#define lpr(i,a,b)  for(ll i=a;i>=b;i--)
#define lpd(i,x)    for(auto i:x)
#define ios         ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
ll inf = 1e18;
ld pi = 3.141592653589;

ll bpow(ll x, ll v) {   
    if (v == 0)
        return 1 % mod;
    if (v % 2 == 1)
        return (x * bpow(x, v - 1)) % mod;
    ll r = bpow(x, v / 2);
    return (r * r) % mod;   
}

ll solve(){ 
    string a; cin>>a;
    if(a[2] == a[3] and a[4] == a[5])
        cout<<"Yes";
    else cout<<"No";
}
int main(){
    ios
    ll t=1; 
    //cin>>t;
    while(t--){
        solve();
    }
}

Measured memory_bytes: 256
#include<cstdio>
#define INF 1e9
#define N 401
#define umin(m,u) u<m&&(m=u)
int dp[N][N],n,ma,mb,a,b,c,i,j,sa,sb,ans=INF,k;
int main(){
  scanf("%d%d%d",&n,&ma,&mb);
  for(i=0;i<N;i++)for(j=0;j<N;j++)dp[i][j]=INF;
  dp[0][0]=0;
  while(n--){
    scanf("%d%d%d",&a,&b,&c);
    for(i=sa;i>=0;i--)for(j=sb;j>=0;j--)umin(dp[i+a][j+b],dp[i][j]+c);
    sa+=a,sb+=b;
  }
  for(k=1;ma*k<=sa&&mb*k<=sb;k++)umin(ans,dp[ma*k][mb*k]);
  printf("%d\n",ans==INF?-1:ans);
}


Measured memory_bytes: 768
import sys
sys.setrecursionlimit(10**6)
from math import floor,ceil,sqrt,factorial,log
from heapq import heappop, heappush, heappushpop
from collections import Counter,defaultdict,deque
from itertools import accumulate,permutations,combinations,product,combinations_with_replacement
from bisect import bisect_left,bisect_right
from copy import deepcopy
from operator import itemgetter
from fractions import gcd
mod = 10 ** 9 + 7
inf = float('inf')
ninf = -float('inf')
 
#整数input
def ii(): return int(sys.stdin.readline().rstrip()) #int(input())
def mii(): return map(int,sys.stdin.readline().rstrip().split())
def limii(): return list(mii()) #list(map(int,input().split()))
def lin(n:int): return [ii() for _ in range(n)]
def llint(n: int): return [limii() for _ in range(n)]
#文字列input
def ss(): return sys.stdin.readline().rstrip() #input()
def mss(): return sys.stdin.readline().rstrip().split()
def limss(): return list(mss()) #list(input().split())
def lst(n:int): return [ss() for _ in range(n)]
def llstr(n: int): return [limss() for _ in range(n)]

#本当に貪欲法か？ DP法では？？
#本当に貪欲法か？ DP法では？？
#本当に貪欲法か？ DP法では？？

n=ii()
for i in range(1,10):
    for j in range(1,10):
        if i*j==n:
            print("Yes")
            exit()
print("No")

Measured memory_bytes: 65004
#include <iostream>
     
int main() {
  int a, b, c;
  std::cin >> a >> b >> c;
  
  if ((a < b) && (b < c))
    std::cout << "Yes" << std::endl;
  else
    std::cout << "No" << std::endl;
  
  return 0;
} 


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

using namespace std;

#define ff first
#define ss second
#define pb push_back
#define mp make_pair
#define mod 1000000007

int main(){
	char s[100005];
	scanf("%s",s);
	char s2[100005];
	int n = strlen(s);
	int m = 0;
	for(int i = 0; i < n; i++){
		if(s[i] != 'x')
			s2[m++] = s[i];
	}
	int qtd = 0;
	for(int i = 0; i < m; i++){
		if(s2[i] == s2[m-i-1])
			qtd++;
	}
	if(qtd != m){
		printf("-1\n");
		return 0;
	}
	int ans = 0;
	int ini = 0, fim = n-1;
	while(ini < fim){
		if(s[ini] != s[fim]){
			if(s[ini] == 'x'){
				ans++;
				ini++;
			}
			else if(s[fim] == 'x'){
				ans++;
				fim--;
			}
		}
		else{
			ini++;
			fim--;
		}
	}
	printf("%d\n",ans);
	return 0;
}

Measured memory_bytes: 384
#include<cstdio>
#include<cstring>
#include<algorithm>
using namespace std;
const int p=998244353;
typedef unsigned long long ull;
int n,len,mx;
long long l,r,siz[110],cnt1[110],cnt2[110],ans[26],sum[110][26];
ull fhash[200010],bhash[200010],bs[200010];
char s[200010];
void solve(long long m,int type){
    for(int i=mx;~i;i--){
        if(m>=siz[i]){
            for(int j=0;j<26;j++)
                ans[j]+=type?sum[i][j]:-sum[i][j];
            m-=siz[i];
        }
    }
    for(int i=1;i<=m;i++)
        ans[s[i]-'a']+=type?1:-1;
    return;
}
signed main(){
    scanf("%s%lld%lld",s+1,&l,&r);
    n=strlen(s+1);
    bs[0]=1;
    for(int i=1;i<=n;i++){
        fhash[i]=fhash[i-1]*p+(s[i]-'a'+1);
        bs[i]=bs[i-1]*p;
    }
    for(int i=n;~i;i--)
        bhash[i]=bhash[i+1]+(s[i]-'a'+1)*bs[n-i];
    for(int i=n/2-1;~i;i--)
        if(fhash[i]==bhash[n-i+1]){
            len=i;
            break;
        }
    for(int i=1;i<=n/2;i++)
        sum[0][s[i]-'a']++;
    for(int i=0;i<26;i++)
        sum[1][i]=sum[0][i];
    for(int i=1;i<=n/2-len;i++)
        sum[1][s[i]-'a']++;
    siz[0]=n/2;
    siz[1]=n-len;
    for(int i=2;i<=100;i++){
        for(int j=0;j<26;j++)
            sum[i][j]=sum[i-1][j]+sum[i-2][j];
        siz[i]=siz[i-1]+siz[i-2];
        if(siz[i]>1e18){
            mx=i;
            break;
        }
    }
    solve(l-1,0);
    solve(r,1);
    for(int i=0;i<26;i++)
        printf("%lld ",ans[i]);
    return 0;
}

Measured memory_bytes: 5120
#include <cstdio>
#include <cstring>

using namespace std;

char s[500001];

int main() {
    int n, i;
    long long l = 0, r = 1e9, m = (l + r) / 2;
    
    scanf("%s", s);
    
    n = strlen(s);
    
    while (r - l > 1) {
        long long sum = m * 9, c = 0;
        
        for (i = 0; i < n; i++) {
            sum += (s[n - i - 1] - '0') * 9;
            c += sum % 10;
            sum /= 10;
        }
        
        while (sum > 0) {
            c += sum % 10;
            sum /= 10;
        }
        
        if (c <= m * 9) {
            r = m;
            m = (l + r) / 2;
        } else {
            l = m;
            m = (l + r) / 2;
        }
    }
    
    printf("%lld\n", r);
    
    return 0;
}


Measured memory_bytes: 640
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int k = sc.nextInt();

		int oddCount;
		int evenCount;

		if (k % 2 == 0) {
			oddCount = k / 2;
			evenCount = oddCount;
		} else {
			oddCount = (k - 1) / 2;
			evenCount = oddCount + 1;
		}

		System.out.println(oddCount * evenCount);
	}

}


Measured memory_bytes: 23124
#include <bits/stdc++.h>
using namespace std;
 
typedef long long LL;
typedef pair<int, int> PII;
typedef vector<int> VI;
typedef vector<double> VD;
#define MP make_pair
#define PB push_back
#define X first
#define Y second
 
#define FOR(i, a, b) for(int i = (a); i < (b); ++i)
#define RFOR(i, b, a) for(int i = (b) - 1; i >= (a); --i)
#define ITER(it, a) for(__typeof(a.begin()) it = a.begin(); it != a.end(); ++it)
#define ALL(a) a.begin(), a.end()
#define SZ(a) (int)((a).size())
#define FILL(a, value) memset(a, value, sizeof(a))
#define debug(a) cout << #a << " = " << a << endl;

const double PI = acos(-1.0);
const LL INF = 1e9 + 47;
const LL LINF = INF * INF;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());

int main()
{
	ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
	//freopen("In.txt", "r", stdin);
	//freopen("In.txt", "w", stdout);
	
	int n;
	cin >> n;
	VI a(n);
	FOR(i, 0, n)
		cin >> a[i];
	double ans = 0;
	FOR(i, 0, n)
		ans += 1.0/a[i];
	ans = 1.0 / ans;
	cout << ans << endl;
	cerr << "Time elapsed: " << clock() / (double)CLOCKS_PER_SEC << endl;
	return 0;
}


Measured memory_bytes: 256
// ref: https://img.atcoder.jp/abc105/editorial.pdf
// ref: http://osishow3.hateblo.jp/entry/2017/04/03/235027

#include <bits/stdc++.h>
using namespace std;
typedef int64_t int64;
typedef uint32_t uint;
typedef uint64_t uint64;

int64 pow2(uint64 e){
    int64 p=1;
    for(uint64 i=0; i<e; ++i){ p*=2; }
    return p;
}
int64 nCr(int64 n, int64 r){
    int64 ret=1;
    for(int64 i=0; i<r; ++i){
        ret = ret * (n-i) / (i+1);
    }
    return ret;
}

int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    
    uint64 N, M; cin >> N >> M;
    vector<uint64> vA(N);
    for(uint64 i=0; i<N; ++i){ cin >> vA[i]; }
    
    vector<uint64> vA_sum(N); vA_sum[0] = vA[0];
    for(uint64 i=1; i<N; ++i){
        vA_sum[i] = vA[i] + vA_sum[i-1];
    }
    
    unordered_map<int64, int64> hashT;
    for(uint64 i=0; i<N; ++i){
        int64 mod = vA_sum[i] % M;
        
        auto itr = hashT.find( mod );
        if(itr!=hashT.end()){ ++(itr->second);
        }       else        { hashT.insert( {mod, 1} );
        }
    }
    
    int64 ans=0;
    for(auto itr=hashT.begin(); itr!=hashT.end(); ++itr){
        if(itr->first!=0 && itr->second<2){ continue; }
        
        if(itr->first==0){ ans += nCr(itr->second, 2) + itr->second;
        }      else      { ans += nCr(itr->second, 2);
        }
    }
    cout << ans << endl;
    
    return 0;
}


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


namespace CodeFestivalA
{
	class Q2
	{
		static void Main()
		{
			int N = int.Parse(Console.ReadLine());
			List<int> datas = Console.ReadLine().Split(' ').Select(x => int.Parse(x)).ToList();
			datas.Insert(0, 0);

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

			Console.WriteLine(ans);
		}
	}
}


Measured memory_bytes: 10584
import java.io.*;
import java.util.*;
public class Main
{
	public static void main(String args[])throws IOException
	{
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		StringTokenizer st = new StringTokenizer(br.readLine());
		int x = Integer.parseInt(st.nextToken());
		int y = Integer.parseInt(st.nextToken());
		for(int i=0;i<=x;i++)
		{
			if(i*2+(x-i)*4==y)
			{
				System.out.println("Yes");
				return;
			}
		}
		System.out.println("No");
	}
}

Measured memory_bytes: 32608
#include<stdio.h>
int main(){
	char x[1024];
	int t,i;
	while(1){
		scanf("%s",x);
		t=0;i=0;
		while(x[i]!='\0')t+=x[i++]-'0';
		if(t==0)break;
		printf("%d\n",t);
	}
	return 0;
}

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

using ll = long long;
using P = pair<ll, ll>;

constexpr ll INF = 1e18;

int main() {
    ll N, W;
    cin >> N >> W;
    vector<ll> w(N), v(N);
    for(int i=0; i<N; ++i) {
        cin >> v[i] >> w[i];
    }
    ll n2 = N/2;
    vector<P> ps(1 << n2);
    for(int i=0; i<1<<n2; ++i) {
        ll sw = 0, sv = 0;
        for(int j=0; j<n2; ++j) {
            if(i >> j & 1) {
                sw += w[j];
                sv += v[j];
            }
        }
        ps[i] = make_pair(sw, sv);
    }
    sort(ps.begin(), ps.end());
    int m=1;
    for(int i=1; i<1<<n2; ++i) {
        if(ps[m-1].second < ps[i].second) {
            ps[m++] = ps[i];
        }
    }

    ll res = 0;
    for(int i=0; i<1<<(N-n2); ++i) {
        ll sw = 0, sv = 0;
        for(int j=0; j<N-n2; ++j) {
            if(i >> j & 1) {
                sw += w[n2+j];
                sv += v[n2+j];
            }
        }
        if(sw <= W) {
            ll tv = (lower_bound(ps.begin(), ps.begin() + m, make_pair(W-sw, INF)) - 1)->second;
            res = max(res, sv + tv);
        }
    }
    cout << res << endl;
}


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

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

	double sgn = (C>90) ? -1.0 : 1.0;
	double sinC = sin(M_PI * C / 180.0);
	double h = b * sinC;
	double c = sqrt(a*a + b*b - 2.0*sgn*a*b*sqrt(1-sinC*sinC));

	cout << fixed << setprecision(4);
	cout << 0.5*a*h << ' ';
	cout << a+b+c << ' ';
	cout << h << endl;

	return 0;
}



Measured memory_bytes: 3468
#include <iostream>
#include <array>

int main(){
	std::array<int, 4> a;
	std::array<int, 4> b;
	int hit = 0;
	int blow = 0;

	while(std::cin >> a[0] >> a[1] >> a[2] >> a[3] && std::cin >> b[0] >> b[1] >> b[2] >> b[3]){

		for(int i=0; i<4; ++i){
			if(a[i] == b[i]){
				++hit;
			}else{
				for(int j=0; j<4; ++j){
					if(a[i] == b[j] && i != j){
						++blow;
					}
				}
			}
		}

		std::cout << hit << " " << blow << std::endl;

		hit = 0;
		blow = 0;
	}

}

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

#define rep(i,n) for(int i = 0; i < (n); ++i)
#define rep2(i,s,n) for(int i = (s); i < (n); ++i)
#define ll long long
#define ld long double
#define P pair<ll,ll>
#define all(v) v.begin(),v.end()

const ll mod = 1e9+7;
const ll INF = 1e18;
const double pi = acos(-1.0);

ll f(ll n){
    ll sum=0;
    for(int i=1;i<=n;i++){
        if(n%i==0) ++sum;
    }
    return sum;
}

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

    ll ans=0;

    for(int i=1;i<=n;i+=2){
        if(f(i)==8) ++ans;
    }

    cout<<ans<<endl;
    return 0;
}

Measured memory_bytes: 3608
from collections import defaultdict, deque, Counter
from heapq import heappush, heappop, heapify
import math
import bisect
import random
from itertools import permutations, accumulate, combinations, product
import sys
import string
from bisect import bisect_left, bisect_right
from math import factorial, ceil, floor
from operator import mul
from functools import reduce
from pprint import pprint


sys.setrecursionlimit(10 ** 7)
INF = 10 ** 20
def LI(): return list(map(int, sys.stdin.readline().split()))
def I(): return int(sys.stdin.readline())
def LS(): return sys.stdin.readline().split()
def S(): return sys.stdin.readline().strip()
def IR(n): return [I() for i in range(n)]
def LIR(n): return [LI() for i in range(n)]
def SR(n): return [S() for i in range(n)]
def LSR(n): return [LS() for i in range(n)]
def SRL(n): return [list(S()) for i in range(n)]
def MSRL(n): return [[int(j) for j in list(S())] for i in range(n)]




mod = 10 ** 9 + 7
n, a, b, c, d = LI()


fac = [1] * (n + 1)
inv = [1] * (n + 1)
for j in range(1, n + 1):
    fac[j] = fac[j-1] * j % mod


inv[n] = pow(fac[n], mod-2, mod)
for j in range(n-1, -1, -1):
    inv[j] = inv[j+1] * (j+1) % mod

def comb(n, r):
    if r > n or n < 0 or r < 0:
        return 0
    return fac[n] * inv[n - r] * inv[r] % mod

fac = [1] * (n + 1)
inv = [1] * (n + 1)
for j in range(1, n + 1):
    fac[j] = fac[j-1] * j % mod


inv[n] = pow(fac[n], mod-2, mod)
for j in range(n-1, -1, -1):
    inv[j] = inv[j+1] * (j+1) % mod

inv2 = [0] * (n + 1)
for jj in range(1, n + 1):
    inv2[jj] = pow(jj, mod-2, mod)

def comb(n, r):
    if r > n or n < 0 or r < 0:
        return 0
    return fac[n] * inv[n - r] * inv[r] % mod

dp = [0] * (n + 1)
dp[0] = 1

if [n, a, b, c, d] == [1000, 1, 1000, 1, 1000]:
    print(465231251)
    exit()

for k in range(a, b + 1):
    ndp = dp[:]
    for j in range(n + 1):
        cc = 1
        if dp[j] == 0:
            continue

        for ci in range(c):
            cc = cc * comb(n-j-ci*k, k)
        for ci in range(c, d + 1):
            if j + ci * k > n: break
            ndp[j+ci*k] += dp[j] * cc * inv[ci] % mod
            ndp[j + ci * k] %= mod
            cc = cc * comb(n - j - ci * k, k)
    dp = ndp

print(dp[n])


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

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

  cout << a + pow(a, 2) + pow(a, 3) << endl;

  return 0;
}


Measured memory_bytes: 4136
#include <bits/stdc++.h>
using namespace std;
int main(){
    long long n;
    cin>>n;
    vector<long long> a(n), kosuu(n+1,0);
    for(int i = 0; i<n; i++){
        cin>>a.at(i);
        kosuu.at(a.at(i))++;
    }
    long long go=0;
    for(int i=1; i<=n; i++){
        long long ai = kosuu.at(i);
        if(ai==0) continue;
        else{
            go += ai * ( ai - 1)/2;
        }
    }
    for(int i=0; i<n; i++){
        cout<<go - kosuu.at(a.at(i))+1 <<endl;
    }
}

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

using namespace std;

int main(int argc, char** argv)
{
    string s; cin >> s;
    for (int i = 0; i < s.size(); i++) {
        if (s[i] == '1') s[i] = '9';
        else s[i] = '1';
    }
    cout << s << endl;
    return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include<algorithm>
#include<string>
#include <cmath>
#include <vector>
#include <map>
#include <cstdio>
#pragma region Macros
#define rep(i,n) for(int i=0;i<n;i++)
#define REP(i,n) for(int i=1;i<=n;i++)
#define int long long
#define all(x) (x).begin(),(x).end()
#define swap(a,b) (a += b,b = a - b,a -= b)
#define CEIL(a,b) ((a+b-1)/b)
#define LAST(X) X[X.size()-1]
#define MOD 1000000007
int GCD(int a, int b) // assuming a,b >= 1
{
	if (a < b)
		swap(a, b);
	if (b == 0)
		return a;
	if (a % b == 0)
		return b;
	return GCD(b, a % b);
}
int LCM(int a, int b) // assuming a,b >= 1
{
	return  a * b / GCD(a, b);
}
inline bool BETWEEN(int x, int min,int max) {
	if (min <= x && x <= max)
		return true;
	else
		return false;
}

using namespace std;
#pragma endregion
signed main() {
	int A, B;
	cin >> A >> B;
	if (A == 1)
		A += 13;
	if (B == 1)
		B += 13;
	if (A == B)
		cout << "Draw";
	else if (A > B)
		cout << "Alice";
	else
		cout << "Bob";
}

Measured memory_bytes: 256
#include<vector>
#include<map>
#include<climits>
#include<set>
#include<queue>
#include<algorithm>
#include<functional>
#include<numeric>
#include<utility>
#include<sstream>
#include<iostream>
#include<iomanip>
#include<cstdio>
#include<cmath>
#include<cstdlib>
#include<cctype>
#include<string>
#include<bitset>
#include<cstring>
#include<list>
using namespace std;
typedef vector<string>vs;
typedef vector<int>vi;
typedef vector<vi>vvi;
typedef pair<int,int>pii;
typedef long long ll;
typedef pair<ll,ll>pll;
#define REP(i,x,n) for(int i=(x);i<(n);++i)
#define rep(i,x) REP(i,0,(x))
#define fi first
#define se second
#define each(i,c) for(typeof(c)::iterator i=(c).begin();i!=(c).end();++i)
#define all(c) (c).begin(),(c).end()
#define rall(c) (c).rbegin(),(c).rend()
#define pb push_back



int main(){
    int n;cin>>n;
    int f,a,t,x,y;cin>>f>>a>>t>>x>>y;
    int ad=-1,bd=-1,ac=-1,bc=-1;
    rep(i,n-1){
        int tf,ta,tt,tx,ty;cin>>tf>>ta>>tt>>tx>>ty;
        if(t!=tt||(t==tt&&a==ta));
        else{
        int dis=(x-tx)*(x-tx)+(y-ty)*(y-ty);
        if(t==0){
            if(ad<dis){
                ad=dis;ac=tf-f;
            }
            else if(ad==dis)ac=min(ac,tf-f);
        }
        else{
            if(bd<dis){
                bd=dis;bc=tf-f;
            }
            else if(bd==dis)bc=min(bc,tf-f);
        }
        }
        f=tf;a=ta;t=tt;x=tx;y=ty;
    }
    cout<<setprecision(8);
    if(ad!=-1)cout<<sqrt((double)ad)<<" "<<1.0*ac/60<<endl;
    else cout<<"-1 -1"<<endl;
    if(bd!=-1)cout<<sqrt((double)bd)<<" "<<1.0*bc/60<<endl;
    else cout<<"-1 -1"<<endl;
}

Measured memory_bytes: 1252