akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
#include <algorithm>
using namespace std;
typedef long long ll;


int main() {
    int a, b, c;
    cin >> a >> b >> c;
    if ((a <= c and c <= b) or (b <=c and c <= a))
        cout << "Yes\n";
    else
        cout << "No\n";
}



Measured memory_bytes: 764
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define mp make_pair
#define pb push_back
#define rep(i,n) for(int i=0;i<n;i++)
#define rep1(i,n) for(int i=1;i<=(int)(n);i++)


int main(){
  ios::sync_with_stdio(false);
  cin.tie(0);
  ll N;
  cin >> N;
  ll a[N];
  rep(i,N) cin >> a[i];
  ll sum[N];
  sum[0] = a[0];
  rep1(i,N-1) sum[i] = sum[i-1]+a[i];
  ll ans=INT_MAX*1LL;
  rep(i,N-1) ans =min(abs((sum[N-1]-sum[i])-sum[i]) ,ans);
  cout << ans << endl;
  return 0;
    

}


Measured memory_bytes: 3328
#include<stdio.h>

 int main(void){

 int i,n;

 int number;

 long long int sum=0;

 int min=0;

 int max=0;

 scanf("%d",&n);

 for(i=0;i<n;i++){

 scanf("%d",&number);

 if(i==0){

min=number;

 max=number;

 }

 if(number<min)min=number;

 if(number>max)max=number;

 sum+=number;

 }

 printf("%d %d %lld\n",min,max,sum);

 return 0;

 }

Measured memory_bytes: 1028
#pragma GCC optimize("O3")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,tune=native")

#include <iostream>
#include <vector>
#include <algorithm>
#include <map>
#include <set>
#include <functional>
#include <iomanip>
#include <numeric>
#include <cassert>

using namespace std;
using ll = long long;

const int MOD = 998244353;
const int N = 2001;

int dp[N][N];
ll f[N], fr[N];

ll binpow(ll a, int p) {
    ll res = 1;
    while (p) {
        if (p & 1) {
            (res *= a) %= MOD;
        }
        (a *= a) %= MOD;
        p >>= 1;
    }
    return res;
}

ll cnk(int n, int k) {
    assert(k <= n);
    return f[n] * fr[k] % MOD * fr[n - k] % MOD;
}

ll solve(int n, int k, int t) {
    ll res = 0;
    int l = max(1, t - k);
    int r = min(k, t - 1);
    assert((r - l + 1) % 2 == 0);
    int kek = (r - l + 1) / 2;
    for (int i = 0; i <= kek; i++) {
        if (n - kek + i < 0) {
            continue;
        }
        (res += dp[k - kek - i][n - kek + i] * binpow(2, kek - i) % MOD * cnk(kek, i)) %= MOD;
    }
    return res;
}

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    int n, k;
    cin >> k >> n;

    f[0] = fr[0] = 1;
    for (int i = 1; i <= N; i++) {
        f[i] = f[i - 1] * i % MOD;
        fr[i] = binpow(f[i], MOD - 2);
    }

    fill(dp[1], dp[1] + n + 1, 1);
    for (int i = 2; i <= k; i++) {
        int s = 0;
        for (int j = 0; j <= n; j++) {
            (s += dp[i - 1][j]) %= MOD;
            dp[i][j] = s;
        }
    }
    for (int t = 2; t <= 2 * k; t++) {
        ll ans = 0;
        if (t & 1) {
            ans = solve(n, k, t);
        } else {
            ans = (solve(n, k - 1, t - 1) + solve(n - 1, k - 1, t - 1)) % MOD;
        }
        cout << ans << '\n';
    }
    return 0;
}

