akhauriyash/Code-Regression huggingface dataset:
#include <stdio.h>
#include <math.h>
#include <iostream>
#include <algorithm>
#include <vector>
#include <numeric>
#include <string>
#include <map>
#include <stack>
#include <bits/stdc++.h>
using namespace std;
typedef long long int lli;
#define urept(soeji, start, n) for (int soeji = start; soeji < n; soeji++)
#define drept(soeji, start, n) for (int soeji = start; soeji > n; soeji--)
int main(void)
{
    int N, K;
    cin >> N >> K;
    double p[N];
    double E[N + 1];
    for (int i = 0; i < N; i++)
    {
        cin >> p[i];
    }
    fill(E, E + N + 1, 0.0);
    double tmp = 0.0;
    for (int i = 1; i <= N; i++)
    {
        tmp = (1.0 + p[i - 1]) / 2.0;
        E[i] = E[i - 1] + tmp;
        tmp = 0;
    }
    double ans = -1.0;
    for (int i = 0; i <= N - K; i++)
    {
        ans = max(ans, E[i + K] - E[i]);
    }
    cout << fixed << setprecision(15) << ans << endl;
    return 0;
}


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


ll func( ll N ) {
  ll cnt = 0;
  while( N > 2 ) {
    N --;
    N -= (N+1)/2;
    cnt++;
  }

  return cnt;
}