Measured memory_bytes: 16000
#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;}
// void fill(ll n, ll a[n], ll value){ rep(i,0,n) a[i] = value; }
void cin(ll *n){ scanf("%lld",&(*n)); }
void cin2(ll *a, ll *b){ scanf("%lld%lld",&(*a),&(*b)); }
void cin3(ll *a, ll *b, ll *c){ scanf("%lld%lld%lld",&(*a),&(*b),&(*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);}
// int int_sort( const void * a , const void * b ) {
//   return strcmp(( char * )a , ( char * )b );
// }
//     qsort((void*)s,n,sizeof(s[0]),int_sort );

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,m;
    ll ans=0;
    cin(&n);
    cin(&m);
    // cin(&);
    // cin2(&,&);
    // cin3(&,&,&);
    ll h[n],high[n];
    rep(i,0,n){
        cin(&h[i]);
    }
    ll a,b;
    rep(i,0,n) high[i]=1;
    rep(i,0,m){
        cin2(&a,&b);
        if( h[a-1] > h[b-1] ) high[b-1]=0;
        if( h[b-1] > h[a-1] ) high[a-1]=0;
        if( h[b-1] == h[a-1] ){
            high[a-1]=0; high[b-1]=0;
        }
        
    }
    rep(i,0,n){
        if(high[i]) ans++;
    }

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


Measured memory_bytes: 3296
import math
a,b,C = map(int, input().split())
S = 0
S = 1/2*a*b*math.sin(math.radians(C))
print('{0:5f}'.format(S))
print('{0:5f}'.format(a+b+(math.sqrt(a**2+b**2-2*a*b*math.cos(math.radians(C))))))
print('{0:5f}'.format(S*2/a))


Measured memory_bytes: 5716
#include <bits/stdc++.h>
using namespace std;
#define e1 first
#define e2 second
#define pb push_back
#define mp make_pair
#define boost ios_base::sync_with_stdio(false)
#define eb emplace_back
#define OUT(x) {cout << x; exit(0); }
#define FOR(i,a,b) for(int i=(a);i<=(b);++i)
#define scanf(...) scanf(__VA_ARGS__)?:0
typedef long long int ll;
typedef unsigned long long ull;
typedef pair <int, int> PII;
typedef pair <ll, ll> PLL;
typedef pair <PLL, int> PLLI;
typedef pair <PLL, PLL> PP;
typedef pair <PII, int> PPI;
typedef pair <ll, int> PLI;
typedef unsigned int ui;
const int mod = 1e9+7;
const int inf = 1e9+9;
const ll MOD = 1e9+696969;
const long long INF = 1e18+3;

const int maxn = 20;
int dp[2][maxn + 1][(1 << 19)], n, m, k;

int req[maxn + 5][maxn + 5];

inline void addmod(int &x, int v) {
	x += v;
	while (x >= mod) x -= mod;
}

inline void submod(int &x, int v) {
	x -= v;
	while (x < 0) x += mod;
}

inline int lgbit(int x) {
	return 31 - __builtin_clz(x);
}

inline bool testBit(int mask, int pos) {
	return (mask & (1 << pos));
}

inline int change(int mask, int pos) {
	int suff = (1 << pos) - 1;
	int newmask = (mask & suff);
	if (!newmask) return (mask | (1 << pos));
	return ((mask | (1 << pos)) ^ (1 << lgbit(newmask)));
}

int main()
{
	cin >> n >> m >> k;
	for (int i=1; i<=k; ++i)
	{
		int ai, bi, ci;
		cin >> ai >> bi >> ci;
		--ai; --bi;
		req[ai][bi] = ci + 1;
	}
	
	dp[0][0][0] = 1;
	int pot = (1 << (n - 1));
	for (int i=0; i<m; ++i)
	{
		for (int j=0; j<n-1; ++j)
		{
			for (int mask = 0; mask < pot; ++mask)
			{
				//first try -> chcemy isc w tym kroku w lewo
				if (!testBit(mask, n - 2 - j) && req[i][j] != 2) addmod(dp[i & 1][j + 1][mask], dp[i & 1][j][mask]);
				//second try -> chcemy isc w tym kroku w prawo i maska tez podaza w prawo
				if (testBit(mask, n - 2 - j) && req[i][j] != 1) addmod(dp[i & 1][j + 1][mask], dp[i & 1][j][mask]);
				//third try -> chcemy isc w prawo, a maska podazala w lewo
				if (!testBit(mask, n - 2 - j) && req[i][j] != 1)
				{
					int convMask = change(mask, n - 2 - j);
					addmod(dp[i & 1][j + 1][convMask], dp[i & 1][j][mask]);
				}
			}
		}
		
		for (int j = 0; j <= n; ++j)
			for (int mask = 0; mask < pot; ++mask) dp[(i & 1) ^ 1][j][mask] = 0;
			
		for (int j=n-1; j<n; ++j)
		{
			for (int mask = 0; mask < pot; ++mask) addmod(dp[(i & 1) ^ 1][0][mask], dp[i & 1][j][mask]);
		}	
		
	}
	int ret = 0;
	for (int mask = 0; mask < pot; ++mask) addmod(ret, dp[m & 1][0][mask]);
	cout << ret;
}


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

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

Measured memory_bytes: 256
import std.stdio;
import std.conv;
import std.string;
import std.typecons;
import std.algorithm;
import std.array;
import std.range;
import std.math;
import std.regex : regex;
import std.container;
import std.bigint;
import std.ascii;


void main()
{
  auto n = readln.chomp.to!int;
  int[string] t;
  int sum;
  foreach (i; 0..n) {
    auto a = readln.chomp.split;
    sum += a[1].to!int;
    t[a[0]] = sum;
  }
  auto x = readln.chomp;
  writeln(sum - t[x]);
}


Measured memory_bytes: 256
# input
a, b, c, d = map(int, input().split())

# process
ans = -10**18
t = a*c
if ans < t:
    ans = t
t = a*d
if ans < t:
    ans = t
t = b*c
if ans < t:
    ans = t
t = b*d
if ans < t:
    ans = t

# output
print(ans)


Measured memory_bytes: 9176
#include <cstdio>
#include <map>
#include <vector>
#include <algorithm>
using namespace std;
using Graph = vector< vector<int> >;

int solve(Graph &G, int cur) {
    int ret = 0;
    vector<int> children;
    for(auto to : G[cur]) {
        children.push_back(solve(G, to) + 1);
    }

    sort(children.begin(), children.end());
    int ad = 0;
    for(auto e : children) {
        ad = max(e, ad + 1);
    }
    return ret + ad;
}

int main() {
    int N; scanf("%d", &N);
    Graph G(N);
    for(int i=1; i<N; i++) {
        int p; scanf("%d", &p);
        G[p-1].push_back(i);
    }
    printf("%d\n", solve(G, 0));
    return 0;
}

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

const int mod = 1e9 + 7;
int h, w, d[1010][1010];
char s[1010][1010];

int main(){
    scanf("%d %d", &h, &w);
    for(int i = 1; i <= h; i++) scanf("%s", s[i] + 1);
    for(int i = 1; i <= h; i++) for(int j = 1; j <= w; j++){
        if(i == 1 && j == 1) d[i][j] = 1;
        else if(s[i][j] == '.') d[i][j] = (d[i][j - 1] + d[i - 1][j]) % mod;
    }
    printf("%d", d[h][w]);
    return 0;
}

Measured memory_bytes: 5120
#include <bits/stdc++.h>
#define REP(i, n) for(int i = 0; i < n; i++)
#define REPR(i, n) for(int i = n; i >= 0; i--)
#define FOR(i, m, n) for(int i = m; i < n; i++)
#define INF 2e9
#define MOD 1000000007
#define ALL(v) v.begin(), v.end()
using namespace std;
typedef long long ll;
using P = pair<int,int>;

int main()
{
  int H,W;
  cin >> H >> W;
  vector<vector<int>> A(H,vector<int>(W));
  REP(i, H){
    REP(j, W){
      cin >> A.at(i).at(j);
    }
  }

  vector<vector<int>> ans(4,vector<int> ());
  int flag = 0;
  REP(i,H){
    if(i%2==0){
      REP(j,W){
        if(A.at(i).at(j)%2==1&&flag==0){
          flag=1;
          continue;
        }
        if(flag==1){
          ans.at(2).push_back(i);
          ans.at(3).push_back(j);
          if(j==0){
            ans.at(0).push_back(i-1);
            ans.at(1).push_back(j);
          }else{
            ans.at(0).push_back(i);
            ans.at(1).push_back(j-1);
          }
        }
        if(A.at(i).at(j)%2==1&&flag==1){
          flag=0;
        }
      }
    }else{
      REPR(j,W-1){
        if(A.at(i).at(j)%2==1&&flag==0){
          flag=1;
          continue;
        }
        if(flag==1){
          ans.at(2).push_back(i);
          ans.at(3).push_back(j);
          if(j==W-1){
            ans.at(0).push_back(i-1);
            ans.at(1).push_back(j);
          }else{
            ans.at(0).push_back(i);
            ans.at(1).push_back(j+1);
          }
        }
        if(A.at(i).at(j)%2==1&&flag==1){
          flag=0;
        }
      }
    }
  }

  cout << ans.at(0).size() << endl;
  REP(i,ans.at(0).size()){
    REP(j,3){
      cout << ++ans.at(j).at(i) << " ";
    }
    cout << ++ans.at(3).at(i) << endl;
  }
}

Measured memory_bytes: 6316
#include<bits/stdc++.h>
#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define REP(i, n) for (int i = 0; i < (n); ++i)
//#define int long long
#define vec(a,n) vector<int> (a)((n));
#define Vec(a,n) vector<string> (a)((n));
#define twovec(a,n,m) vector<vector<int>> a(n,vector<int>(m,0));
#define Twovec(a,n,m) vector<vector<double>> a(n,vector<double>(m,0));
#define P pair<int,int>
#define All(a) (a).begin(),(a).end()
#define Sort(a) sort(All(a));
#define Reverse(a) reverse(All(a));
#define PQ(n) priority_queue<P,vector<P>,greater<P>> (n)
#define pq(n) priority_queue<int> (n)
#define print(a) cout << (a) << endl
#define printD(a) cout << setprecision(15) << (a) << endl;
using namespace std;
int max_int = 2147483647;
int prime = 998244353;
void Debug(auto a);
int nibul(auto a,auto b);
int nibuu(auto a,auto b);
void input(vector<auto>& a,int n);
double PI = 3.14159265358979;
int n=3;


signed main(){
    long long a;
    float b;
    cin >> a >> b;
  	int c = (int)(b*100+0.5);
  	//print(c);
  	print((a*c)/100);
    return 0;
}

void Debug(auto a){
    cout << "{ ";
    for(auto b: a){
        cout << b << " ";
    }
    cout << "}" << endl;
}
int nibul(auto a,auto b){
    int x = lower_bound(All(a),b) - a.begin();
    //key以上の初めてのitr
    return x;
}
int nibuu(auto a,auto b){
    int x = upper_bound(All(a),b) - a.begin();
    //key以下の最後のitr
    return x-1;
}

void input(vector<auto>& a,int n){
    REP(i,n){
        cin >> a[i];
    }
}


Measured memory_bytes: 3724
#include <bits/stdc++.h>
using namespace std;
// define
#define int long long
#define UNIQUE(v) v.erase(unique(all(v)), v.end());
#define ZIP(v) sort(all(v)),UNIQUE(v)
#define ADD(a, b) a = (a + b) % mod
#define SUB(a, b) a = (a+mod-b)%mod
#define MUL(a, b) a = (((a)%mod) * ((b)%mod)) % mod
#define rollcall cout << "I'm Sucu." << endl;
#define repi(i,m,n) for(int i = m;i < n;i++)
#define drep(i,n,m) for(int i = n;i >= m;i--)
#define rep(i,n) repi(i,0,n)
#define rrep(i,n) repi(i,1,n+1)
#define chmin(x,y) x = min(x,y)
#define chmax(x,y) x = max(x,y)
#define all(v) v.begin(),v.end()
#define rall(v) v.rbegin(), v.rend()
#define dmp(x,y) make_pair(x,y)
#define dmt(x, y, z) make_tuple(x, y, z)
#define pb(x) push_back(x)
#define pf(x) push_front(x)
#define fi first
#define se second
// debug
template <typename T, typename U>
ostream &operator<<(ostream &os, const pair<T, U> &p){
  os << "(" << p.first << "," << p.second << ")";return os;
}
template <typename T, typename U, typename V>
ostream &operator<<(ostream &os, const tuple<T, U, V> &t){
  os << "(" << get<0>(t) << "," << get<1>(t) << "," << get<2>(t) << ")";
  return os;
}
template <typename T>
ostream &operator<<(ostream &os, const vector<T> &v){
  for (auto it = v.begin();it != v.end();++it){
    if(it != v.begin())os << " ";os << *it;
  }return os;
}
template <typename T, typename U>
ostream &operator<<(ostream &os, const map<T, U> &mp){
  for(auto x: mp)os << "(" << x.first << "," << x.second << ")" << endl;
  return os;
}
template<typename T, int SIZE>
int array_length(const T (&)[SIZE]){return SIZE;}
template<typename T, int N>
void PRINTF(const T (&a)[N], int s = N, int t = -1, bool f = true){
	if(t == -1){rep(i,s){if(i)cout << " ";cout << a[i];}}
	else repi(i,s,t){if(i!=s)cout << " ";cout << a[i];}
	if(f)cout << "\n";
}
template<typename T, int N1, int N2>
void PRINTF(const T (&a)[N1][N2], int h = N1, int w = N2){
	rep(i,h){rep(j,w){cout << a[i][j] << " \n"[j==w-1];}}
}
string substr(const string &str, int S1, int S2 = -1){
  if(S2 == -1)return str.substr(S1);
  return str.substr(S1, S2-S1);
}
// typedef
typedef complex<double> Point;
typedef pair<int, int> P;
typedef pair<int, P> PP;
typedef pair<P, int> Pi;
typedef tuple<int, int, int> TT;
typedef pair<int, TT> PT;
typedef vector<int> vi;
typedef deque<int> dq;
const int inf = 1e9+7;
const int INF = 1e18+7;
// int sum = accumulate(a, a+n, 0LL);
// int mx = max_element(a, a+n);
// int mn = min_element(a, a+n);
// int cnt = count(a, a+n, k);


signed main(){
  int a, b;cin >> a >> b;
  if(6 <= a and a <= 12)cout << b/2 << endl;
  else if(12 < a)cout << b << endl;
  else cout << 0 << endl;
  return 0;
}






Measured memory_bytes: 256
/*
      author : Nishikawa
      created: 10.08.2020 16:43:04
*/

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


int main(){
    int k,a,b;
    cin >> k >> a >> b;
    for(int i=a; i<=b; i++){
        if(i%k==0){
            cout << "OK" << endl;
            return 0;
        }
    }
    cout << "NG" << endl;
    return 0;
}

Measured memory_bytes: 3612
#include <bits/stdc++.h>
#define r(i, n) for (ll i=0;i<n;i++)
#define ll long long
#define llc(n) ll n; cin >> n;
using namespace std;
int main() {
  llc(n)
  vector<ll> x(n),y(n);
  r(i, n) cin >> x.at(i) >> y.at(i);
  double a=0,b=1,c,d;
  r(i,n-1) {
    for(int j=i+1;j<n;j++) {
      a+=sqrt((x.at(i)-x.at(j))*(x.at(i)-x.at(j))+(y.at(i)-y.at(j))*(y.at(i)-y.at(j)));
    d++;
    }
  }
  r(i,n) b=b*(i+1);
  c=a*2/n;
  cout << setprecision(10) << c  << endl;
  return 0;
}

Measured memory_bytes: 256
import sys, os, math, bisect, itertools, collections, heapq, queue
# from scipy.sparse.csgraph import csgraph_from_dense, floyd_warshall
from decimal import Decimal
from collections import defaultdict

# import fractions

sys.setrecursionlimit(10000000)

ii = lambda: int(sys.stdin.buffer.readline().rstrip())
il = lambda: list(map(int, sys.stdin.buffer.readline().split()))
fl = lambda: list(map(float, sys.stdin.buffer.readline().split()))
iln = lambda n: [int(sys.stdin.buffer.readline().rstrip()) for _ in range(n)]

iss = lambda: sys.stdin.buffer.readline().decode().rstrip()
sl = lambda: list(map(str, sys.stdin.buffer.readline().decode().split()))
isn = lambda n: [sys.stdin.buffer.readline().decode().rstrip() for _ in range(n)]

lcm = lambda x, y: (x * y) // math.gcd(x, y)
# lcm = lambda x, y: (x * y) // fractions.gcd(x, y)

MOD = 10 ** 9 + 7
MAX = float('inf')


def main():
    if os.getenv("LOCAL"):
        sys.stdin = open("input.txt", "r")

    N = ii()
    V = il()
    C = il()
    ret = 0
    for v, c in zip(V, C):
        ret = max(ret, ret + v - c)
    print(ret)


if __name__ == '__main__':
    main()


Measured memory_bytes: 10152
#include<bits/stdc++.h>
using namespace std;
int x;
int main() {
	scanf("%d",&x);
	for(int i=1;i<=x;i++) {
		double t=i;
		if(floor(t*1.08)==x) {
			cout<<i;
			return 0;
		}
	}
	cout<<":(";
	return 0;
}

Measured memory_bytes: 256
package main

import (
  "fmt"
  "sort"
)

func sumInt(a []int) int {
  s := 0
  for _, v := range a {s += v}
  return s
}

func main() {
  var c [3]int
  for i := 0; i < 3; i++ {fmt.Scan(&c[i])}
  sort.Ints(c[:])
  ans := "No"; if sumInt(c[:2]) == c[2] {ans = "Yes"}
  fmt.Println(ans)
}

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

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

#define FOR(i, n, m) for (ll(i) = (m); (i) < (n); ++(i))
#define REP(i, n) FOR(i, n, 0)
#define OF64 std::setprecision(10)

const ll MOD = 1000000007;
const ll INF = (ll)1e15;

ll dp[200005][2];

int main()
{
    string S;
    cin >> S;
    memset(dp, 0, sizeof(dp));
    ll N = S.length();
    REP(i, N)
    {
        dp[i + 1][0] = dp[i][1] + 1;
        if (i - 1 >= 0 && S[i] != S[i - 1])
            dp[i + 1][0] = std::max(dp[i + 1][0], dp[i][0] + 1);

        if (i - 1 >= 0)
            dp[i + 1][1] = dp[i - 1][0] + 1;
        if (i - 3 >= 0 && (S[i] != S[i - 2] || S[i - 1] != S[i - 3]))
            dp[i + 1][1] = std::max(dp[i + 1][1], dp[i - 1][1] + 1);
    }
    ll max = std::max(dp[N][0], dp[N][1]);
    cout << max << endl;

    return 0;
}

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

int main(){
    string s;
    cin >> s;
    string c,d,e,f;
    string a,b;
    c=s[0];
    d=s[1];
    e=s[2];
    f=s[3];
    a=c+d;
    b=e+f;

    if(a=="01" || a=="02" || a=="03" || a=="04" || a=="05" || a=="06" || a=="07" || a=="08" || a=="09" || a=="10" || a=="11" || a=="12"){
        if(b=="01" || b=="02" || b=="03" || b=="04" || b=="05" || b=="06" || b=="07" || b=="08" || b=="09" || b=="10" || b=="11" || b=="12"){
            printf("AMBIGUOUS\n");
        }
        else printf("MMYY\n");
    }

    else{
        if(b=="01" || b=="02" || b=="03" || b=="04" || b=="05" || b=="06" || b=="07" || b=="08" || b=="09" || b=="10" || b=="11" || b=="12"){
            printf("YYMM\n");
        }
        else printf("NA\n");
    }


}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
#define mp make_pair
#define fst first
#define snd second
#define fr(i, a, b) for(int i=a; i<b; i++)

string s;
int main() {
    cin >> s;
    int res = 1;
    string p = string(1, s[0]);
    for(int i=1; i<s.size(); i++) {
        if(string(1, s[i]) != p) {
            res++;
            p = string(1, s[i]);
        } else {
            if(i+1<s.size()) {
                p += string(1, s[i+1]);
                res++;
                i++;
            }
        }
    }
    cout << res << endl;
}


Measured memory_bytes: 640
#include<iostream>
#include<vector>
using namespace std;
int max(int a,int b,int c)
{
	return max(a,max(b,c));
}
int main()
{
	int n;
	cin>>n;
	vector<vector<int> >a(n,vector<int>(3));
	for(int i=0;i<n;i++)
	{
		for(int j=0;j<3;j++)
		{
			cin>>a[i][j];
		}
	}
	int dpa=a[0][0],dpb=a[0][1],dpc=a[0][2];
	int dpa1,dpb2,dpc3;
	for(int i=1;i<n;i++)
	{
		dpa1=max(dpb,dpc)+a[i][0];
		dpb2=max(dpa,dpc)+a[i][1];
		dpc3=max(dpb,dpa)+a[i][2];
		dpa=dpa1;
		dpb=dpb2;
		dpc=dpc3;			
	}
	cout<<max(dpa,dpb,dpc)<<endl;		
}


Measured memory_bytes: 5760
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cout.tie(NULL);
	char ch;
	cin>>ch;
	if(ch>=97)
	 cout<<"a";
	else
	 cout<<"A";
	return 0;
	
	
}



Measured memory_bytes: 3644
import java.util.Scanner;
public class Main {
	public static void main(String args[]) {
		Scanner in = new Scanner(System.in);
		int n = in.nextInt();
		int m = in.nextInt();
		if(n == m) {
			System.out.println("Yes");
		} else {
			System.out.println("No");
		}
	}
}


Measured memory_bytes: 21844
n, x = map(int, input().split())
l = list(map(int, input().split()))
L=0

for i in range(2,n+2):
    L += l[i-2]
    if i == n+1 and L<x:
        print(n+1)
        exit()

    if L > x:
        print(i-1)
        exit()
    if L == x:
        print(i)
        exit()

    else:
        continue

Measured memory_bytes: 3060
import java.util.*;
import java.math.BigInteger;

public class Main {
    static int MOD = 1000000007;
    public static void main(String[] args) throws Exception {
        // Your code here!
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int[] array = new int[n];
        
        for (int i = 0; i < n; i++) {
            array[i] = sc.nextInt();
        }
        
        BigInteger l = BigInteger.ONE;
        for (int i = 0; i < n; i++) {
            l = l.divide(l.gcd(BigInteger.valueOf(array[i]))).multiply(BigInteger.valueOf(array[i]));
        }
        
        
        long l2 = l.mod(BigInteger.valueOf(MOD)).longValue();
        
        long count = 0;
        for (int i = 0; i < n; i++) {
            count = (count + (l2 * modinv(array[i], MOD) % MOD)) % MOD;
        }
        
        
        System.out.println(count);
    }
    