int main()
{
  ll X;
  cin >> X;

  ll l = 0, r = 1e18;
  while( r - l  > 1 ) {
    ll mid = (r + l) / 2;
    ll x = func( mid );
    if( x <= X ) {
      l = mid;
    } else {
      r = mid;
    } 
  }

  if( func( l ) == X && func( r ) == X ) {
    cout << r << endl;
  } else cout << l << endl;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using pint = pair<int,  int>;
using pll = pair<ll, ll>;
using edge = pair<int, ll>;
using Graph = vector<vector<int>>; 
using WeightedGraph = vector<vector<edge>>;
const ll INF = 1LL << 60;
const int INF32 = 1 << 29;
const ll MOD = 1000000007;

int main(){
  ld n; ll m,d;
  cin >> n >> m >> d;
  ld tmp = n;
  if(d!=0)tmp= 2*(n-d);
  ld ans = tmp/(n*n);
  ans *= m-1;
  cout << fixed << setprecision(10);
  cout << ans << endl;
}


Measured memory_bytes: 384
#include<iostream>
#include<string>
#include<cstdio>
#include<vector>
#include<cmath>
#include<algorithm>
#include<functional>
#include<iomanip>
#include<queue>
#include<ciso646>
#include<random>
#include<map>
#include<set>
#include<complex>
#include<bitset>
#include<stack>
#include<unordered_map>
#include<utility>
#include<cassert>

using namespace std;

const int MOD = 1000000007;
typedef pair<int, int> P;
typedef long long ll;
#define rep(i, m, n) for(int i=m;i<n;i++)
#define rrep(i, n, m) for(int i=n;i>=m;i--)


ll dp[100010][2];

int main() {
    string L;
    cin >> L;
    int n = L.length();

    dp[0][0] = 1;
    for (int i = 1; i <= n; ++i) {
        if (L[i - 1] == '1') {
            dp[i][0] += 2 * dp[i - 1][0] % MOD;
            dp[i][1] += dp[i - 1][0] % MOD;
        } else {
            dp[i][0] += dp[i - 1][0] % MOD;
        }
        dp[i][1] += dp[i - 1][1] * 3 % MOD;
    }
    cout << (dp[n][0] + dp[n][1]) % MOD << endl;
}

Measured memory_bytes: 2048
#include <iostream>
#include <cmath>
#include <string>
#include <algorithm>
#include <set>
#include <vector>
#include <map>
#include <list>
#include <stack>
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <queue>
#define mkp make_pair
#define pr(num) cout << num << "\n"
#define max(a, b) ((a)>(b) ? (a):(b))
#define min(a, b) ((a)<(b) ? (a):(b))
#define INF 1000000000000000000
#define MOD 1000000007LL
#define MAX 100100
using namespace std;
typedef long long ll;
typedef pair<ll, ll> P;
typedef map<ll, ll> Map;



int main(void) {
    ll N, K;
    cin >> N >> K;
    ll h[MAX];
    ll i, j;
    ll dp[MAX];
    
    for(i=0; i<N; i++) {
        dp[i]=INF;
    }
    dp[0]=0;
    
    for(i=0; i<N; i++) {
        cin >> h[i];
    }
    
    for(i=0; i<N; i++) {
        for(j=1; j<=K; j++) {
            dp[i+j]=min(dp[i+j], dp[i]+abs(h[i+j]-h[i]));
        }
    }
    
    pr(dp[N-1]);
}













Measured memory_bytes: 1792
from collections import defaultdict
INF = float('inf')
def main():
    N, X, Y = map(int, input().split())
    d = defaultdict(lambda: 0)
    for i in range(1,N+1):
        for j in range(1, N + 1):
            if i < j:
                dist = min(min(abs(j - i), abs(X - i) + 1 + abs(j - Y)), abs(Y - i) + 1 + abs(j - X))
                d[dist] += 1
    for i in range(1, N):
        print(d[i])

if __name__ == '__main__':
    main()

Measured memory_bytes: 50908
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>

#define ll long long int
#define pb push_back
#define eb emplace_back
#define xx first
#define yy second
#define INF 0x3f3f3f3f

using namespace std;
using namespace __gnu_pbds;

mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
typedef tree<pair<int,int>,null_type, less<pair<int,int>>,rb_tree_tag,tree_order_statistics_node_update>   ordered_set;
const int N=1e5+10, mod=1e9+7;
ll dp[110][N]; int n,a[110];
/*
ll calc(int i,int rem){
	if( i==n ){
		return (rem==0);
	}
	ll &ans= dp[i][rem];
	if(ans!=-1) return ans;
	ans=0;
	for(ll j=0;j<=min((ll)rem,a[i]);j++){
		ans+=calc(i+1,rem-j);
		if(ans>=mod)ans-=mod;
	}
	ans%=mod;
	return ans;
}
*/

int main(){
	ios_base::sync_with_stdio(0);	cin.tie(0);
	int i,j,k;
	for(i=0;i<110;i++) for(j=0;j<N;j++) dp[i][j]=0;
	
	cin>>n>>k;
	for(i=0;i<n;i++)cin>>a[i];
	dp[0][k]=1;
	for(i=0;i<n;i++){
		for(j=0;j<=k;j++){
			dp[i+1][max(0,j-a[i])]+=dp[i][j]; dp[i+1][j+1]-=dp[i][j];
			dp[i+1][max(0,j-a[i])]%=mod; dp[i+1][j+1]=(dp[i+1][j+1]+mod)%mod;
		}
		for(j=1;j<=k;j++)dp[i+1][j]=( dp[i+1][j-1] + dp[i+1][j] )%mod;
	}
	
	cout<<dp[n][0];
}

// check for any potential overflow before submitting


Measured memory_bytes: 86272
#include <bits/stdc++.h>
using namespace std;
int f[100020];
long long n, m, x, y, z1, z2, z;
int F(int x) {
	return f[x] != x ? f[x] = F(f[x]) : x;
}
int main() {
	cin >> n >> m;
	for (int i = 1; i <= n; i++) {
		f[i] = i;
	}
	for (int i = 1; i <= m; i++) {
		scanf("%d%d", &x, &y);
		f[F(x)] = F(y);
	}
	for (int i = 1; i <= n; i++) {
		if (F(i) == F(1)) {
			z1++;
		}
		if (F(i) == F(2)) {
			z2++;
		}
	}
	z = min(z1, z2);
	printf("%lld\n", n * (n - 1) / 2 - z * (n - z) - m);
	return 0;
}

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

int main() {
  vector<int>a(3),b(3);
  vector<int> vec(4);
  rep(i,3)cin>>a[i]>>b[i];
  rep(i,3){
    vec[a[i]-1]++;vec[b[i]-1]++;
  }
  rep(i,4){
    if(vec[i]==3){
      cout<<"NO"<<endl;
      return 0;
    }
  }
  cout<<"YES"<<endl;
}

Measured memory_bytes: 3596
#include <bits/stdc++.h>
using namespace std;
#define int               long long
#define pb                push_back
#define ppb               pop_back
#define pf                push_front
#define ppf               pop_front
#define all(x)            (x).begin(),(x).end()
#define uniq(v)           (v).erase(unique(all(v)),(v).end())
#define sz(x)             (int)((x).size())
#define fr                first
#define sc                second
#define pii               pair<int,int>
#define rep(i,a,b)        for(int i=a;i<b;i++)
#define mem1(a)           memset(a,-1,sizeof(a))
#define mem0(a)           memset(a,0,sizeof(a))
#define ppc               __builtin_popcount
#define ppcll             __builtin_popcountll

template<typename T1,typename T2>istream& operator>>(istream& in,pair<T1,T2> &a){in>>a.fr>>a.sc;return in;}
template<typename T1,typename T2>ostream& operator<<(ostream& out,pair<T1,T2> a){out<<a.fr<<" "<<a.sc;return out;}
template<typename T,typename T1>T amax(T &a,T1 b){if(b>a)a=b;return a;}
template<typename T,typename T1>T amin(T &a,T1 b){if(b<a)a=b;return a;}

const long long INF=1e18;
const int32_t M=1e9+7;
const int32_t MM=998244353;

const int N=0;



void solve(){
	int n;
	cin>>n;
	int ans = 1;
	rep(i,0,n){
		int a;
		cin>>a;
		if(a == 0){
			cout<<0;
			return;
		}
		if(ans == -1 || ans > INF / a){
			ans = -1;
		}
		else ans *= a;
	}
	if(ans > INF){
		ans = -1;
	}
	cout<<ans;
}
signed main(){
	ios_base::sync_with_stdio(false);
	cin.tie(0);cout.tie(0);
	//freopen("input.txt", "r", stdin);
	//freopen("output.txt", "w", stdout);
	#ifdef SIEVE
		sieve();
	#endif
	#ifdef NCR
		init();
	#endif
	int t=1;
	//cin>>t;
	while(t--) solve();
	return 0;
}


Measured memory_bytes: 3604
n, m, l = map(int, input().split())

a = []

for _ in range(n):
  a.append([i for i in map(int, input().split())])

b = []

for _ in range(m):
  b.append([i for i in map(int, input().split())])

for i in range(n):
  row = []
  for j in range(l):
    row.append(sum([a[i][k] * b[k][j] for k in range(m)]))
  print(' '.join(map(str, row)))



Measured memory_bytes: 6252
#include <iostream>
#include <algorithm>
#include <cmath>
#include <vector>
#include <string>
//typedef long long LL;
using namespace std;

int main(){
    int n;
    int m;
    int k;
    int loop_n;
    int tmp;
    bool allon;
    int tmp_c;
    int ans=0;
    vector<int> p;

    cin >> n >> m;
    vector<vector<int>> s(m);

    loop_n = (int)pow(2,n);
    for(int i=0; i<m; i++){
        cin >> k;
        s[i].resize(k);
        for(int j=0; j<k; j++){
            cin >> s[i][j];
            s[i][j]--;
        }
    }
    for(int i=0; i<m; i++){
        cin >> tmp;
        p.push_back(tmp);
    }
    for(int i=0; i<loop_n; i++){
        allon = true;
        for(int j=0; j<m; j++){
            tmp_c = 0;
            for(int id : s[j]){
                if((i >> id) & 1){
                    tmp_c++;
                }
            }
            tmp_c = tmp_c%2;
            if(tmp_c !=p[j]){
                allon = false;
            }
        }
        if(allon){
            ans++;
        }
    }
    cout << ans << endl;
}

Measured memory_bytes: 256
#include <stdio.h>

/* this is prime */
#define MOD_BY 100000007

int getInv(int x) {
	int nowzyou=MOD_BY-2;
	long long now=x;
	long long result=1;
	while(nowzyou>0) {
		if(nowzyou & 2)result=(result*now)%MOD_BY;
		now=(now*now)%MOD_BY;
		nowzyou>>=1;
	}
	if((result*x)%MOD_BY!=1)result=MOD_BY-result;
	return (int)result;
}

int nCr(int n,int r) {
	long long result=1;
	int i;
	for(i=n;i>n-r;i--)result=(result*i)%MOD_BY;
	for(i=1;i<=r;i++)result=(result*getInv(i))%MOD_BY;
	return (int)result;
}

int main(void) {
	int w,h,sx,sy,dx,dy;
	int x,y,x1,y1,x2,y2,now;
	int result;
	scanf("%d%d%d%d%d%d",&w,&h,&sx,&sy,&dx,&dy);
	x=(w-dx)+(sx-0);
	now=(w-sx)+(dx-0);if(now<x)x=now;
	x1=x;
	now=dx-sx;if(now<0)now=-now;if(now<x)x=now;
	x2=now;
	y=(h-dy)+(sy-0);
	now=(h-sy)+(dy-0);if(now<y)y=now;
	y1=y;
	now=dy-sy;if(now<0)now=-now;if(now<y)y=now;
	y2=now;
	result=nCr(x+y,x);
	if(x1==x2)result=(result*2)%MOD_BY;
	if(y1==y2)result=(result*2)%MOD_BY;
	printf("%d\n",result);
	return 0;
}

Measured memory_bytes: 600
#include <iostream>
	#include <set>
	#include <map>
	#include <cmath>
	#include <vector>
	#include <string>
	#include <algorithm>
	#include <iomanip>
	#include <queue>
	#include <deque>
	#include <stack>
	#include <climits>
	#include <math.h>
	using namespace std;
	#pragma warning(disable : 4996)
	typedef long long ll;
	typedef unsigned long long ull;




	int main() {
	#ifdef _DEBUG
		freopen("input1.txt", "r", stdin);
		freopen("output2.txt", "w", stdout);
	#endif
		ios_base::sync_with_stdio(false);
		cin.tie(0);
		ll a, b;
		cin >> a >> b;
		for (int i = 1; i < 1000000; i++) {
			if (i * 8 / 100 == a && i / 10 == b) {
				cout << i;
				return 0;
			}
		}
		cout << -1;
	}

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

def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)

    # divisors.sort()
    return divisors


while True:
    divisors = make_divisors(x)
    if len(divisors) == 2:
        print(x)
        exit(0)
    x += 1