    public static long lcm(long m, long n) {
        return m * (n / gcd(m, n) % MOD) % MOD;
    }
    
    public static long gcd(long a, long b) {
        if (b == 0) return a;
        
        return gcd(b, a % b) % MOD;
    }
    
    public static long modinv(long a, long m) {
        long b = m, u = 1, v = 0;
        while (b > 0) {
            long tmp = 0;
            long t = a / b;
            a -= t * b;
            
            tmp = a;
            a = b;
            b = tmp;
            
            u -= t * v;
            
            tmp = u;
            u = v;
            v = tmp;
        }
        u %= m;
        if (u < 0) u += m;
        
        return u;
    }
}


Measured memory_bytes: 150220
(defun lower-count (value rank max rest-count)
  (if (zerop rest-count) 
      max
      (let 
        ((n (read))
        (inc-value (+ value 1))
        (dec-rest (- rest-count 1)))
        (if (>= rank n)
            (lower-count inc-value n (max max inc-value) dec-rest)
            (lower-count 0 n max dec-rest)))))

(defun main ()
 (princ (lower-count 0 0 0 (read))))

(main)
      

Measured memory_bytes: 76736
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {

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

		int[] conis = new int[]{500, 100, 50, 10, 5, 1};
		int[] charge = new int[1000];
		for (int i = 1; i < charge.length; i++) {
			int k = 1000 - i;
			for (int coin : conis) {
				charge[i] += k / coin;
				k %= coin;
				if (k == 0) {
					break;
				}
			}
		}

		while ((line = br.readLine()) != null && !line.isEmpty()) {
			int n = Integer.parseInt(line);
			if (n == 0) {
				break;
			}
			System.out.println(charge[n]);
		}
	}
}

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