Measured memory_bytes: 3060
#include<bits/stdc++.h>
using namespace std;
int main(){
    int n,ans=0;
    string S,A;
    cin>>S;
    n=S.size();
    for(int i=0;i<n;++i){
     A[i]=S[n-1-i];
    }
    for(int i=0;i<n/2;++i){
         if(S[i]!=A[i])ans++;
            
            
        }
    
    cout<<ans<<endl;
}

Measured memory_bytes: 256
/*
 HINT
#include<ctype.h>
    int islower(char ch): ch が小文字なら true を返す
    int isupper(char ch): ch が大文字なら true を返す
    int tolower(char ch): ch の小文字を返す
    int toupper(char ch): ch の大文字を返す
*/

#include<stdio.h>
#include<ctype.h>
main()
{
	char ch;
	
	while(1){
		scanf("%c",&ch);
		if(ch=='\n') break;
		
		if(islower(ch)!=0) printf("%c",toupper(ch));
		else if(isupper(ch)!=0) printf("%c",tolower(ch));
		else printf("%c",ch);
	}
	printf("\n");
	
	return 0;
}

Measured memory_bytes: 524
#include <iostream>
#include <string>
#include <algorithm>
#include <functional>
#include <vector>
#include <utility>
#include <cstring>
#include <iomanip>
#include <numeric>
#include <cmath>
#include <queue>
#include <map>
using namespace std;
typedef long long ll;
const int INF = 1<<30; 
const int MOD = 1e9 + 7;
const int dy[] = {1, 0, -1, 0};
const int dx[] = {0, 1, 0, -1};
int main()
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    int n, m;
    while(cin >> n >> m, n | m)
    {
        int h[n + 1], w[m + 1];
        for(int i = 0; i < n; i++) cin >> h[i];
        for(int i = 0; i < m; i++) cin >> w[i];
        map<int, int> mp;
        for(int i = 0; i < n; i++)
        {
            int sum = h[i];
            mp[sum]++;
            for(int j = i + 1; j < n; j++)
            {
                sum += h[j];
                mp[sum]++;
            }
        }
        int ans = 0;
        for(int i = 0; i < m; i++)
        {
            int sum = w[i];
            ans += mp[sum];
            for(int j = i + 1; j < m; j++)
            {
                sum += w[j];
                ans += mp[sum];
            }
        }
        cout << ans << endl;
    }
    return 0;
}





Measured memory_bytes: 20900
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
#include <bits/stdc++.h>
#define ll long long
#define ld long double
#define rep2(i, a, b) for(ll i = a; i <= b; ++i)
#define rep(i, n) for(i = 0; i < n; ++i)
#define rep3(i, a, b) for(ll i = a; i >= b; --i)
using namespace std;

// _________コーディングはここから！！___________

int n, m, k, i;
constexpr int N = 200010;
int a[N], b[N];
constexpr int sz = 5000000;
char reader[sz];
char *pos = reader;
int nn, now, ans;
int kk;
main() {
    reader[fread(reader, sizeof(char), sizeof(char) * sz, stdin)];
    while('0' <= *pos) n = n * 10 + *pos++ - '0';
    pos++;
    while('0' <= *pos) m = m * 10 + *pos++ - '0';
    pos++;
    while('0' <= *pos) k = k * 10 + *pos++ - '0';
    nn = n;
    pos++;
    rep(i, n) {
        while('0' <= *pos) {
            a[i + 1] <<= 1;
            a[i + 1] += a[i + 1] << 2;
            a[i + 1] += *pos++ - '0';
        }
        pos++;
        a[i + 1] += a[i];
        if(a[i + 1] > k) {
            nn = i;
            ++i;
            for(; i < n; ++i) {
                while('0' <= *pos) pos++;
                pos++;
            }
            break;
        }
    }
    rep(i, m) {
        while('0' <= *pos) {
            b[i + 1] <<= 1;
            b[i + 1] += b[i + 1] << 2;
            b[i + 1] += *pos++ - '0';
        }
        pos++;
        b[i + 1] += b[i];
        if(b[i + 1] > k) {
            m = i;
            break;
        }
    }
    now = ans = nn;
    for(i = 1; i <= m; i++) {
        kk = k - b[i];
        while(a[now] > kk) now--;
        ans = max(ans, i + now);
    }
    pos = reader;
    i = 0;
    do {
        *pos++ = ans % 10 + '0';
        ans /= 10;
        i++;
    } while(ans);
    reverse(reader, reader + i);
    fwrite(reader, sizeof(char), sizeof(char) * i, stdout);
}


Measured memory_bytes: 7860
/* {{{ Shinobu kawaii */
/*
  ______   __        _                  __                 
.' ____ \ [  |      (_)                [  |                
| (___ \_| | |--.   __   _ .--.   .--.  | |.--.   __   _   
 _.____`.  | .-. | [  | [ `.-. |/ .'`\ \| '/'`\ \[  | | |  
| \____) | | | | |  | |  | | | || \__. ||  \__/ | | \_/ |, 
 \______.'[___]|__][___][___||__]'.__.'[__;.__.'  '.__.'_/ 
                                                           
*/
/* }}} */

#include <bits/stdc++.h>
using namespace std;

// #define int long long

/* cpp template {{{ */

/* short */
#define pb push_back
#define mp make_pair
#define print(x) cout << x << '\n'
#define Fi first
#define Se second

/* REPmacro */
#define REPS(i, a, n) for (int i = (a); i < (n); i++)
#define REP(i, n) for (int i = 0; i < (n); i++)
#define RREP(i, n) for (int i = 1; i <= (n); i++)
#define DEPS(i, a, n) for (int i = (a); i >= n; i--)
#define DEP(i, n) for (int i = (n); i >= 0; i--)

/* typedef */
typedef long long ll;
typedef unsigned long long ull;
typedef vector<int> vi;
typedef vector<vector<int> > vii;
typedef pair<int, int> pii;

/* const */
const int INF = 999999999;
const int dx[] = {0, 1, 0, -1, 1, -1, 1, -1}, dy[] = {1, 0, -1, 0, 1, -1, -1, 1};

/* func */
inline bool is_uruu(int y) {return (y % 4 == 0 && (y % 100 != 0 || y % 400 == 0));}
inline bool inside(int y, int x, int H, int W) {return (y >= 0 && x >= 0 && y < H && x < W);}

/* }}} */

signed main()
{
  cin.tie(0);
  ios::sync_with_stdio(false);
  int n, m;
  cin >> n >> m;
  vi a(n);
  REP(i, n) cin >> a[i];

  RREP(i, m){
    REP(j, n - 1){
      if (a[j] % i > a[j + 1] % i) swap(a[j], a[j + 1]);
    }
  }

  REP(i, n){
    print(a[i]);
  }

  return (0);
}

Measured memory_bytes: 1204
function Main(input) {
  const values = input.split('\n');
  const mountainsSize = values[0];
  const mountainHeights = values[1].split(' ').map(value => Number(value));
  var maxHeight = mountainHeights[0];
  console.log(
    mountainHeights.filter(height => {
      if (maxHeight < height) {
        maxHeight = height;
      }
      return height >= maxHeight;
    }).length
  );
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));


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

int main(){
  int n;
  cin >> n;
  vector<int> l(n);
  int sum = 0;
  for(auto& i : l){
    cin >> i;
    sum += i;
  }
  sort(l.begin(),l.end());
  sum -= *l.rbegin();
  if(sum > *l.rbegin())
    cout << "Yes" << endl;
  else
    cout << "No" << endl;
}

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

#define REP(i, n) for(ll i = 0; i < (ll)(n); i++)

int bs(vector<int> A, int start, int end, int value) {
//    cout << "checking " << start << " - " << end << endl;
    if (end - start == 1) {
//        cout << "returning " << start << endl;
        return end;
    }
    int mid = (start + end) / 2;
    if (A[mid] >= value) {
        return bs(A, start, mid, value);
    } else {
        return bs(A, mid, end, value);
    }
}

int main(int argc, const char * argv[]) {
    int N, M;
    cin >> N >> M;
    vector<int> A = vector<int>(N, 0);
    REP(i, N) {
        cin >> A[i];
    }
    
    sort(A.begin(), A.end());
    
    while (M > 0) {
        M--;
        int item = A[N-1] / 2;
        int target;
        A.erase(A.begin() + N - 1);
        if (N == 1) {
            target = 0;
        } else if (A[0] >= item) {
            target = 0;
        } else if (A[N-2] <= item) {
            A.push_back(item);
            continue;
        } else {
            A.insert(lower_bound(A.begin(), A.end(), item), item);
            continue;
        }
        A.insert(A.begin() + target, item);
    }
    
    ll sum = 0;
    
    REP(i, N) {
        sum += A[i];
    }
    
    cout << sum << endl;
    return 0;
}


Measured memory_bytes: 640
#include <stdio.h>

int main (){
	
	int a,b,c;
	scanf ("%d", &a);
	scanf ("%d", &b);
	if (a == 1 && b == 2 || a == 2 && b == 1){
		printf ("3");
	}
	else if (a == 1 && b == 3 || a == 3 && b == 1){
		printf ("2");
	}
	else if(a == 2 && b == 3 || a == 3 && b == 2){
		printf ("1");
	}
	return 0;
}

Measured memory_bytes: 1600
#include<bits/stdc++.h>
typedef long long int ll;
typedef unsigned long long int ull;
#define BIG_NUM 2000000000
#define HUGE_NUM 99999999999999999
#define MOD 1000000007
#define EPS 0.000000001
using namespace std;


int POW[3] = {1,2,4};
int table[8] = {0,1,2,3,3,2,1,0};

int func(char head,double degree,double LEN){

	if(head == 'D'){

		degree += 60;
	}else if(head == 'B'){

		degree += 120;
	}

	double rad = degree*(M_PI/180);

	double x = 30+LEN*(cos(rad)-sin(rad)/sqrt(3));
	double y = LEN*sin(rad)*(2.0/sqrt(3));

	int X = (int)floor(x);
	int Y = (int)floor(y);

	double x_add = x-floor(x);
	double y_add = y-floor(y);

	int num = 0;
	if(X%2 == 1){

		num += POW[2];
	}

	if(Y%2 ==1){

		num += POW[1];
	}
	if(x_add+y_add >= 1.0){

		num += POW[0];
	}
	return table[num];
}

int main(){

	char buf[3];
	double degree,LEN;

	scanf("%s %lf %lf",buf,&degree,&LEN);

	int value_1 = func(buf[0],degree,LEN);

	scanf("%s %lf %lf",buf,&degree,&LEN);

	int value_2 = func(buf[0],degree,LEN);

	if(value_1 == value_2){

		printf("YES\n");

	}else{

		printf("NO\n");
	}

	return 0;
}



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

int main(){
  int a,b,k;
  cin >> a >> b >> k;
  if(b-a+1 > k*2){
    for(int i=0;i<k;i++){
      cout << a+i << endl;
    }
    for(int i=0;i<k;i++){
      cout << b-(k-1)+i << endl;
    }
  }else{
    for(int i=a;i<=b;i++){
      cout << i << endl;
    }
  }
  return 0;
}


Measured memory_bytes: 256
#include<stdio.h>
int main()
{
    int a,b,c=0,d=10,i,j,k,p,x,ii;
    scanf("%d %d",&a,&b);
    for(i=a;i<=b;i++)
    {
        j=0;
        x=i;
         ii=i;
        while(ii>0)
        {

            p=ii%10;
            k=d*j+p;
            ii=ii/10;
            j=k;
        }


        if(x==k)
        {
            c++;
        }
    }
    printf("%d\n",c);
    return 0;
}


Measured memory_bytes: 128
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();
        int c = sc.nextInt();
        sc.close();
        try {
            if(a < b && b < c) {
                System.out.println("Yes");
            } else {
                System.out.println("No");
            }
        }catch(InputMismatchException e) {
            e.printStackTrace();
        }
        
    }
}


Measured memory_bytes: 26212
using System;
class Program
{
	static void Main(string[] args)
	{
		String str = Console.ReadLine();
		int cnt = 0;
		for (int i = 0; i < 6; i++)
		{
			if (str.Substring(i, 1).Equals("1"))
			{
				cnt++;
			}			
		}
		//出力
		Console.WriteLine(cnt);
	}
}

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

int main(){
  int k;
  cin >> k;
  
  queue<int64_t> que;
  for(int i = 1; i < 10; i++)
    que.push(i);
  
  int i = 0;
  int64_t x;
  while(i < k){
    i++;
    x = que.front();
    que.pop();
    if(x%10 != 0)
      que.push(10*x + x%10 -1);
    que.push(10*x + x%10);
    if(x%10 != 9)
      que.push(10*x + x%10 +1);
  }
  
  cout << x << endl;
  
  return 0;
}

Measured memory_bytes: 5084
#include<stdio.h>
int main(void)
{
	char s[3],t[3];
	int i,c;
	scanf("%s",s);
	scanf("%s",t);
	c=0;
	for(i=0;i<3;i++){
		if(s[i]==t[i])	c++;
	}
	printf("%d\n",c);
	return 0;
}
	

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

int X1, Y1, X2, Y2;