int main(void) {
  int n, d, x;
  cin >> n >> d >> x;
  vector<int> a(n);
  rep(i, n) {
    cin >> a[i];
  }

  int ans = 0;
  rep(i, n) {
    int j = 0;
    while (a[i] * j + 1 <= d) {
      ans++;
      j++;
    }
  }

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

Measured memory_bytes: 3624
#include<stdio.h>

int main(){
	int n, stackNum=0, stack[30];

	while(scanf("%d",&n)!=EOF){
		if(n==0){
			if(stackNum>0){
				printf("%d\n",stack[--stackNum]);
			}
		}
		else{
			stack[stackNum++] = n;
		}
	}
	return 0;
}

Measured memory_bytes: 600
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int N, X, T;
  cin >> N >> X >> T;  
  if(N%X != 0){
  cout << (N/X+1)*T << endl;
  }
  else{
  cout << (N/X)*T << endl;
  }
}

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

int main(){
    int K;
    cin >> K;
    int A,B;
    cin >> A >> B;
    int count=0;

    for(int i=A; i <=B; i++){
        if(i % K == 0){
            count++;
            break;
        }
    }
    if(count == 0){
        cout << "NG" << endl;
    }
    else{
        cout << "OK" << endl;
    }
}

Measured memory_bytes: 3636
#include "bits/stdc++.h"
#include "sstream"
#define EPS 1e-9
using namespace std;
const int N=1e5,INF=0x3f3f3f3f;
typedef long long ll;
int main()<%
int s,w; cin>>s>>w;
 cout<<((w>=s)?"unsafe":"safe");
%>

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

// 総数を1000000007で割った余り
const long long mod = 1e9 + 7;

using ll  = long long;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
#define ull unsigned long long
#define ld long double
#define vi vector<int>
#define vll vector<ll>
#define vc vector<char>
#define vs vector<string>
#define vpii vector<pii>
#define vpll vector<pll>

#define rep(i, n) for (int i = 0, i##_len = (n); i < i##_len; i++)
#define rep1(i, n) for (int i = 1, i##_len = (n); i <= i##_len; i++)
#define repr(i, n) for (int i = ((int)(n)-1); i >= 0; i--)
#define rep1r(i, n) for (int i = ((int)(n)); i >= 1; i--)

#define sz(x) ((int)(x).size())
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()

#define SORT(v, n) sort(v, v + n);
#define VSORT(v) sort(v.begin(), v.end());
#define RSORT(x) sort(rall(x));
#define pb push_back
#define mp make_pair

#define INF (1e9)
#define PI (acos(-1))
#define EPS (1e-7)

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

int func(long long n, std::vector<long long> a) {
    // cout << fixed << setprecision(8);

    while (n > 1) {
        sort(all(a));
        for (int i = 1; i < n; i++) {
            a[i] %= a[0];
            if (a[i] == 0) {
                a.erase(a.begin() + i);
                n--;
            }
        }

        // rep(j, n) { cout << a[j] << " "; }
        // cout << endl;
    }
    // cout << "END: ";
    // rep(j, n) { cout << a[j] << " "; }
    // cout << endl;
    cout << a[0] << endl;

    return 0;
}

int main() {
    long long N;
    scanf("%lld", &N);
    std::vector<long long> A(N);
    for (int i = 0; i < N; i++) {
        scanf("%lld", &A[i]);
    }

    func(N, std::move(A));

    return 0;
}


Measured memory_bytes: 1024
#include <iostream>
#include <string>
using namespace std;
int main(void){
    string s;
    cin>>s;
    if(s[0]==s[1]||s[1]==s[2]||s[2]==s[3]){
        cout << "Bad" <<endl;
    }else{
        cout << "Good" <<endl;
    }
}


Measured memory_bytes: 760
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
typedef long long ll;

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

    vector<int> num;

    for ( int i = min(a, b); i >= 1 ; i-- ) {
        if ( a % i == 0 & b % i == 0 ) {
            num.push_back(i);
//            cout << "test" << endl;
        }
    }

    cout << num[k-1] << endl;

    return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define REP(i,n) for(int i=0;i<(n);++i)
#define ALL(v)   (v).begin(),(v).end()
#define debug(x) cerr<<#x<<": "<<(x)<<endl
#define INF      (int)1e9
#define MOD      ((int)1e9+7)
using namespace std;
typedef long long     llong;
typedef pair<int,int> pii;
typedef vector<int>   vi;
typedef vector<vi >   vvi;
typedef vector<vvi >  vvvi;
template<class Type> void line(const Type &a){int cnt=0;for(auto &elem:a){if(cnt++)cout<<' ';cout<<elem;}cout<<endl;}