int main(void){
    
    scanf("%d %d %d %d", &X1, &Y1, &X2, &Y2);
    printf("%d %d %d %d", X2 - (Y2 - Y1), Y2 + (X2 - X1), X1 - (Y2 - Y1), Y1 + (X2 - X1));
    
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int main() {
  string S;
  cin >> S;
  int N = S.size();
  std::vector<std::string>s1(N/2);
  std::vector<std::string>s2(N/2);
  s1.at(0) = S.at(0);
  s2.at(0) = S.at(1);
  for (int i = 1; i < (N-1)/2; i++) {
    s1.at(i) = s1.at(i-1) + S.at(i);
    s2.at(i) = S.at(i+1);
    for (int j = 0; j < i; j++) {
      s2.at(i) += S.at(i+j+2);
    }
  }
  int M;
  for (int i = 0; i < (N-1)/2; i++) {
    if (s1.at(i) == s2.at(i)){
      M = (i+1)*2;
    }
  } 
  cout << M << endl;
}

Measured memory_bytes: 3588
#include<bits/stdc++.h>
using namespace std;
int main(){
  long H,W;cin>>H>>W;
  long dp[10][10];
  for(long i=0;i<10;i++)for(long j=0;j<10;j++){
    cin>>dp[i][j];
  }
  for(long k=0;k<10;k++)for(long i=0;i<10;i++)for(long j=0;j<10;j++){
    dp[i][j]=min(dp[i][j],dp[i][k]+dp[k][j]);
  }
  long ans=0;
  for(long i=0;i<H;i++)for(long j=0;j<W;j++){
    long c;cin>>c;
    if(c!=-1)ans+=dp[c][1];
  }
  cout<<ans<<endl;
}
/*

*/

Measured memory_bytes: 3632
/*  -*- coding: utf-8 -*-
 *
 * d.cc: D - Knapsack 1
 */

#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<iostream>
#include<string>
#include<vector>
#include<map>
#include<set>
#include<stack>
#include<list>
#include<queue>
#include<deque>
#include<algorithm>
#include<numeric>
#include<utility>
#include<complex>
#include<functional>

using namespace std;

/* constant */

const int MAX_N = 100;
const int MAX_W = 100000;

/* typedef */

typedef long long ll;

/* global variables */

ll dp[MAX_W + 1];

/* subroutines */

void setmax(ll &a, ll b) { if (a < b) a = b; }

/* main */

int main() {
  int n, w;
  scanf("%d%d", &n, &w);

  memset(dp, -1, sizeof(dp));
  dp[0] = 0;

  for (int i = 0; i < n; i++) {
    int wi, vi;
    scanf("%d%d", &wi, &vi);

    for (int j = w - wi; j >= 0; j--)
      if (dp[j] >= 0)
	setmax(dp[j + wi], dp[j] + vi);
  }

  ll maxd = 0;
  for (int i = 0; i <= w; i++) setmax(maxd, dp[i]);
  printf("%lld\n", maxd);
  return 0;
}


Measured memory_bytes: 1024
N = gets.to_i
A = gets.split.map(&:to_i).sort

MAX = 10**6
dp = Array.new(10**6 + 1) { false }

ans = 0
A.size.times do |i|
  n = A[i]
  next if dp[n]

  ans += 1 if n != A[i+1]

  n.step(MAX, n) do |nn|
    dp[nn] = true
  end
end

puts(ans)


Measured memory_bytes: 38400
#include<bits/stdc++.h>
#define REP(i,n) for(int i=0;i<n;i++)
using namespace std;
int main(){
    int X,Y,Z,ans=0;
    cin>>X>>Y>>Z;
    X-=Z;
    for(;;){
        if(X-Y-Z<0){
            cout<<ans<<endl;
            return 0;
        } else {
            ans++;
            X-=Y+Z;
        }
    }
}

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

int main()
{	
	//??\???1
	int n = 0;
	cin >> n;

	vector < int > v_m;
	v_m.resize(n);
	for(int i = 0; i < n; ++i)
	{
		cin >> v_m[i];
	}

	//?????§????????????
	int s_max = -2000000000;
	int s_min = v_m[0];
	for(int i = 1; i < n; ++i)//???
	{
		s_max = max(s_max,v_m[i]-s_min);
		s_min = min(s_min,v_m[i]);
	}

	cout << s_max << endl;
	return 0;
}

Measured memory_bytes: 1796
//Radhe Radhe
#include<bits/stdc++.h>
#define ll long long
#define fixed cout.setf(ios::fixed);
#define Precise cout.precision(7);
using namespace std;

int main()
{
   // ll n,x,prev,cnt=1;
    string s;
    cin>>s;
    for(ll i=0;s[i];i++)
    {
        cout<<"x";

    }
    cout<<endl;

    return 0;
}





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

const int N = 100;

int main(){

    int n, minj;
    int num = 0;
    int A[N];

    cin >> n;
    for (int i = 0; i < n; i++) cin >> A[i];
    for (int i = 0; i < n; i++) {
       minj = i; 
       for (int j = i; j < n; j++) {
           if(A[minj] > A[j]) minj = j;
       }
       swap(A[i],A[minj]);
       if(i != minj) num++;
    }

    for (int i = 0; i < n - 1; i++) cout << A[i] << " ";
    cout << A[n - 1] << "\n" << num << "\n";
    
    return 0;
}



Measured memory_bytes: 3096
#include<cstdio>
#include<cstring>
#include<algorithm>
#include<vector>
#include<stack>
#include<map>
using namespace std;

const int MAXN=2e5+5;

int n,k,l;
int co[MAXN],ans[MAXN],vis[MAXN];
vector<int> E[MAXN],G[MAXN];
stack<int> st;
map<int,int> sum;

void dfs(int u,int f){
    co[u]=f;
    for(int i=0;i<(int)E[u].size();i++){
        int v=E[u][i];
        if(co[v]) continue;
        dfs(v,f);
    }
}

void dfs2(int u){
    vis[u]=1;
    sum[co[u]]++;
    st.push(u);
    for(int i=0;i<(int)G[u].size();i++){
        int v=G[u][i];
        if(vis[v]) continue;
        dfs2(v);
    }
}

int main(){
    scanf("%d%d%d",&n,&k,&l);
    for(int i=1;i<=k;i++){
        int u,v;
        scanf("%d%d",&u,&v);
        E[u].push_back(v);
        E[v].push_back(u);
    }
    for(int i=1;i<=l;i++){
        int u,v;
        scanf("%d%d",&u,&v);
        G[u].push_back(v);
        G[v].push_back(u);
    }
    int ncnt=0;
    for(int i=1;i<=n;i++){
        if(co[i]) continue;
        ncnt++;
        dfs(i,ncnt);
    }
    for(int i=1;i<=n;i++){
        if(vis[i]) continue;
        sum.clear();
        dfs2(i);
        while(!st.empty()){
            int h=st.top(); st.pop();
            ans[h]=sum[co[h]];
        }
    }
    for(int i=1;i<=n;i++)
        printf("%d ",ans[i]);
}


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

int main(){
   long long N;
   cin >> N;
   string res = "";
   while (N) {
      --N;
      res += (char)('a' + (N % 26));
      N/= 26;
   }
   reverse(res.begin(), res.end());
   cout << res << endl;
   return 0;
}


Measured memory_bytes: 3588
N = int(input())
s = input().split()

# b = ''
# for ss in s:
#     b += ss
#     print(b)
#     b = b[::-1]
# print(" ".join(b))

ans = []
if N % 2 == 1:
    for ss in s[::-1][0::2]:
        ans.append(ss)
    for ss in s[1::2]:
        ans.append(ss)
else:
    for ss in s[::-1][0::2]:
        ans.append(ss)
    for ss in s[0::2]:
        ans.append(ss)
print(" ".join(ans))


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

bitset<1001001001> is_prime(0);
vector<int> prime_numbers;
void sieve_of_eratosthenes(int n=1e7) {
  for (int i = 2; i < n + 1; i++) {is_prime.set(i);}
  for (int i = 2; i < (int)sqrt(n) + 1; i++) {
    if (is_prime[i]) for (int j = i * 2; j < n + 1; j += i) is_prime.reset(j);
  }
  for (int i = 2; i < n + 1; i++) if (is_prime[i]) prime_numbers.push_back(i);
}

unordered_map<int, int> prime_factorize(int n) {
  unordered_map<int, int> res;
  int border = int(sqrt(n));
  for (int &p : prime_numbers) {
    if (p > border) break;
    if (n % p == 0) {
      res[p] = 1; n /= p;
      while (n % p == 0) {res[p]++; n /= p;}
    }
    if (n == 1) return res;
  }
  res[n] = 1; return res;
}

unordered_map<int, int> prime_factorize_factorial(int n) {
  unordered_map<int, int> res;
  for (int i = 2; i < n + 1; i++) {
    for (auto &pc : prime_factorize(i)) {
      if (res.find(pc.first) == res.end()) res[pc.first] = pc.second;
      else res[pc.first] += pc.second;
    }
  }
  return res;
}

int MOD = 1e9 + 7;

int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n;
  cin >> n;
  sieve_of_eratosthenes(1e8);
  long long res = 1;
  for (auto &pc : prime_factorize_factorial(n)) {
    res *= pc.second + 1; res %= MOD;
  }
  cout << res << '\n';
  return 0;
}

Measured memory_bytes: 47460
#include<iostream>
#include<iomanip>
#include<vector>
#include<map>
#include<string>
#include<set>
#include<cmath>
#include<tuple>
#include<utility>
#include<functional>
#include<algorithm>

#define LL long long

using namespace std;

int K,N,A[1000005],maxi=0;

int main() {
	cin>>K>>N;
	for(int i=0;i<N;i++)cin>>A[i];
	A[N]=A[0]+K;
	for(int i=0;i<N;i++)maxi=max(maxi,A[i+1]-A[i]);
	cout<<K-maxi<<endl;
	return 0;
}



Measured memory_bytes: 1024
#include <iostream>

using namespace std;

int calc(int k)
{
    int result;

    if (k % 2 != 0) {
        result = (k + 1) * (k - 1) / 4; 
    } else {
        result = k * k / 4;
    }

    return result;
}

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

    cout << calc(k) << endl;
}


Measured memory_bytes: 256
fun abs(n: Int) = if (n > 0) n else -n

fun main(args: Array<String>) {
    val n = readLine()!!.toInt()
    val ws = readLine()!!.split(" ").map { it.toInt() }
    println((1 until n).map { abs(ws.take(it).sum() - ws.drop(it).sum()) }.min()!!)
}

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

using namespace std;

typedef long long ll;

ll MOD = 1000000007;

int main(int, char**) {
	int k, n;
	cin >> n >> k;
	int smax = 0;
	int now = 0;
	vector<int> ps;
	for (int i=0; i<n; i++) {
		int p; cin >> p;
		ps.push_back(p);
		if (i < k - 1) {
			now += p;
		} else {
			now += p;
			now -= ps[i - k];
			if (now > smax) smax = now;
		}
	}
	double ret = (smax + k) / 2.0;
	cout << setprecision(8) << ret << endl;
	return 0;
}

Measured memory_bytes: 1400
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;

class Program {
    static void Main (string[] args) {
        string[] s = Console.ReadLine ().Split(' ');
        int a = int.Parse(s[0]);
        int b = int.Parse(s[1]);

        int tasu = a + b;
        int hiku = a - b;
        int kake = a * b;

        int ans = System.Math.Max(tasu,hiku);
        ans = System.Math.Max(ans,kake);

        Console.WriteLine(ans);

    }
}

Measured memory_bytes: 13140
import java.util.*;
import static java.lang.Math.abs;
import static java.lang.Math.min;

public class Main{
public static void main(String... argv){
Scanner sc=new Scanner(System.in);
int n=sc.nextInt();
int ans=0;
for(int i=0;i<n;i++){
int l=sc.nextInt();
ans+=sc.nextInt()-l+1;
}
System.out.println(ans);
}
}

Measured memory_bytes: 24916
#include <bits/stdc++.h>
using namespace std;
/* typedef */
typedef long long ll;
typedef pair<int, int> pii;
/* constant */
const int INF = 1 << 30;
const ll LINF = 1LL << 50;
const int NIL = -1;
const int MAX = 10000;
const int mod = 1000000007;
const double pi = 3.141592653589;
/* global variables */
map<int, int> factor;
/* function */
void primeFactrization(int n) {
    int x = n;
    if (x < 2) {
        return ;
    }
    for (int i = 2; i * i <= n; i++) {
        while (x % i == 0) {
            factor[i]++;
            x /= i;
        }
    }
    if (x != 1) { factor[x]++; }
}
/* main */
int main(){
    int N;
    cin >> N;
    for (int i = 1; i <= N; i++) { primeFactrization(i); }

    int ans = 0;
    vector<int> nums{74, 24, 14, 4, 2,};
    map<int, int> cnt;
    for (int n : nums) {
        for (auto f : factor)
            if (f.second >= n) cnt[n]++;
    }
    ans += cnt[74];
    ans += cnt[14] * (cnt[4] - 1);
    ans += cnt[24] * (cnt[2] - 1);
    ans += cnt[4] * (cnt[4] - 1) / 2 * (cnt[2] - 2);
    cout << ans << '\n';
}

Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <cstdio>
#include <cmath>
#include <string>
#include <cctype>
#include <stack>
#include <queue>
#include <vector>
#include <cstdlib>
#include <list>

using namespace std;

int main(void) {

	int W, H, N,cnt = 0;
	int ans[100][100] = {0};
	int x[100] = {0}, y[100] = { 0 }, a[100] = { 0 };

	cin >> W >> H >> N;

	for (int i = 0; i < H; i++) {
		for (int j = 0; j < W; j++) {
			ans[i][j] = 1;
		}
	}

	for (int k = 0; k < N; k++) {
		cin >> x[k] >> y[k] >> a[k];
		switch (a[k])
		{
		case 1 :
			for (int i = 0; i < H; i++) {
				for (int j = 0; j < x[k]; j++) {
					ans[i][j] = 0;
				}
			}
			break;

		case 2:
			for (int i = 0; i < H; i++) {
				for (int j = x[k] ; j < W; j++) {
					ans[i][j] = 0;
				}
			}
			break;

		case 3:
			for (int i = 0; i < y[k] ; i++) {
				for (int j = 0; j < W; j++) {
					ans[i][j] = 0;
				}
			}
			break;

		case 4:
			for (int i = y[k] ; i < H; i++) {
				for (int j = 0; j < W; j++) {
					ans[i][j] = 0;
				}
			}
			break;
		}
	}

	for (int i = 0; i < H; i++) {
		for (int j = 0; j < W; j++) {
			if (ans[i][j] == 1)
				cnt++;
		}
	}

	cout << cnt << endl;

	return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define REP(i, e) for(int (i) = 0; (i) < (e); ++(i))
#define FOR(i, b, e) for(int (i) = (b); (i) < (e); ++(i))
#define ALL(c) (c).begin(), (c).end()
#define PRINT(x) cout << (x) << "\n"
using namespace std;
using ll = long long; using pint = pair<int, int>; using pll = pair<ll, ll>;
const long long MOD = 1000000007;

signed main(){
    ll N, K;
    string S;
    cin >> N >> K >> S;
    ll group = 1;
    REP(i, N - 1){
        if(S[i] != S[i + 1]) group++;
    }
    while(K > 0 && group > 2){
        group -= 2;
        K--;
    }
    if(group == 2 && K > 0) group = 1;
    PRINT(N - group);
    return 0;
}

Measured memory_bytes: 3760
#include <iostream>
#include <string>
#include <stdio.h>
#include <cmath>
#include <cfloat>
#include <algorithm>
#include <numeric>
#include <vector>
#include <iterator>
#include <set>
using namespace std;

const double PI=acos(-1);

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

    vector<long> b(n-1);
    long sum = 0;
    for(int i = 0; i < n-1; i++){
        cin >> b[i];
    }
    sum += b[n-2];
    for(int i = n-2; i >= 0; i--){
        if(i == 0) sum += b[0];
        else sum += min(b[i], b[i-1]);
    }
    cout << sum << endl;
    return 0;
}