int main(){
	int n;
	string s;
	cin>>n>>s;
	
	int cnt=0;
	REP(i,n-2){
		string tmp=s.substr(i,3);
		debug(tmp);
		if(tmp=="ABC") cnt++;
	}

	cout<<cnt<<endl;
}


Measured memory_bytes: 256
#include <iostream>

int main()
{
    int a, b, c, d;
    std::cin >> a >> b >> c;

    if (a >= b) {
        d = a;
        a = b;
        b = d;
    }

    if (b >= c) {
        d = b;
        b = c;
        c = d;
    }

    if (a >= b) {
        d = a;
        a = b;
        b = d;
    }

    std::cout << a << " " << b << " " << c << std::endl;
    return 0;

}

Measured memory_bytes: 1164
//soale A
#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 20;
typedef long long ll;
ll n, m, mark[N], d = 0, a = 0;
vector <int> v[N];
queue <int> q;
void dfs(int x){
	for(int i = 0; i < v[x].size(); i ++){
		if(mark[v[x][i]] == 0){
			mark[v[x][i]] = 1;
			q.push(v[x][i]);
		}
	}
}
int main(){
	cin >> n >> m;
	a = n;
	for(int i = 0 ; i < m ; i ++){
		int x, y;
		cin >> x >> y;
		v[x].push_back(y);
		v[y].push_back(x);
	}
	dfs(1);
	if(mark[a] != 0){
		cout << "POSSIBLE";
	}
	while(!q.empty()){
		for(int i = 0; i < v[q.front()].size(); i ++){
			if(v[q.front()][i] == a){
				d = 1;
				break;
			}
		}
		if(d == 1){
			break;
		}
		q.pop();
	}
	if(d == 1){
		cout << "POSSIBLE";
	}
	else{
		cout << "IMPOSSIBLE";
	}
	return 0;
}

Measured memory_bytes: 13936
#include <math.h>
#include <stdio.h>

#define N 10
#define D 10

int isint(double a) {
	return a == ((int) a);
}

int main() {
	static int xx[N][D];
	int n, d, i, j, cnt;

	scanf("%d%d", &n, &d);
	for (i = 0; i < n; i++)
		for (j = 0; j < d; j++)
			scanf("%d", &xx[i][j]);
	cnt = 0;
	for (i = 0; i < n; i++)
		for (j = i + 1; j < n; j++) {
			int k, dist;

			dist = 0;
			for (k = 0; k < d; k++)
				dist += ((xx[i][k] - xx[j][k]) * (xx[i][k] - xx[j][k]));
			if (isint(sqrt(dist)))
				cnt++;
		}
	printf("%d\n", cnt);
	return 0;
}


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

using namespace std;

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

  string s;
  cin >> s;
  for (int i = 0; i < s.size(); ++i) {
    cout << 'x';
  }

  return 0;
}

Measured memory_bytes: 256
import java.util.ArrayList;
import java.util.Scanner;

public class Main {

	static Scanner sc = new Scanner(System.in);

	public static void main(String[] args) throws Exception {
		while (true) {
			char[] cs = sc.nextLine().toCharArray();
			if (cs[0] == '.') break;
			System.out.println(solve(cs) ? "yes" : "no");
		}
	}

	static boolean solve(char[] cs) {
		ArrayList<Character> stack = new ArrayList<Character>();
		for (char c : cs) {
			if (c == '(' || c == '[') {
				stack.add(c);
			} else if (c == ')') {
				if (!stack.isEmpty() && stack.get(stack.size() - 1) == '(') {
					stack.remove(stack.size() - 1);
				} else {
					return false;
				}
			} else if (c == ']') {
				if (!stack.isEmpty() && stack.get(stack.size() - 1) == '[') {
					stack.remove(stack.size() - 1);
				} else {
					return false;
				}
			}
		}
		return stack.isEmpty();
	}

}

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

    #define ff first
    #define ss second
    #define mp make_pair
    #define eb emplace_back
    #define trav(i,a) for(auto i: a)
    #define all(v) (v.begin(),v.end())
    #define rall(v) (v.rbegin(),v.rend())
    #define tc(t) ll t; cin>>t; while(t--)
    #define prec(n) fixed<<setprecission(n)
    #define mst(arr,value) memset(arr,value,sizeof(arr)) /* -1 or 0 */
    
    const long long sz = (long long)1e4+5;
    const long long mx = (long long)2e5+5;
    const long long inf = (long long)1e18;
    const long long mod = (long long)1e9+7;
    
    #define f(i,n)     for(ll i=0;   i<n;  i++)
    #define fab(i,a,b) for(ll i=a;   i<b;  i++)
    #define fr(i,n)    for(ll i=n-1; i>=0; i--)
    #define fba(i,b,a) for(ll i=b-1; i>=a; i--)

    long long pw(long long x,unsigned long long y) 
    { 
        if (y==0) return 1; 
        else if (y%2==0)  return pw(x,y/2)*pw(x,y/2); 
        else return x*pw(x,y/2)*pw(x,y/2);
    }

    int main() 
    {
        ios_base::sync_with_stdio(0);
        cin.tie(NULL);
        cout.tie(NULL);
        ll h,a,ans;
        cin>>h>>a;
        ans=h/a;
        if(h%a!=0) ans++;
        cout<<ans;
        return 0;
    }

Measured memory_bytes: 256
package main

import(
	"fmt"
)

func max(a,b int)int{
	if a>b {return a}
	return b
}

func max3(a,b,c int)int{
	return max(max(a,b),c)
}

func main(){
	var p,q,r int
	fmt.Scanln(&p,&q,&r)
	fmt.Println(p+q+r-max3(p,q,r))
}

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

using namespace std;

const int Maxn = 1e3+7;
const int Maxm = 50;

int n, k, tot;
int a[Maxn];
// cnt[i][j] 第i位为1的数第j位为0的个数
long long b[Maxn*Maxn], ans;
bitset<Maxn*Maxn> cnt[Maxm];

int main()
{
    cin >> n >> k;
    for(int i = 1; i <= n; ++i)
    {
        cin >> a[i];
        long long tmp = 0;
        for(int j = i; j; --j)
        {
            tmp += a[j];
            b[++tot] = tmp;
        }
    }
    sort(b+1, b+tot+1);
    reverse(b+1, b+tot+1);
    for(int i = 1; i <= tot; ++i)
    {
        for(int j = 0; (1ll<<j) <= b[i]; ++j)
            if(b[i]&(1ll<<j)) cnt[j].set(i);
    }

    int cur = Maxm, flag = 1;
    while(cur && flag)
    {
        flag = 0;
        for(int i = cur-1; i >= 0; --i)
            if(cnt[i].count() >= k)
            {
                flag = true;
                cur = i;
                ans += 1ll<<cur;
                // 选择了cur位,剩下的数的cur位必须为1
                for(int j = 0; j < cur; ++j) cnt[j] &= cnt[cur];
                break;
            }
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 10496
import java.util.*;

class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        int b = sc.nextInt();
        if ((a * b) % 2 == 0)
            System.out.println("Even");
        else
            System.out.println("Odd");
    }
}