Measured memory_bytes: 256
#include<stdio.h>
int main(void)
{
	int a[3],w,i,j;
	for(i=0;i<3;i++){
	    scanf("%d",&a[i]);
	}
	for(i=0;i<2;i++){
	    for(j=i+1;j<3;j++){
		    if(a[i]>a[j]){
			    w=a[i];
				a[i]=a[j];
				a[j]=w;
			}
		}
	}
	printf("%d\n",a[0]+a[1]);
	return 0;
}

Measured memory_bytes: 128
N=int(input())
a=list(map(int, input().split()))
a.insert(0, 0)
b=[0 for _ in range(N+1)]
for i in range(N, 0, -1):
    s=0
    for j in range(i, N+1, i):
        s=s^b[j]
    b[i]=s^a[i]
ans=[]
for i in range(1, N+1):
    if b[i]==1:
        ans.append(i)
print(len(ans))
if len(ans):
    print(" ".join(map(str, ans)))


Measured memory_bytes: 80232
use std::io;
use std::str::FromStr;

fn input_int_tuple() -> (i32, i32) {
  let mut line: String = String::new();
  io::stdin().read_line(&mut line);
  let vec: Vec<i32> = line.split_whitespace().map(|s| s.parse().unwrap()).collect();
  (vec[0], vec[1])
}

fn input_i32_vec() -> Vec<i32> {
  let mut line: String = String::new();
  io::stdin().read_line(&mut line);
  line.split_whitespace().map(|s| s.parse().unwrap()).collect()
}

fn main() {
  let (n, m) = input_int_tuple();
  let mut vec = input_i32_vec();
  if m == 1 || n >= vec.len() as i32 {
    println!("0");
    return
  }
  vec.sort();
  let mut d: Vec<i32> = Vec::new();
  for i in 0..(vec.len()-1) {
    d.push(vec[i+1] - vec[i]);
  }
  d.sort_by(|x, y| y.cmp(x));
  let mut sum = 0;
  for i in 0..n-1 {
    sum += d[i as usize];
  }
  //println!("{}", sum);
  println!("{:?}", vec.pop().unwrap() - vec[0] - sum);
}


Measured memory_bytes: 4352
//07, 07, 2018, 09:04:38 Rafaelcs cpp
#include <bits/stdc++.h>

using namespace std;
typedef pair<int, int> pii;
typedef long double ld;
typedef long long ll;

typedef unsigned long long ull;

int main(){
    ios::sync_with_stdio(false);
    cin.tie(NULL);
    
    string s;
    int w;

    cin >> s >> w;

    string r = "";

    for(int i = 0 ; i < s.length() ; i++){
        if(i % w == 0){
            cout << s[i];
        }
    }

    cout << endl;
    
    return 0;
}

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

using ll = long long;
using boost::irange;

int main(){

    int N;
    cin >> N;

    float ans;
    if (N % 2 == 0) ans = 0.5;
    else ans = (N/2 + 1) / (float)N;    

    cout << setprecision(10) << ans << endl;

    return 0;
}

Measured memory_bytes: 256
var input = require('fs').readFileSync('/dev/stdin', 'utf8');
var lines = (input.trim()).split(/\n/g);
var rank;

for (var i = 0; i < lines.length; i++) {
    if (lines[i] === '-1 -1 -1') break;

    var line = lines[i].split(' ').map(Number),
        m = line[0],
        f = line[1],
        r = line[2];
    
    if (m === -1 || f === -1) rank = 'F';
    else if (80 <= m + f) rank = 'A';
    else if (65 <= m + f) rank = 'B';
    else if (50 <= m + f) rank = 'C';
    else if (30 <= m + f) {
        if (50 <= r) rank = 'C';
        else rank = 'D';
    }
    else rank = 'F';
    
    console.log(rank);
}

Measured memory_bytes: 15520
#include <stdio.h>

int main(void) {
  int powder;
  int donuts;
  int costs[100] = {};
  int nokori;
  int i;
  int lowest_cost = 9999;
  int ans;
  scanf("%d %d", &donuts, &powder);
  nokori = powder;
  for (i = 0; i < donuts; i++) {
    scanf("%d", &costs[i]);
    nokori -= costs[i];
    if (costs[i] < lowest_cost) {
      lowest_cost = costs[i];
    }
  }
  ans = donuts + nokori / lowest_cost;
  printf("%d\n", ans);
  return 0;
}


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

/* 大文字を小文字に変換 */
char tolower(char c) {return (c + 0x20);}
/* 小文字を大文字に変換 */
char toupr(char c) {return (c - 0x20);}

// if('A'<=s[i] && s[i]<='Z') s[i] += 'a'-'A';

/*
string s = "abcdefg"
s.substr(4) "efg"
s.substr(0,3) "abc"
s.substr(2,4) "cdef"

// イテレータ要素のインデックス
distance(A.begin(), itr);
*/

const int INF = 10000000;

int main()
{
    int N; int L; cin >> N >> L;
    vector<int> Apple(N);
    int sum = 0; int min_i; int min_n = INF;
    rep(i,N){
        Apple[i] = L + i;
        sum += L+i;
        if(min_n > abs(L+i)){
            min_i = i;
            min_n = abs(L+i);
        }
    }
    int sum2 = 0;
    rep(i,N){
        if(min_i != i){
            sum2 += Apple[i];
        }
    }
    cout << sum2 << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define pb push_back
using namespace std;
const int INF=0x3f3f3f3f;
const int maxn=100005;

struct edge{int to,cost;};

int n,m,s;
int d[maxn];
int qh,qt,q[maxn];
bool ok=1,inq[maxn];
vector<edge>G[maxn];

int main() {
	cin>>n>>m>>s;
	for (int i=0;i<m;i++) {
		int u,v,w; cin>>u>>v>>w;
		G[u].pb(edge{v,w});
	}
	memset(d,0x3f,sizeof(d));
	d[s]=0;
	q[qt++]=s; inq[s]=1;
	while (qh!=qt) {
		int u=q[qh++]; if (qh>=maxn) qh=0;
		inq[u]=0;
		for (edge e:G[u]) {
			if (d[e.to]>d[u]+e.cost) {
				d[e.to]=d[u]+e.cost;
				if (!inq[e.to]) {
					q[qt++]=e.to; if (qt>=maxn) qt=0;
					inq[e.to]=1;
				}
			}
		}
	}
    for (int i=0;i<n;i++) 
		if (d[i]==INF) cout<<"INF"<<'\n';
		else cout<<d[i]<<'\n';
}



Measured memory_bytes: 12828
def main():

    N = input()
    D = list(map(int,input().split()))
    M = max(D)
    countlist=[0] * (M + 1)
    ans=1

    for i in D:
        countlist[i]+=1

    if countlist[0]!=1 :
        ans = 0
    else :
        if D[0]!=0 :
            ans = 0
        else:
            for i in range(2,M+1):
                ans *= (countlist[i-1]**countlist[i])
                ans = ans  % 998244353

    print(ans) 

if __name__ == "__main__":
    main()

Measured memory_bytes: 14396
#include <stdio.h>
 
int main(void) {
  int h, m, s, t;
  scanf("%d", &t);
  s = t % 60;
  t /= 60;
  m = t % 60;
  t /= 60;
  h = t;
  printf("%d:%d:%d\n", h, m, s);
  return 0;
}


Measured memory_bytes: 2712
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.HashMap;
import java.util.HashSet;


public class Main {
	public static void main(String[] args) throws IOException {
		BufferedReader bf = new BufferedReader(new InputStreamReader(System.in));
		String[] data = bf.readLine().split(" ");
		int N = Integer.parseInt(data[0]),M = Integer.parseInt(data[1]);
		int x,y;
		int[]can;
		HashMap<Integer, int[]> Hm = new HashMap<>(N);
		HashSet<Integer> posibles = new HashSet<>();
		for(int i=1; i<=N; i++){
			int[] cant = {1};
			Hm.put(i, cant);
		}
		posibles.add(1);
		for(int i =0; i<M; i++){
			data = bf.readLine().split(" ");
			x = Integer.parseInt(data[0]);
			y = Integer.parseInt(data[1]);
			can = Hm.get(x);
			can[0]=can[0]-1;
			if(posibles.contains(x)){
				posibles.add(y);
			}
			if(can[0]==0){
				posibles.remove(x);
			}
			can = Hm.get(y);
			can[0]++;
		}
		System.out.println(posibles.size());
	}
}


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

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

    char c;
    cin>>c;
    if(c=='A')
    {
        cout<<'T'<<endl;
    }
    else if(c=='T')
    {
        cout<<'A'<<endl;
    }
    else if(c=='C')
    {
        cout<<'G'<<endl;
    }
    else 
    {
        cout<<'C'<<endl;
    }
}

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