Measured memory_bytes: 23892
#include <bits/stdc++.h>
using namespace std;
#define M 1000000007
long long int power(int a,int b)
{
    if(b==0)
        return 1;
    long long int k=power(a,b/2);
    if(b%2==0)
        return ((k%M)*(k%M))%M;
    else
        return ((k%M)*(k%M)*(a%M))%M;
}
long long int fact(long long int n)
{
    if(n==1 || n==0)
        return 1;
    else
        return ((n%M)*(fact(n-1)%M))%M;

}
int div(int n)
{  int c=0;
    for(int i=1;i<=sqrt(n);i++)
    {
        if(n%i==0)
        {
          if(n/i==i)
            c++;
          else
            c+=2;
        }

    }

    
    return  c;
}

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
     #ifndef ONLINE_JUDGE
 
    freopen("input.txt","r",stdin);
    freopen("output.txt","w",stdout);
 
   #endif
   
   string str;
   cin>>str;
   int n=0;
   int sum=0;
   for(int i=0;i<str.length();i++)
   {
       sum+=str[i]-48;
       n=n*10 + str[i]-48;

   }
   if(n%sum==0)
    cout<<"Yes";
   else
    cout<<"No";




 return 0;
}








Measured memory_bytes: 3672
using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.ComponentModel.Design;
using System.Globalization;
using System.Linq;
using System.Numerics;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading;
using System.Threading.Tasks;
using System.Xml.Schema;
using static System.Console;

namespace ConsoleApp2
{
    class Program
    {
        static public long[] Sarray() { return ReadLine().Split().Select(long.Parse).ToArray(); }
        static public List<int> Slist() {
            var t = ReadLine();
            if (t.Trim().Length == 0) return new List<int>();
            return new List<int>(t.Split().Select(int.Parse)); }
        static void Main(string[] args)
        {
            ReadLine();
            var t = Sarray();
            WriteLine(t.Length==t.Distinct().Count()?"YES":"NO");
        }
    }
}


Measured memory_bytes: 43784
#include<iostream>
#include<algorithm>
#include<iomanip>
using namespace std;
int main() {
  int a,b;
  cin >> a >> b;
  double x,y;
  x=a,y=b;
  cout << a/b << " " << a%b << " " << fixed << setprecision(10) << x/y << endl;
}


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

int main(){
    char a;
    cin >> a;
    if(a >= 'A' && a <= 'Z') cout << 'A' << endl;
    else if(a >= 'a' && a <= 'z') cout << 'a' << endl;
    return 0;
}

Measured memory_bytes: 3632
#include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
int main() {
	int N;
	cin >> N;
	vector<int> A(N);
	vector<int> B(N);
	int count = 0;
	for (int i = 0; i < N; i++) {
		cin >> A[i];
		B[i] = A[i];
	}
	sort(B.begin(), B.end());
	int Max = B[N - 1];
	int Mid = B[N - 2];
	for (int i = 0; i < N; i++) {
		if (Mid == Max) {
			cout << Max << endl;
		}
		else {
			if (A[i] == Max) {
				cout << Mid << endl;
			}
			else {
				cout << Max << endl;
			}
		}
	}
	return 0;
}

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

int main() {
    int N, K;

    cin >> N >> K;

    vector<long long int> P(N);
    long double E;
    vector<long double> S(N+1,0);

    for (int i = 0; i < N; ++i) cin >> P.at(i);


    for (int i = 0; i < N; ++i) {
        E = (P.at(i) + 1)/2.0;
        S.at(i+1) = S.at(i) + E;
    }

    long double tmp = 0;
    long double result = 0;

    for (int i = 0; i < N-K+1; ++i) {
        tmp = S.at(K + i) - S.at(i);
        if (result < tmp) result = tmp;
    }

    
    cout << setprecision(10) << result << endl;
    
    return 0;
}

Measured memory_bytes: 4992
//
//  main.cpp
//  matrix-multiplication
//
//  Created by 黒田浩揮 on 2019/04/22.
//  Copyright © 2019 黒田浩揮. All rights reserved.
//

#include<iostream>
using namespace std;

long long numbers[101][101];
long long numbers2[101][101];
long long numbers3[101][101];

int main() {
    // insert code here...
    long long n,m,l,b,u;
    cin>>n>>m>>l;
    u=0;
    for (int v=0; v<n; v++) {
        for (int t=0; t<m; t++) {
            cin>>b;
            numbers[v][t]=b;
        }
    }
    for (int v=0; v<m; v++) {
        for (int t=0; t<l; t++) {
            cin>>b;
            numbers2[v][t]=b;
        }
    }
    for (int v=0; v<n; v++) {
        for (int t=0; t<l; t++) {
            u=0;
            for (int y=0; y<m; y++) {
                u+=numbers[v][y]*numbers2[y][t];
            }
            numbers3[v][t]=u;
        }
    }
    for (int v=0; v<n; v++) {
        for (int t=0; t<l; t++) {
            cout<<numbers3[v][t];
            if(t!=l-1)cout<<" ";else cout<<endl;
        }
    }
    
    
    return 0;
}



Measured memory_bytes: 3288
object Main {
  def main(args: Array[String]): Unit = {
    val n = io.StdIn.readLine().toInt
    val ints: Seq[Int] = io.StdIn.readLine().split(" ").map(_.toInt)
    val (arr, cnt) = if (n > 1) bubbleSort(ints, n) else (ints, 0)
    println(arr.mkString(" "))
    println(cnt)
  }

  def bubbleSort(arr: Seq[Int], n: Int): (Seq[Int], Int) = {
    arr.recursiveFunc(0)
  }

  implicit class RichSeq(seq: Seq[Int]) {
    def recursiveFunc(sumSwapCnt: Int): (Seq[Int], Int) = {
      seq.bubble(seq.length - 1, 0) match {
        case (a, 0) => (a, sumSwapCnt)
        case (a, x) => a.recursiveFunc(sumSwapCnt + x)
      }
    }

    def bubble(idx: Int, swapCnt: Int): (Seq[Int], Int) = {
      (seq.sortSwap(idx, swapCnt), idx) match {
        case (t, 1) => t
        case (t, n) => t._1.bubble(idx - 1, t._2)
      }
    }

    def sortSwap(i: Int, cnt: Int): (Seq[Int], Int) = {
      if (seq(i) < seq(i - 1)) (seq.swap(i, i - 1), cnt + 1) else (seq, cnt)
    }

    def swap(i: Int, j: Int): Seq[Int] = seq.updated(j, seq(i)).updated(i, seq(j))

  }

  implicit class RichObj[T](obj: T) {
    def tap[U](f: T => U): T = {
      f(obj);
      obj;
    }
  }

}


Measured memory_bytes: 59424
#[allow(dead_code)]
fn is_whitespace(c: &char) -> bool {
    c.is_whitespace()
}

#[allow(dead_code)]
fn is_eol(c: &char) -> bool {
    ['\r', '\n'].contains(c)
}

#[allow(unused_macros)]
macro_rules! input {
    ($var:ident, $($r:tt)*) => {
        input_inner!{$var, $($r)*}
    };

    ($($r:tt)*) => {
        let stdin = std::io::stdin();
        let mut bytes = std::io::Read::bytes(std::io::BufReader::new(stdin.lock()));
        #[allow(unused_mut, unused_variables, bare_trait_objects)]
        let mut next = move |f: &Fn(&char)->bool| -> String{
            bytes
                .by_ref()
                .map(|r|r.unwrap() as char)
                .skip_while(|c|f(&c))
                .take_while(|c|!f(&c))
                .collect()
        };
        input_inner!{next, $($r)*};
    };
}

#[allow(unused_macros)]
macro_rules! input_inner {
    ($next:expr) => {};
    ($next:expr, ) => {};

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

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

#[allow(unused_macros)]
macro_rules! read_value {
    ($next:expr, ( $($t:tt),* )) => {
        ( $(read_value!($next, $t)),* )
    };

    ($next:expr, [ $t:tt ; eol ]) => {
        $next(&is_eol).split(' ').map(|x| x.parse::<$t>().unwrap()).collect::<Vec<_>>()
    };

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

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

    ($next:expr, bytes) => {
        read_value!($next, String).into_bytes()
    };

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

    ($next:expr, parser) => {
        $next
    };

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

#[allow(unused_imports)]
use std::cmp::{max, min};
#[allow(unused_imports)]
use std::collections::{BinaryHeap, HashMap};

#[allow(dead_code)]
type Graph = Vec<Vec<usize>>;
#[allow(dead_code)]
const M: usize = 1e9 as usize + 9;

fn main() {
    input! {
        c: chars
    }

    println!("{}", (c[0] as u8 + 1) as char);
}


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

int main()
{
  int n;

  while (cin >> n, n){
    int Max = -1, Min = 501, num;
    while (n--){
      int sum = 0;
      for (int i = 0; i < 5; i++){
        cin >> num;
        sum += num;
      }
      Max = max(sum, Max);
      Min = min(sum, Min);
    }
    cout << Max << ' ' << Min << endl;
  }
  return (0);
}

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

const int mod = 1000000007;

int main(){
    int n;
    cin >> n;
    vector<int> p(n);
    rep(i, n) cin >> p[i];
    int ans = n;
    int max = p[0];
    for (int i = 0; i < n;i++){
        if(max<p[i]){
            ans--;
        }
        if(max>p[i]){
            max = p[i];
        }
    }
    cout << ans << endl;
}

Measured memory_bytes: 1024
#include <iostream>

using namespace std;

typedef long long ll;

int main()
{
    ios_base::sync_with_stdio(0);
    ll n;
    cin >> n;
    ll odp = n / 500 * 1000;
    n %= 500;
    odp += n / 5 * 5;
    cout << odp;
    return 0;
}


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

using namespace std;

int main()
{
    int n,m,i,h,sum=0;
    cin>>n>>m;
    for(i=1;i<=n;i++)
    {
        scanf("%d",&h);
        if(h>=m)
            sum++;
    }
    cout<<sum<<endl;
    return 0;
}


Measured memory_bytes: 384
#include <stdio.h>
#include <stdlib.h>
#include <iostream>
#include <iomanip>
#include <vector>
#include <string.h>
#include <string>
#include <map>
#include <stack>
#include <queue>
#include <deque>
#include <set>
#include <math.h>
#include <algorithm>
#include <numeric>

using namespace std;

// マクロ&定数 ============================================================
typedef unsigned int uint;
typedef long long ll;
//typedef pair<int, int> P;
typedef vector<int> vint;
typedef vector<ll> vll;
typedef vector<double> vdouble;
typedef vector<bool> vbool;

typedef vector<vector<int>> vvint;
typedef vector<vector<ll>> vvll;
typedef vector<vector<double>> vvdouble;
typedef vector<vector<bool>> vvbool;

const int INF = 1e9 + 1;
const ll LLINF = 1e17 + 1;
const int DX[9] = { 0,0,1,-1, 1, 1, -1, -1, 0 }; // 4;４近傍
const int DY[9] = { 1,-1,0,0, 1, -1, 1, -1, 0 }; // 8:８近傍 9:(0,0)を含む
const ll MOD = 1e9 + 7; //10^9 + 7
const double PI = 3.14159265358979323846264338327950288;
//========================================================================

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

	string S;
	cin >> S;
	ll K;
	cin >> K;

	int seq = 0;
	int N = S.length();

	for (int i = 0; i < N; i++) {

		for (int j = 1;i + j < N; j++) {
			if (S[i] == S[i+j]) {

				if (j % 2 == 1) {
					seq++;
				}				

				if (i + j == N - 1) {
					i = INF;
					break;
				}
			}
			else {
				i += j - 1;
				break;
			}
		}



	}


	ll ans = seq * K;

	if (S[0] == S[N - 1]) {

		int last = 0;
		for (int i = 0; i < N; i++) {
			if (S[0] == S[i]) {
				last++;
			}
			else {
				break;
			}
		}
		for (int i = N - 1; i >= 0; i--) {
			if (S[0] == S[i]) {
				last++;
			}
			else {
				break;
			}
		}

		if (last == N * 2) {
			cout << N * K / 2;
			return 0;
		}
		else {


			if (last % 2 == 1) {
				cout << ans;
				return 0;
			}
			else {

				int len = 0;
				for (int i = 0; i < N; i++) {
					if (S[i] == S[0]) {
						len++;
					}
					else {
						break;
					}
				}


				if (len % 2 == 0) {
					cout << ans;
					return 0;
				}
				else {
					cout << ans + K - 1 ;
					return 0;
				}
			}

		}



	}
	else {
		cout << ans;
		return 0;
	}



}

Measured memory_bytes: 256