using namespace std;
#define mp make_pair
#define pb push_back
#define ff first
#define ss second
#define sz size
#define FOR(i,a,b) for(int i=a;i<b;i++)
#define FORN(i,a,b) for(int i=a;i<=b;i++)
#define FORRN(i,a,b) for (int i=(a);i>=(b);i--)
#define FORR(i,a,b) for (int i=(a);i>(b);i--)
typedef unsigned long long ull;
typedef long long ll;

int main(){
    ios_base::sync_with_stdio(false); //Fast I/O
    cin.tie(0);
    cout.tie(0);
	//freopen("input.in","r",stdin);
	//freopen("output.out","w",stdout);

    int n;
    cin >> n;

    double res=0;

    while(n--){
        double x;
        string s;
        cin >> x >> s;
        if(s=="BTC"){
            res+=x*(380000.0);
        }else{
            res+=x;
        }
    }

    cout << res << endl;

    return 0;
}


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

typedef long long ll;
#define REP(i, n) for(ll i = 0 ; i < n; i++)

//#define DEBUG(fmt, ...)
#define DEBUG(fmt, ...) fprintf(stderr, fmt "\n", ##__VA_ARGS__)

int main(){
    std::cout<<std::fixed<<std::setprecision(10);

    ll N;
    ll R;

    cin >> N >> R;
    if( N < 10 ){
        cout << R + (100*(10-N)) << endl;
    }else{
        cout << R << endl;
    }
}


Measured memory_bytes: 256
n = gets.to_i
s = gets.chomp
t = gets.chomp
mod = 1000000007

res = (s[0] == t[0]) ? 3 : 6
i = (s[0] == t[0]) ? 1 : 2
while i < n do
  if s[i] == t[i]
    res = res * (s[i-1] == t[i-1] ? 2 : 1) % mod
    i += 1
  else
    res = res * (s[i-1] == t[i-1] ? 2 : 3) % mod
    i += 2
  end
end

p res

Measured memory_bytes: 3836
#include <iostream>
#include <vector>

int main() {
    int N;
    std::cin >> N;

    std::vector<int> d;

    for (int i = 0; i < N; ++i) {
        int value;
        std::cin >> value;
        d.push_back(value);
    }

    std::sort(d.begin(), d.end());
    d.erase(std::unique(d.begin(), d.end()), d.end());

    std::cout << d.size() << std::endl;

    return 0;
}


Measured memory_bytes: 256
/**
 * @brief ユーザ定義リテラル
 * @author えびちゃん
 */

#ifndef H_int_literals
#define H_int_literals

#include <cstddef>
#include <cstdint>

constexpr intmax_t  operator ""_jd(unsigned long long n) { return n; }
constexpr uintmax_t operator ""_ju(unsigned long long n) { return n; }
constexpr size_t    operator ""_zu(unsigned long long n) { return n; }
constexpr ptrdiff_t operator ""_td(unsigned long long n) { return n; }

#endif  /* !defined(H_int_literals) */

/**
 * @brief 多次元 vector の作成
 * @author えびちゃん
 */

#ifndef H_make_vector
#define H_make_vector

#include <cstddef>
#include <type_traits>
#include <vector>

namespace detail {
  template <typename Tp, size_t N>
  std::vector<Tp> make_vector(
      std::vector<size_t>& sizes,
      typename std::enable_if<(N == 1), Tp const&>::type x
  ) {
    return std::vector<Tp>(sizes[0], x);
  }
  template <typename Tp, size_t N>
  auto make_vector(
      std::vector<size_t>& sizes,
      typename std::enable_if<(N > 1), Tp const&>::type x
  ) {
    size_t size = sizes[N-1];
    sizes.pop_back();
    return std::vector<decltype(make_vector<Tp, N-1>(sizes, x))>(
        size, make_vector<Tp, N-1>(sizes, x)
    );
  }
}  // detail::

template <typename Tp, size_t N>
auto make_vector(size_t const(&sizes)[N], Tp const& x = Tp()) {
  std::vector<size_t> s(N);
  for (size_t i = 0; i < N; ++i) s[i] = sizes[N-i-1];
  return detail::make_vector<Tp, N>(s, x);
}

#endif  /* !defined(H_make_vector) */

#include <cstdio>
#include <cstdint>
#include <algorithm>
#include <numeric>
#include <string>
#include <tuple>
#include <utility>
#include <vector>

bool ok(std::string const& a, std::vector<size_t> const& s, std::vector<char> const& c) {
  for (size_t i = 0; i < s.size(); ++i) {
    if (a[s[i]] != c[i]) return false;
  }
  return true;
}

int main() {
  size_t n, m;
  scanf("%zu %zu", &n, &m);

  std::vector<size_t> s(m);
  std::vector<char> c(m);
  for (size_t i = 0; i < m; ++i)
    scanf("%zu %c", &s[i], &c[i]), --s[i];

  for (int i = 0; i < 1000; ++i) {
    std::string a = std::to_string(i);
    if (a.length() != n) continue;
    if (ok(a, s, c)) return !printf("%d\n", i);
  }
  puts("-1");
}


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

int main()
{
	int n;
	string s, ans;
	cin >> n >> s;
	ans = s;
	for (int i = 0; i < s.length(); ++i)
	{
		if (s[i] + n > int('Z'))
		{
			ans[i] = char(s[i] + n - 26);
		}
		else
		{
			ans[i] = char(s[i] + n);
		}
	}
	
	cout << ans << endl;
	
	return 0;
}


Measured memory_bytes: 256