akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <algorithm>
#include <array>
#include <vector>
#include <utility>
#include <bitset>
#include <queue>
#include <unordered_map>
#include <unordered_set>

using namespace std;

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

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

    ll A, B, C, X, Y;

    cin >> A >> B >> C >> X >> Y;

    ll ans1 = A * X + B * Y;

    ll maxi = max(X, Y);
    ll mini = min(X, Y);
    ll diff = abs(X - Y);
    ll ans2 = C * 2 * mini;
    if (X > Y) {
        ans2 += A * diff;
    } else {
        ans2 += B * diff;
    }

    ll ans3 = C * 2 * maxi;

    cout << min(ans1, min(ans2, ans3)) << endl;
}


Measured memory_bytes: 256
#include <stdio.h>

int main(){
    int a,b;
    
    scanf("%d", &a);
    scanf("%d", &b);
    
    if(a < b){
     printf("a < b\n");
    }
    
    if(a > b){
        printf("a > b\n");
    }
    
    if(a == b){
        printf("a == b\n");
    }
    
    return 0;
    
}


Measured memory_bytes: 2104
#include <bits/stdc++.h>
#define INF 2e9
#define MOD 1000000007
#define MOD9 998244353
#define intMAX 51000;
#define PI 3.14159265359
using namespace std;
typedef long long llong;
// typedef long double ldouble;

using Graph = vector<vector<int>>;

// int ctoi(const char c){
//   if('0' <= c && c <= '9') return (c-'0');
//   return -1;
// }

// int gcd(int a, int b){
//   int ma = max(a,b);
//   int mi = min(a,b);
//   if(mi == 0) return ma;

//   return gcd(mi, ma%mi);
// }

// llong POW(llong a, llong b){
//   if(b == 0) return 1;
//   else{
//     if(b%2 == 0) return POW(a * a % MOD, b / 2) % MOD;
//     else return a * POW(a * a % MOD, b / 2) % MOD;
//   }
// }

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

Measured memory_bytes: 256
def fact(x, mod)
  ret = 1
  (1..x).each do |i|
    ret = ret * i % mod
  end
  ret
end

N, M = gets.split.map(&:to_i)
mod = (1e9 + 7).to_i

n = fact(N, mod)
m = fact(M, mod)
case (N - M).abs
when 0
  puts n * m * 2 % mod
when 1
  puts n * m % mod
else
  puts 0
end

Measured memory_bytes: 1788
K=int(input())
import math

ans=0
for i in range(1,K+1):
  for j in range(1,K+1):
    g=math.gcd(i,j)
    if g==1:
      ans+=K
      continue
    for k in range(1,K+1):
      ans+=math.gcd(g,k)
print(ans)

Measured memory_bytes: 9196
#include<bits/stdc++.h>
#define ALL(a) (a).begin(), (a).end()
#define rep(i, n) REP(i, 0, (n))
#define repc(i, n) REPC(i, 0, (n))
#define REP(i, n, m) for (int i = (int)(n); i < (int)(m); i++)
#define REPC(i, n, m) for (int i = (int)(n); i <= (int)(m); i++)
#define REPCM(i, n, m) for (int i = (int)(n); i >= (int)(m); i--)
using namespace std;
using ll = int_fast64_t;
using pr = pair<ll, ll>;
using vll = vector<ll>;
using vpr = vector<pr>;
template<class T> inline bool chmin(T& a, const T& b) { if (a > b) { a = b; return true; } else return false; }
template<class T> inline bool chmax(T& a, const T& b) { if (a < b) { a = b; return true; } else return false; }

vector<vll> G;
vll A, DP, ANS;
ll INF = 1LL << 60;

void dfs(int u, int p) {
  int i = lower_bound(ALL(DP), A[u]) - DP.begin();
  ANS[u] = i + 1;
  if(p != -1) chmax(ANS[u], ANS[p]);
  ll before = DP[i];
  DP[i] = A[u];
  for(const auto& v : G[u]) if(v != p) {
    dfs(v, u);
  }
  DP[i] = before;
}
void answer() {
  int n; cin >> n;
  G.resize(n);
  A.resize(n);
  DP.resize(n, INF);
  ANS.resize(n);
  rep(i,n) cin >> A[i];
  rep(i,n-1) {
    ll u, v; cin >> u >> v;
    u--; v--;
    G[u].emplace_back(v);
    G[v].emplace_back(u);
  }
  dfs(0, -1);
  rep(i,n) cout << ANS[i] << "\n";
}
int main() {
  std::ios::sync_with_stdio(false);
  std::cin.tie(0);
  answer();
  return 0;
}

Measured memory_bytes: 30360
<?php 
fscanf(STDIN, "%d", $k);
fscanf(STDIN, "%d %d", $a, $b);
$switch = false;

for ($i=$a; $i <= $b ; $i++) {
  // code...
  if($i%$k == 0){
    echo 'OK';
    return;
  }
}
echo 'NG';


Measured memory_bytes: 16016
mf = 0
while True:
    m,f,r = [int(i) for i in input().strip().split()]
    if m==f==r==-1 : break
    mf = m+f

    if m*f<0 or mf<30 : print("F")
    elif mf<50 and r<50 : print("D")
    elif mf<65 : print("C")
    elif mf<80 : print("B")
    elif mf>=80 : print("A")
    else: print("F")

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

int main()
{
	int k, a, b;
	cin >> k >> a >> b;
	bool ans = false;
	for(int i = a; i <= b; ++i){
		if(i % k == 0){
			ans = true;
			break;
		}
	}
	cout << (ans ? "OK" : "NG") << endl;
	return 0;
}

Measured memory_bytes: 3632
#include <bits/stdc++.h>
#define endl '\n'
using namespace std;
int cnt[26];
int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    memset(cnt, 0, sizeof cnt);
    int rows, cols;
    cin >> rows >> cols;
    for(int i = 0; i < rows; i++) {
        string ai;
        cin >> ai;
        for(int j = 0; j < cols; j++) {
            cnt[ai[j]-'a']++;
        }
    }
    int mod_1_3 = 0;
    int mod_2 = 0;
    for(int i = 0; i < 26; i++) {
        if(cnt[i] % 4 == 1 || cnt[i] % 4 == 3) {
            mod_1_3++;
        } else if(cnt[i] % 4 == 2) {
            mod_2++;
        }
    }
    bool can = false;
    if(rows % 2 == 0 && cols % 2 == 0) {
        can = mod_1_3 == 0 && mod_2 == 0;
    } else if(rows % 2 == 0) {
        can = mod_1_3 == 0 && mod_2 <= rows / 2;
    } else if(cols % 2 == 0) {
        can = mod_1_3 == 0 && mod_2 <= cols / 2;
    } else {
        can = mod_1_3 <= 1 && mod_2 <= rows / 2 + cols / 2;
    }
    cout << (can ? "Yes" : "No") << endl;
    return 0;
}


Measured memory_bytes: 256
import java.util.*;

class Main{
	public static void main(String[] args){
		Scanner sc=new Scanner(System.in);
		for(int n,p;;){
			n=sc.nextInt();
			p=sc.nextInt();
			if(n==0 && p==0)
				break;
			
			int[] a=new int[n];
			for(int i=0,j=p;;i=(i+1)%n){
				if(j==0){
					j+=a[i];
					a[i]=0;
				}
				else{
					j--;
					a[i]++;
					if(a[i]==p){
						System.out.println(i);
						break;
					}
				}
			}
		}
	}
}

Measured memory_bytes: 12000
import sys
import math
import itertools
import collections
import heapq
import re
import numpy as np
from functools import reduce

rr = lambda: sys.stdin.readline().rstrip()
rs = lambda: sys.stdin.readline().split()
ri = lambda: int(sys.stdin.readline())
rm = lambda: map(int, sys.stdin.readline().split())
rl = lambda: list(map(int, sys.stdin.readline().split()))
inf = float('inf')
mod = 10**9 + 7


a, b = rm()
if a > 0:
    print('Positive')
elif a <= 0 <= b:
    print('Zero')
elif b-a & 1:
    print('Positive')
else:
    print('Negative')
















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

using namespace std;

typedef pair<int,int>   II;
typedef vector< II >      VII;
typedef vector<int>     VI;
typedef vector< VI > 	VVI;
typedef long long int 	ll;
typedef unsigned long long int ULL;

#define PB push_back
#define MP make_pair
#define F first
#define S second
#define SZ(a) (int)(a.size())
#define ALL(a) a.begin(),a.end()
#define SET(a,b) memset(a,b,sizeof(a))
#define LET(x,a) __typeof(a) x(a)

#define loop(i, begin, end) for (__typeof(end) i = (begin) - ((begin) > (end)); i != (end) - ((begin) > (end)); i += 1 - 2 * ((begin) > (end)))
//Works for forward as well as backward iteration

#define gu getchar
#define pu putchar
#define si(n) scanf("%d",&n)
#define dout(n) printf("%d\n",n)
#define sll(n) scanf("%lld",&n)
#define lldout(n) printf("%lld\n",n)

#define DRT() int t; si(t); while(t--)

#define PlUSWRAP(index,n) index = (index+1)%n		//index++; if(index>=n) index=0
#define MINUSWRAP(index,n) index = (index + n -1)%n 	//index--; if(index<0) index=n-1
#define ROUNDOFFINT(d) d = (int)((double)d + 0.5)	//Round off d to nearest integer

#define FLUSHN while(gu()!='\n')
#define FLUSHS while(gu()!=' ')

//#define TRACE

#ifdef TRACE
#define trace1(x)                cerr << #x << ": " << x << endl;
#define trace2(x, y)             cerr << #x << ": " << x << " | " << #y << ": " << y << endl;
#define trace3(x, y, z)          cerr << #x << ": " << x << " | " << #y << ": " << y << " | " << #z << ": " << z << endl;
#define trace4(a, b, c, d)       cerr << #a << ": " << a << " | " << #b << ": " << b << " | " << #c << ": " << c << " | " << #d << ": " << d << endl;
#define trace5(a, b, c, d, e)    cerr << #a << ": " << a << " | " << #b << ": " << b << " | " << #c << ": " << c << " | " << #d << ": " << d << " | " << #e << ": " << e << endl;
#define trace6(a, b, c, d, e, f) cerr << #a << ": " << a << " | " << #b << ": " << b << " | " << #c << ": " << c << " | " << #d << ": " << d << " | " << #e << ": " << e << " | " << #f << ": " << f << endl;

#else

#define trace1(x)
#define trace2(x, y)
#define trace3(x, y, z)
#define trace4(a, b, c, d)
#define trace5(a, b, c, d, e)
#define trace6(a, b, c, d, e, f)

#endif

//FILE *fin = freopen("in","r",stdin);
//FILE *fout = freopen("out","w",stdout);
//const int N = int(1e5)+10;
const int LOGN = 20;
const int INF = int(1e9);

ll a[100005];

int main()
{	
	int n,ans;
	ll sum=0,prev;

	cin>>n;
	loop(i,0,n){
		cin>>a[i];
		sum+=a[i];
	}
	sort(a,a+n);
	ans=n;
	loop(i,n,1){
		sum-=a[i];
		if(sum*2<a[i]){
			ans = n-i;
			break;
		}
	}
  	cout<<ans<<endl;
    return 0;
}

Measured memory_bytes: 1024
arr=Array.new
while str=STDIN.gets
    lines=str.chomp.split.map{|v|v.to_i}
    break if lines[0]==0 && lines[1]==0
    arr.insert(arr.length,lines)
end
arr.each do | lines |
    row=0
    while(row<lines[0])
    col=0
    while(col<lines[1])
        ch = "."
        if (row+col)%2==0 then
                ch = "#"
        end
        printf ch
        col=col+1
    end
    printf "\n"
    row=row+1
    end
    printf "\n"
end

Measured memory_bytes: 6100
#include<iostream>
#include<vector>
#include<map>
#include<algorithm>
#include<math.h>
#include<string>
#include <iomanip>
#include<deque>
#include<queue>
#include<stack>

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef int itn;
const ll LINF = 1e18;
const int INF = 1e8;

//マクロ定義
#define vvint(vec,n,m,l) vector<vector<int>> vec(n, vector<int>(m,l));	// lで初期化
#define vvll(vec,n,m,l) vector<vector<ll>> vec(n,vector<ll>(m,l));
#define vint vector<int>
#define pint pair<int,int>
#define rep(i,a) for(int i=0;i<(a);i++)
#define all(x) (x).begin(),(x).end()
#define debug system("pause")				//デバッグ用

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

	int n, m;
	cin >> n >> m;
	vector<int> a(m), b(m);
	vector<int> c(m);
	int tmp;
	vector<int> dp((1 << n), INF+INF);
	dp[0] = 0;
	rep(i, m)
	{
		cin >> a[i] >> b[i];
		rep(j, b[i])
		{
			cin >> tmp;
			c[i] |= 1 << (tmp - 1);
		}
		rep(j, 1<<n)
		{
			dp[j | c[i]] = min(dp[j] + a[i], dp[j | c[i]]);
		}
	}
	if (dp[dp.size() - 1] == INF + INF)
		cout << -1 << endl;
	else
		cout << dp[dp.size() - 1] << endl;
	return 0;
}


Measured memory_bytes: 256
import queue
INF = 1 << 30
H , W= map(int, input().split())
que = [(0, 0)]
S = [input() for i in range(H)]
flag = [[INF for i in range(W)] for j in range(H)]
flag[0][0] = 1
cnt = sum(row.count('.') for row in S)
while que:
	y, x = que[0]
	que.pop(0)
	for ny, nx in [1, 0], [-1, 0], [0, 1], [0, -1]:
		nx += x
		ny += y
		if ny >= 0 and nx >= 0 and ny < H and nx < W and S[ny][nx] != '#' and flag[ny][nx] > flag[y][x] + 1:
			que.append((ny, nx))
			flag[ny][nx] = flag[y][x] + 1
			if (ny, nx) == (H - 1, W - 1):
				print(cnt - flag[ny][nx])
				exit()
print(-1)

Measured memory_bytes: 4208
import java.util.*;

import static java.lang.Math.*;

class Main {
    final Scanner sc = new Scanner(System.in);

    public static void main(String[] args) {
        new Main().run();
    }

    private void run() {
        int n = sc.nextInt();
        Map<Integer, Integer> map = new HashMap<>();
        long sum = 0;
        for (int i = 0; i < n; i++) {
            int a = sc.nextInt();
            sum += a;
            map.put(a, map.getOrDefault(a, 0) + 1);
        }
        int q = sc.nextInt();

        for (int i = 0; i < q; i++) {
            int b = sc.nextInt();
            int c = sc.nextInt();
            sum += (c - b) * map.getOrDefault(b, 0);
            map.put(c, map.getOrDefault(c, 0) + map.getOrDefault(b, 0));
            map.put(b, 0);
            System.out.println(sum);
        }
    }
}


Measured memory_bytes: 69208
#define _USE_MATH_DEFINES

#include <iostream>
#include <iomanip>
#include <stdio.h>

#include <sstream>
#include <algorithm>
#include <iterator>
#include <cmath>
#include <complex>

#include <string>
#include <cstring>
#include <vector>
#include <bitset>

#include <queue>
#include <set>
#include <map>
#include <stack>
#include <list>

#include <ctime>
////
//#include <random>//
/////////

typedef long long LL;
typedef long double LD;
typedef unsigned long long ULL;

////定数
const int INF = (int)1e9 + 10;
const LL MOD = (LL)1e9 + 7;
const LL LINF = (LL)4e18 + 20;
const LD PI = acos(-1.0);
const double EPS = 1e-9; 
/////////
using namespace::std;
template<typename T>
void chmax(T& a, T b) {
	a = max(a, b);
}

template<typename T>
void chmin(T& a, T b) {
	a = min(a, b);
}

template<typename T>
void IN(vector<T> &A,int N=-1) {
	if (N == -1) {
		N = A.size();
	}
	for (int i = 0; i < N; ++i) {
		cin >> A[i];
	}
}

template<typename T>
void SO(vector<T> &A,bool F=false) {
	sort(A.begin(), A.end());
	if (F) {
		reverse(A.begin(), A.end());
	}
}
//////////////


void solve() {
	int K, A, B;
	cin >> K >> A >> B;
	for (int i = A; i <= B; ++i) {
		if (i % K == 0) {
			cout << "OK" << endl;
			return;
		}
	}
	cout << "NG" << endl;
}

signed main(void) {
	std::cin.tie(0);
	std::ios::sync_with_stdio(false);
	std::cout << std::fixed;//小数を10進数表示
	cout << setprecision(16);//小数点以下の桁数を指定//coutとcerrで別	

	solve();
}

Measured memory_bytes: 3608
#include <iostream>

using namespace std;

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

    int a[n];

    for(int i = 0;i<n;i++)
    {
        cin>>a[i];
    }

    for(int i = n-1;i>=0;i--)
    {
        if(i == 0)
            cout<<a[i];
        else
        cout<<a[i]<<" ";
    }
    cout<<endl;
}




Measured memory_bytes: 3064
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < n; i++)
using namespace std;
using ll = long long;
int INF = 1000000009;
int main()
{
    int a,b;
    cin >> a >> b;
    for (int i = 1; i <= 1000; i++){
        int x = i;
        if(x*10/100 == b && x*8/100 == a){
            cout << x << endl;
            return 0;
        }
    }
    cout << -1 << endl;
}

Measured memory_bytes: 256
using System;

namespace AtCoder.ABC095
{
    class c
    {
        static void Main(string[] args)
        {
            var line = Console.ReadLine().Trim();
            var spl = line.Split(' ');
            var list = Array.ConvertAll(spl, new Converter<string, int>(s=>int.Parse(s)));
            var A = list[0];
            var B = list[1];
            var C = list[2];
            var X = list[3];
            var Y = list[4];
            if (A > C * 2 && B > C * 2) Console.WriteLine(Math.Max(X, Y) * C * 2);
            else if (A + B > C * 2)
            {
                var sum = Math.Min(X, Y) * C * 2;
                if (Math.Max(X, Y) == X)
                {
                    if (A > 2 * C) Console.WriteLine(sum + (X - Y) * C * 2);
                    else Console.WriteLine(sum + (X - Y) * A);
                }
                else
                {
                    if (B > 2 * C) Console.WriteLine(sum + (Y - X) * C * 2);
                    else Console.WriteLine(sum + (Y - X) * B);
                }
            }
            else
            {
                Console.WriteLine(X * A + Y * B);
            }
        }
    }
}


Measured memory_bytes: 11220
// #pragma GCC target("avx,avx2,fma")
// #pragma GCC optimization ("Ofast")
// #pragma GCC optimization ("unroll-loops")
#include<bits/stdc++.h>

using namespace std;
// #include <ext/pb_ds/assoc_container.hpp>
// #include <ext/pb_ds/tree_policy.hpp>
// using namespace __gnu_pbds;
// template <typename T>
// using ordered_set = tree <T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
// #define sfind(i) (*find_by_order(i))
// #define ord(i) order_of_key(i)
typedef long long ll;
typedef pair<int , int> pii;
typedef pair<ll, ll> pll;
typedef vector<pii> vii;
typedef vector<pll> vll;
#define mod 1000000007
#define rep(i, a, b) for(ll i = a; i < b; i++)
#define repc(i, a, b, c) for (ll i = a; (c > 0 ? i < b : i > b) and c != 0; i += c)
#define vi vector<int>
#define vl vector<ll>
#define _max(vec) (*max_element(all(vec)))
#define _min(vec) (*min_element(all(vec)))
#define fi first
#define si second
#define pb push_back
#define all(name) name.begin(), name.end()
#define ral(name) name.rbegin(), name.rend()
#define fact(n) rep(i, 1, n+1)ft.pb((ft[i-1]*i)%mod)
#define mod_in(a) power(a, mod - 2)
#define ncr(n, r) (n>=r?((ft[n]*mod_in((ft[r]*ft[(n)-(r)])%mod))%mod):0LL)
#define deb(x) cerr << "[" << #x << " " << x << "]" << endl;
#define endl '\n'  //....????
#define int ll
vector<ll> ft(1, 1LL);
/*======================================================================*/

void solve() {
    int a;
    long double b;
    cin >> a >> b;
    a = a*b;
    cout << a;
}
signed main() {
    ios_base::sync_with_stdio(false);
    cin.tie(0);cout.tie(0);
    ll t = 1;
    //cin >> t;
    while(t--){
        solve();
    }
}

Measured memory_bytes: 3748
#include<cstdio>
#include<cstring>
#include<cmath>
#include<cstdlib>
#include<cctype>
#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<map>
#include<stack>
#include<queue>
#include<set>
using namespace std;
typedef pair<int, int> pii;
typedef double lf;
typedef long long ll;
const int inf=0x3f3f3f3f, mod=1000000007;

inline int read()
{
    int x=0,f=1; char ch=getchar();
    for (; ch<'0' || ch>'9'; ch=getchar()) if (ch=='-') f=-1;
    for (; ch>='0' && ch<='9'; ch=getchar()) x=(x<<1)+(x<<3)+ch-'0';
    return x*f;
}

int main()
{
    int n=read(), h=read(), w=read(), ans=0;
    for (int i=1; i<=n; i++)
    {
        int a=read(), b=read();
        if (h<=a && w<=b) ans++;
    }
    printf("%d\n",ans);
    return 0;
}


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

int main(){
  int N;
  cin >> N;
  vector<int> A(N);
  for(int i = 0; i < N; ++i) cin >> A[i];
  for(int i = 0; i < N; ++i){
    A[i] -= i - 1;
  }
  sort(A.begin(), A.end());
  long long ans = 1e18, t = 0;
  for(int i = 0; i < N; ++i){
    t += abs(A[i] - A[N/2]);
  }
  ans = min(ans, t);
  t = 0;
  for(int i = 0; i < N; ++i){
    t += abs(A[i] - A[N/2+1]);
  }
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 1024
/*
    ThunderClap and Flash.
    Raunaq Singh
*/
#include <bits/stdc++.h> 
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<ll,ll> pll;
#define ThunderClap ios::sync_with_stdio(0),cin.tie(NULL),cout.tie(NULL);
#define debugg(something)   cout<<#something<<" - "<<something<<"\n";
#define vi vector
#define umap unordered_map
#define uset unordered_set
#define mset multiset
#define LB lower_bound
#define UB upper_bound
#define mp make_pair
#define pb push_back
#define in insert
#define s second
#define f first
#define pQueue priority_queue
#define maxElement *max_element
#define minElement *min_element
#define MAX 100000LL
#define mod 1000000007LL
#define inf 1000000000000000000LL
#define mI2 500000004LL
inline ll add(ll a, ll b){ return ((a%mod)+(b%mod))%mod;}
inline ll mul(ll a, ll b){ return ((a%mod)*(b%mod))%mod;}
inline ll sub(ll a, ll b){ return ((a%mod)-(b%mod)+mod)%mod;}

void Flash(){
    ll n;
    cin>>n;
    ll ans=(1000LL*(n/500));
    n%=500;
    ans+=(5LL*(n/5));
    cout<<ans<<"\n";
}

int main(int argc, char const *argv[]){
    ThunderClap;
    ll t=1;
    //cin>>t;
    for(ll i=1;i<=t;i++){
        //cout<<"Case #"<<i<<": ";
        Flash();
    }
    return 0;
}

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

using namespace std;

int main()
{
    int n, m;
    cin >> n >> m;
    long long sum = 0;
    for (int i = 0; i < m; i++) {
        long long a;
        cin >> a;
        sum += a;
    }

    if (sum > n)
        cout << -1;
    else
        cout << n - sum;
    return 0;
}


Measured memory_bytes: 3672
using System;

public class Station{
    public static void Main(){
        var input = Console.ReadLine();
        var ans = "";
        
        if(input.IndexOf('A') != -1 && input.IndexOf('B') != -1){
            ans  ="Yes";
        }else{
            ans = "No";
        }
        Console.WriteLine(ans);
    }
}


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

namespace c
{
    class Program
    {
        static void Main(string[] args)
        {
            var n = long.Parse(Console.ReadLine());
            var res = Solve(n, "");

            Console.WriteLine(res);
        }

        static long Solve(long n, string s){
            if(s.Length != 0  && long.Parse(s) > n){
                return 0 ;
            }

            long res = "753".Count(x => s.Contains(x)) == 3 ? 1 : 0;
            res += Solve(n, s + "3");
            res += Solve(n, s + "5");
            res += Solve(n, s + "7");
            return res;
        }
    }
}


Measured memory_bytes: 17352
function Main(input){
  input = input.split('\n');
  var NK = input[0].split(' ');
	var l = input[1].split(' ').map((a)=>Number(a)).sort((a,b)=>b-a);
  var v = 0;
  for(var i=0;i<Number(NK[1]);i++){
    v+=l[i];
  }
  console.log(v);
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));

Measured memory_bytes: 7372
def takahashi_win(A,B,C,D):
    while True:
        C -= B
        if C<=0:
            return "Yes"
        A -= D
        if A <= 0:
            return "No"
    

A,B,C,D=map(int,input().split())
print(takahashi_win(A,B,C,D))

Measured memory_bytes: 9052
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;
using namespace std;

#define Max 			1e6
#define ff              first
#define ss              second
#define ll              long long
#define pb              push_back
#define ppb				pop_back
#define pf				push_front
#define ppf				pop_front
#define mp              make_pair
#define pii             pair<ll,ll>
#define vi              vector<ll>
#define v 				vector
#define mii             map<ll,ll>
#define pq              priority_queue<ll>
#define pqm             priority_queue<ll,vi,greater<ll> >
#define setbits(x)      __builtin_popcountll(x)
#define zrobits(x)      __builtin_ctzll(x)
#define mod             1000000007
#define inf             1e18
#define ps(x,y)         fixed<<setprecision(y)<<x
#define mk(arr,n,type)  type *arr=new type[n];
#define w(x)            ll x; cin>>x; while(x--)
#define all(x)			x.begin(),x.end()
#define sp 				' '
#define pi 				3.14159265359
mt19937                 rng(chrono::steady_clock::now().time_since_epoch().count());

typedef tree<ll, null_type, less<ll>, rb_tree_tag, tree_order_statistics_node_update> pbds;


void IO()
{
#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
    freopen("error.txt", "w", stderr);
#endif
}
void fastIO()
{
    ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);

}
int main()
{
    fastIO();
//    IO();
    ll n;
    cin >> n;
    v<ll> a(n);
    for (ll &i : a)
        cin >> i;
    sort(all(a), greater<ll>());
    v<ll> ans;
    ll ans1 = 0;
    ans.pb(a[0]);
    for(ll i=1;i<n;i++)
    {
        ans.pb(a[i]);
        ans.pb(a[i]);
    }
    for(ll i=0;i<n-1;i++)
    {
        ans1+=ans[i];
    }
    cout << ans1 << endl;

    return 0;
}

Measured memory_bytes: 9016
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int gcd(int a, int b) {  
  return b != 0 ? gcd(b, a % b) : a;
}//MAX
int lcm(int a, int b) { 
   return a * b / gcd(a, b);
   }
//MIN

 main() {
string s;
cin >> s;
int ans = 0;
for(int i=0;i<s.size();i++){
   if(s.at(i)=='x')ans++;
}
if(ans<8){
   cout<<"YES"<<endl;
}
else{
   cout<<"NO"<<endl;
}
 }


Measured memory_bytes: 256
using System;
using System.Collections.Generic;
class Program
{
	static void Main(string[] args)
	{
		string[] str = Console.ReadLine().Split();
		long A = long.Parse(str[0]);
		long B = long.Parse(str[1]);
		long C = long.Parse(str[2]);
		long ans = 0;
		if(A>=B && A>=C){
			ans = A*10+B+C;
		} else if(B>=A && B>=C){
			ans = B*10+A+C;
		} else {
			ans = C*10+A+B;
		}
		Console.WriteLine(ans);
	}
}

Measured memory_bytes: 13140
#include<iostream>
#include<string>
#include<algorithm>
#include<cmath>
#include<iomanip>
#include<cstring>
#include<map>
#include<vector>
#include<queue>
#include<stack>
#include<climits>
#include<set>
#include<utility>
#include<typeinfo>
using namespace std;
typedef long long int ll;
typedef pair<int, int> P;
typedef set<int> S;
#define rep(i, n) for(int i=0; i<n; i++)
const ll MOD=1e9+7;

int main(){

	int n;
	cin >> n;
	string ans="";
	while(n!=0){
		if(n%2!=0){
			n--;
			ans="1"+ans;
		} else {
			ans="0"+ans;
		}
		n/=-2;
	}
	if(ans==""){
		ans+="0";
	}
	cout << ans << endl;

	return 0;
}

Measured memory_bytes: 256
import math


n, m = map(int, input().split())


def combinations_count(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))


if n > 1:
    num_1 = combinations_count(n, 2)
else:
    num_1 = 0

if m > 1:
    num_2 = combinations_count(m, 2)
else:
    num_2 = 0

print(num_1 + num_2)


Measured memory_bytes: 3060
use std::io::*;
use std::str::FromStr;

fn main(){
    println!("{}", 48-read_vec::<i32>()[0])
}
fn read_vec<T: FromStr>() -> Vec<T>{
    let mut buf = String::new();
    stdin().read_line(&mut buf);
    let vec : Vec<&str> = buf.split_whitespace().collect();
    let mut v : Vec<T> = vec!();
    for i in 0..vec.len(){
        v.push(vec[i].parse().ok().expect("Error"));
    }
    v
}

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

#define ll long long
#define pb push_back
#define mp make_pair

using namespace std;

int n,a[3][111],dp[3][111];

int main () {

cin >> n;

for (int i = 1; i <= 2; i ++) {
    for (int j = 1; j <= n; j ++) {
        cin >> a[i][j];
        dp[i][j] = a[i][j];
    }
}

for (int i = 1; i <= 2; i ++) {
    for (int j = 1; j <= n; j ++) {
        //if (i != 1 && j != 1) {
            dp[i][j] += max(dp[i - 1][j], dp[i][j - 1]);
        //}
    }
}

cout << dp[2][n];

return 0;
}


Measured memory_bytes: 256
#include<iostream>
#include<algorithm>
#include<vector>
#include<queue>
#include<map>
using namespace std;
typedef long long ll;
ll MOD = 1e9+7;
#define rep(i,n) for(int i = 0; i < (n); ++i)
int main() {
    string s;
    cin >> s;
    string t, p;
    int ans = 0;
    rep(i, s.size()) {
        t += s[i];
        if ( t != p ) {
            p = t;
            t = "";
            ++ans;
        }
    }
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 640
#include <iostream>
#include <string>
#include <algorithm>
#include <cmath>
#include <deque>
#include <queue>
#include <stack>
#include <vector>
#include <utility>
#include <iomanip>
#include <bitset>
#include <set>
#include <map>
#include <stdio.h>
#include <numeric>
#include <cstring>

#define rep(i,n) for (int i = 0; i < (n); i++)
#define rep1(i,n) for (int i = 1; i < (n); i++)
#define FOR(i,a,b) for (int i=(a); i < (b); i++)
#define MOD 1000000007 //10^9+7
using namespace std;
using ll = long long;
using PII = pair<int, int>;
using PLL = pair<ll, ll>;
const int INF = numeric_limits<int>::max();
const ll INFL = numeric_limits<ll>::max();


// 負の数にも対応した % 演算
long long mod(long long val, long long m) {
    long long res = val % m;
    if (res < 0) res += m;
    return res;
}

//greatest common divisor
long long gcd(ll a, ll b) 
{
    if (a % b == 0) {
        return b;
    } else {
        return gcd(b, a % b);
    }
}

//least common multiple
long long lcm(ll a, ll b)
{
    return a / gcd(a, b) * b ;
}

ll factorial(ll n) {
    ll res = 1;
    for (ll i = 1; i <= n; i++) {
        res *= i;
    }
    return res;
}

int main()
{
    string a, b; cin >> a >> b;
    if (a == b) {
        cout << "=" << endl;
    } else if (a < b) {
        cout << "<" << endl;
    } else {
        cout << ">" << endl;
    }


    return 0;
}


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

int main() {
    string alpha = "abcdefghijklmnopqrstuvwxyz";
    string c;
    ll K;
    cin >> c >> K;
    for(int i=0;i<c.size()-1;i++){
        int t= c[i] -'a';
        int cost = (alpha.size()-t)%alpha.size();
        if(cost<=K){
            K-=cost;
            c[i] ='a';
        }
    }
    int t= c[c.size()-1]-'a';
    c[c.size()-1] = alpha[(t+K)%alpha.size()];
    cout << c << endl;

    return 0;
}

Measured memory_bytes: 512
#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define sz(x) int(x.size())
#define ALL(c) (c).begin(), (c).end()
#define SUM(x) std::accumulate(ALL(x), 0LL)
#define MIN(v) *std::min_element(v.begin(), v.end())
#define MAX(v) *std::max_element(v.begin(), v.end())
#define EXIST(v, x) (std::find(v.begin(), v.end(), x) != v.end())

using namespace std;
typedef long long ll;

template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
const int INF = 1001001001;
const long long INFL = (1LL<<60);
const double eps = (1e-9);

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

ll ab = INFL;
for (ll i = 1; i*i <= n; ++i) {
  if (n % i == 0) {
    if (i != n / i) {
      chmin(ab, (i + (n/i)));
    } else {
      chmin(ab, i + i);
    }
  }
}
  cout << ab - 2 << endl;

  return 0;
}


Measured memory_bytes: 256
#c
import itertools

n, m, q = map(int, input().split())
lslist = []

for i in range(q):
    a, b, c, d = map(int, input().split())
    lslist.append([a, b, c, d])

# n=3
# m=4
# q=3
# ls1 = [1, 3, 3, 100]
# ls2 = [1, 2, 2, 10]
# ls3 = [1, 1, 0, 1000]
# lslist = [ls1, ls2, ls3]

acomn = list(itertools.combinations_with_replacement(list(range(m)), n))

def tensu(ls, a):
    if a[ls[1]-1] - a[ls[0]-1] == ls[2]:
        return ls[3]
    else:
        return 0

def tensu2(lslist, a):
    return sum(list(map(lambda x: tensu(x, a), lslist)))

print(max(list(map(lambda a: tensu2(lslist, a), acomn))))

Measured memory_bytes: 25256
#include <iostream>
#include <sstream>
#include <cstdio>
#include <cmath>
#include <cstring>
#include <cctype>
#include <string>
#include <vector>
#include <list>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <algorithm>
#include <functional>
using namespace std; 
typedef long long ll;
typedef vector<int> vi;
typedef vector<vector<int>> vvi;
typedef vector<pair<int, int>> vii;
typedef pair<int, int> ii;
/////////////////////////////////////////////////////////////////////
int main()
{
  int n;
  cin >> n;
  vi a(n - 1);
  for (int i = 0; i < n - 1; ++i) {
    cin >> a[i];
  }
  map<int, int> hash;
  for (int i = 0; i < n; ++i) {
    hash[i + 1] = 0;
  }
  for (auto& c : a) ++hash[c];
  for (auto& c : hash) {
    cout << c.second << endl;
  }
  return 0;
}


Measured memory_bytes: 13556
#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 N,C;
  cin >> N >> C;
  vector<vector<int> > d(C,vector<int>(C)),f(N,vector<int>(N));
  rep(i,C)rep(j,C) cin >> d[i][j];
  rep(i,N)rep(j,N) cin >> f[i][j], --f[i][j];

  //前処理(各マスの色をcに変えるコストの総和)
  vector<vector<int> > cost(3, vector<int>(C,0));
  rep(c,C) {
    rep(i,N) {
      rep(j,N) {
        cost[(i+j)%3][c] += d[f[i][j]][c];
      }
    }
  }

  int res = 1<<30;
  rep(c0,C) rep(c1,C) rep(c2,C) {
    if(c0 == c1)continue;
    if(c1 == c2)continue;
    if(c2 == c0)continue;
    res = min(res,cost[0][c0] + cost[1][c1] + cost[2][c2]);
  }
  cout << res << endl;
 
  return 0;
}

Measured memory_bytes: 1280
while 1:
    n,m=map(int,input().split())
    if n==0 and m==0:break
    cnt=0
    for i in range(1,n+1):
        for j in range(i+1,n+1):
            for k in range(j+1,n+1):
                if i+j+k==m:
                    cnt +=1
    print(cnt)


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

int main(){
	int K , X;
	cin >> K >> X;

	for(long long i = X - K + 1; i < X + K; i++){
		if(i == X + K - 1){
			cout << i << endl;
			break;
		}
		cout << i << " ";
	}
	
	
}


Measured memory_bytes: 256
#include <iostream>
#include <cstring>
#include <cmath> 
using namespace std;
int main()
{
	string s1;
	cin >> s1;
	int a = s1.find("A");
	int z = s1.rfind("Z" ,s1.size());
	cout << abs(a-z)+1 << endl;
}

Measured memory_bytes: 644
#pragma warning (disable:4996)
#include<stdio.h>
#include<iostream>
using namespace std;
int main()
{
	int a, b;
	cin >> a>>b;
	int dif = b - a;
	int hei=0, dep;
	for (int i = 0; i < dif; i++)
	{
		hei = hei + i;
	}
	dep = hei - a;
	cout << dep;
	return 0;
}

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

int main()
{
    int x, y, z, a, b, c;
    cin>>x>>y>>z;

    a = x+y;
    b = x+z;
    c = y+z;

    int mn = min(a,min(b,c));

    cout<<mn<<endl;

    return 0;
}


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

using namespace std;


const int N = 1e5 + 10;
int n, m;
int v[N][2];
int vise[N], visv[N];
vector<int> adj[N];

bool DFS(int u, int pa) {
    visv[u] = 1;
    int n1 = 0;
    for(auto i : adj[u]) if (!vise[i]) {
        vise[i] = 1;
        int v = ::v[i][0] + ::v[i][1] - u;
        if (visv[v]) {
            cout << u << " " << v << '\n';
            n1++;
        } else {
            if (!DFS(v, u)) {
                cout << u << " " << v << '\n';
                n1++;
            }else cout << v << " " << u << '\n';
        }
    }
    return n1 % 2;
}
int main() {
    cin >> n >> m;
    if (m % 2) {
        cout << "-1";
        return 0;
    }
    for(int i = 1; i <= m; i++) {
        cin >> v[i][0] >> v[i][1];
        adj[v[i][0]].push_back(i);
        adj[v[i][1]].push_back(i);
    }
    assert(!DFS(1, -1));
}


Measured memory_bytes: 16256
import java.util.Scanner;

public class Main {
    public static void main(String args[]) {
        Scanner scanner = new Scanner(System.in);
        int N = scanner.nextInt();
        int M = scanner.nextInt();

        int count = 0;
        int sum = 0;

        int[] A = new int[N];
        for(int i = 0; i < N; i++) {
            A[i] = scanner.nextInt();
            sum += A[i];
        }


        for(int i = 0; i < N; i++) {
            if(A[i] * 4 * M >= sum) {
                count++;
            }
        }

        if(count >= M) {
            System.out.println("Yes");
        } else {
            System.out.println("No");
        }
    }
}

Measured memory_bytes: 22736
S = str(input())

S = S.replace('dream', '#')
S = S.replace('erase', '.')
S = S.replace('#er', '')
S = S.replace('.r', '')
S = S.replace('#', '')
S = S.replace('.', '')

if len(S) == 0:
  print('YES')
else:
  print('NO')


Measured memory_bytes: 3188
/* When Talent doesn't work, Hard work beats Talent*/

#pragma GCC optimize("Ofast")
#pragma GCC target("avx,avx2,fma")
#pragma GCC optimization ("unroll-loops")

#include"bits/stdc++.h"

using namespace std;

#define Fast_D cout<<fixed<<setprecision(13);
#define FastIO ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);

#define nl "\n"
#define int long long
#define double long double
#define all(v) v.begin(),v.end()
#define scanstr(s) cin>>ws; getline(cin,s);

const double PI = 3.141592653589793;

void solve()
{
	string s,t;
	cin >> s >> t;
	int lens = s.size();
	int lent = t.size();
	int ans = 1e7+1;
	for(int i=0;i<=lens-lent;i++)
	{
		string cur ;
		for(int j=i;j<lent+i;j++) cur+=s[j];
		int a = 0;
		for(int k=0;k<lent;k++) if(cur[k] != t[k]) a++;
		ans = min(ans,a);
	}
	cout << ans ;
}

int32_t main()
{
	FastIO;
	Fast_D;
	solve();
	return 0;
}


Measured memory_bytes: 3616
/**
 * code generated by JHelper
 * More info: https://github.com/AlexeyDmitriev/JHelper
 * @author
 */

#include <iostream>
#include <fstream>

#include <iostream>
typedef long long ll;
class TaskD {
public:
	void solve(std::istream& in, std::ostream& out) {
		int V; in>>V;
		int arr[V][V], graph[V][V];
        bool important[V][V];
		for (int i = 0; i < V; ++i) {
			for (int j = 0; j < V; ++j) {
				in>>arr[i][j];
				graph[i][j]=arr[i][j];
                important[i][j]=true;
			}
		}
		int i, j, k;
		for (k = 0; k < V; k++)
		{
			// Pick all vertices as source one by one
			for (i = 0; i < V; i++)
			{
				// Pick all vertices as destination for the
				// above picked source
				for (j = 0; j < V; j++)
				{
					// If vertex k is on the shortest path from
					// i to j, then update the value of dist[i][j]
					if (graph[i][k] + graph[k][j] < graph[i][j]) {
                        graph[i][j] = graph[i][k] + graph[k][j];
                        out<<"-1";
                        return;
                    }
                    if((k!=i && k!=j) && graph[i][j] == graph[i][k] + graph[k][j]){
                        important[i][j]= false;
                    }
				}
			}
		}

        ll res=0;
        for (int i = 0; i < V; ++i) {
            for (int j = i+1; j < V; ++j) {
                if(important[i][j]) res+=graph[i][j];
            }
        }
        out<<res;


	}
};


int main() {
	TaskD solver;
	std::istream& in(std::cin);
	std::ostream& out(std::cout);
	solver.solve(in, out);
	return 0;
}


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

int main(int argc, char *argv[])
{
    char line[256];
    double f;

    if (!fgets(line, sizeof(line), stdin)) {
        fprintf(stderr, "error input val\n");
        return -1;
    }

    if (sscanf(line, "%lf", &f) != 1) {
        fprintf(stderr, "error input format\n");
        return -1;
    }
    printf("%lf %lf\n", f*f*M_PI, 2*f*M_PI);

    return 0;
}

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

using namespace std;

#define PI acos(-1)
#define FAST() ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)

int main()
{
    FAST();
    double a,b,c,h,m,angle;
    cin >> a >> b >> h >> m;
    h*=30,h+=m*0.5,m*=6;
    angle=min(abs(h-m),360-abs(h-m));
    c=a*a+b*b-2.0*a*b*cos((PI/180.0)*angle);
    cout << fixed << setprecision(15) << sqrt(c);
    return 0;
}


Measured memory_bytes: 4268
#include <bits/stdc++.h>
#define rep(i,n) for (int i=0; i<(n); ++i)
using namespace std;
using ll=long long;
int main(){
    int n; string s;
    cin>>n>>s;
    int b=0,w=0;
    rep(i,n){
        if(s[i]=='.')w++;
    }
    int ans=w;
    rep(i,n){
        if(s[i]=='#')b++;
        else w--;
        ans=min({ans,b+w});
    }
    cout<<ans<<endl;
}

Measured memory_bytes: 640
#include<iostream>
#include<cstdio>
using namespace std;
long long n,a[410000],now,ans;
int main()
{
	while(~scanf("%d",&n))
	{
		ans=0;
		if(n==0) return 0;
		for(int i=1;i<=n;i++)
		{
			scanf("%lld",&a[i]);
		}
		for(int l=1,r=1,now=0;l<=n;)
		{
			for(;r<=n&&!(now&a[r]);)
			{
				now^=a[r++];
				ans+=r-l;
			}
			now^=a[l++];
		}
		printf("%lld",ans);
	}
}

Measured memory_bytes: 1920
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define lvector vector<ll>
#define lque queue<ll>
#define lpque priority_queue<ll>
#define dlpque priority_queue<ll,lvector,greater<ll>>
#define P pair<ll,ll> 
#define ALL(a) (a).begin(),(a).end()
#define rep(i,n) for(ll (i)=0; (i)<(n); ++(i))
#define print(a) cout << (a) << endl

int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  ll l;cin>>l;
  double v=l*l*l/27.0;
  printf("%.10f\n",v);
  return 0;
}

Measured memory_bytes: 384
s = gets.chomp
n = s.size
s << s
t = gets.chomp

a = b = 0
t.each_char do |c|
    if x = s.index(c, b)
        a += x - b + 1
        b = x >= n ? x - n + 1 : x + 1
    else
        a = -1
        break
    end
end

p a

Measured memory_bytes: 4348
#include <bits/stdc++.h>
using namespace std;
int main(){
    char c1, c2, c3;
    cin >> c1 >> c2 >> c3;
    int ans=700;
    if (c1=='o') ans = ans + 100;
    if (c2=='o') ans = ans + 100;
    if (c3=='o') ans = ans + 100;
    cout << ans ;
    return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
typedef long long int lli;
#define MAX 2000005
#define MOD 1000000007
#define endl "\n"
lli a[MAX];
lli prefb[MAX];
lli b[MAX];
int main(){
	ios_base::sync_with_stdio(0);
	cin.tie(NULL);
	lli n,m,k;
	cin>>n>>m>>k;
	for(lli i =0; i<n; i++){
		cin>>a[i];
	}
	for(lli i = 0; i<m; i++){
		cin>>b[i];
		prefb[i+1] = prefb[i] + b[i];
	}

	lli ans = 0;
	lli s = 0;
	for(lli i = 0; i<=n; i++){
		if(i > 0){
			s += a[i-1];
		}
		lli search = k-s;
		if(k-s < 0){
			break;
		}
		lli q = upper_bound(prefb, prefb+m+1, search) - prefb-1;

		ans = max(ans, q+i);
	}
	cout<<ans<<endl;
}

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



int main()
{
    int n,k;
    std::cin>>n>>k;
    int ans=0;
    if(n<10){
        ans=100*(10-n)+k;
        std::cout<<ans<<"\n";
    }else{
        std::cout<<k<<"\n";
    }
    return 0;
}


Measured memory_bytes: 256
#include <stdio.h>

int fGrade(int x)
{
if(x>=1800) return 1;
else if(x>=1600) return 2;
else if(x>=1400) return 3;
else if(x>=1200) return 4;
else if(x>=1000) return 5;
else if(x>=800) return 6;
else if(x>=600) return 7;
else return 8;
}

int main(void)
{
  int x;
  if(!scanf("%d", &x)) return 0;
  printf("%d", fGrade(x));
  return 0;
}


Measured memory_bytes: 1736
#include<stdio.h>


int main( ){

  int a, b, c, d;

  scanf("%d %d %d %d", &a, &b, &c, &d);

  if(a == b && c == d)
    printf("yes\n");
  else if(a == c && b == d)
    printf("yes\n");
  else if(a == d && b == c)
    printf("yes\n");
  else printf("no\n");


  return 0;
}

Measured memory_bytes: 580
def calc_term(num,size):
  term = num // size
  if num % size != 0:
    term += 1
  return term

def main():
  ary = [0] * 40
  while True:
    n = int(input())
    if n == 0:
      break
    ary[0] = 1
    ary[1] = 1
    ary[2] = 2
    for i in range(3,n+1):
      ary[i] = ary[i-3] + ary[i-2] + ary[i-1]
    days = calc_term(ary[n],10)
    years = calc_term(days,365)
    print(years)

if __name__ == '__main__':
  main()



Measured memory_bytes: 5596
import java.util.*;

class Main {
	public static void main(String[] args){
	int a = 0;
	int b = 0;
	int i = 0;
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		String S = sc.next();
		 
	for(i = 0; i < S.length(); i++){
		if(String.valueOf(S.charAt(i)).equals("R")){
		    a += 1;
		}else{
			b += 1;
	    }
	}
	if(a > b){
	System.out.println("Yes");
	}else{
	System.out.println("No");
}
}
}


Measured memory_bytes: 23764
#include <bits/stdc++.h>
using namespace std;
#define FOR(i,a,b) for (int i=(a);i<(b);++i)
#define REP(i,n) for (int i=0;i<(n);++i)
#define all(a) (a).begin(),(a).end()
#define MOD 1000000007
int main(){
    long long h,a=0;
    cin>>h;
    while(pow(2,a)<=h)a++;
    a--;
    cout<<(long long)pow(2,a+1)-1<<endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int main(void){
  int s;cin>>s;
  int loop=1;
  while(s!=4 && s!=2 && s!=1){
    s=(s%2==0)?s/2:s*3+1;
    loop++;
  }
    cout<<loop+3<<endl;
  return 0;
}

Measured memory_bytes: 256
#include <stdio.h>

int main(void){

	char mozi[1000];
	int count,sum;

	for(;;){

		sum=0;

		scanf("%s",mozi);

		if(mozi[0]=='0'){
			break;
		}

		for(count=0;mozi[count]!='\0';count++){


			sum += mozi[count];
			sum = sum -48;
			
		}
	
		printf("%d\n",sum);
		sum = 0;
		}


	return 0;
}

Measured memory_bytes: 536
n =int(input())
ls=[]
for i in range(n):
    s=input()
    ls.append([c for c in s])

res = []
for c1 in ls[0]:
    flag = 0
    for i in range(1,n):
        if c1 in ls[i]:
            ls[i].remove(c1)
            flag += 1
    if flag == n-1:
        res.append(c1)
res.sort()
print("".join(res))

Measured memory_bytes: 3064
use proconio::marker::*;
use proconio::*;

#[derive(Debug)]
#[allow(non_snake_case)]
struct Input {
    D: usize,
    c: Vec<i64>,
    s: Vec<Vec<i64>>,
    t: Vec<usize>,
    lasts: Vec<usize>,
    d: usize,
    score: i64,
}

#[allow(non_snake_case)]
impl Input {
    fn new(D: usize, c: Vec<i64>, s: Vec<Vec<i64>>) -> Input {
        Input {
            D,
            c,
            s,
            t: vec![0; D],
            lasts: vec![0; 26],
            d: 0,
            score: 0,
        }
    }

    fn calc(&mut self) -> i64 {
        let mut score = self.s[self.d][self.t[self.d]];

        self.lasts[self.t[self.d]] = self.d + 1;
        for i in 0..26 {
            score -= (self.d + 1 - self.lasts[i]) as i64 * self.c[i];
        }

        self.d += 1;
        score
    }

    fn result(&self) -> i64 {
        let mut score = 0;
        let mut sub = 0;
        let mut lasts = vec![0; 26];
        for d in 0..self.D {
            score += self.s[d][self.t[d]];
            let l = lasts[self.t[d]];
            lasts[self.t[d]] = d + 1;
            score -= self.c[self.t[d]] * ((d - l) * (d - l + 1) / 2) as i64;
        }

        for i in 0..26 {
            let l = lasts[i];
            score -= self.c[i] * ((self.D - l) * (self.D - l + 1) / 2) as i64;
        }

        score
    }
}

#[allow(non_snake_case)]
fn main() {
    input! {
        D: usize,
        c: [i64; 26],
        s: [[i64; 26]; D],
    };
    input! {
        t: [Usize1; D],
    };
    input! {
        M: usize,
        dq: [(Usize1, Usize1); M],
    };
    let mut obj = Input::new(D, c, s);
    obj.t = t;
    let mut score = 0;

    for &(d, q) in &dq {
        obj.t[d] = q;
        println!("{}", obj.result());
    }
}


Measured memory_bytes: 4256
#include <cstdio>
#include <cstdlib>
#pragma warning(disable : 4996)
struct Node {
	int key;
	Node *p, *l, *r;
};
Node *root;
void insert(int key_) {
	Node *x = root, *y = 0, *z;
	z = (Node*)malloc(sizeof(Node));
	z->key = key_, z->l = 0, z->r = 0;
	while (x) y = x, x = (z->key < x->key) ? x->l : x->r;
	z->p = y;
	if (!y) root = z;
	else if (z->key < y->key) y->l = z;
	else y->r = z;
}
void walk1(Node *x) { if (!x) return; walk1(x->l); printf(" %d", x->key); walk1(x->r); }
void walk2(Node *x) { if (!x) return; printf(" %d", x->key); walk2(x->l); walk2(x->r); }
int n, v; char c[8];
int main() {
	scanf("%d", &n);
	for (int i = 0; i < n; i++) {
		scanf("%s", &c);
		if (c[0] == 'i') scanf("%d", &v), insert(v);
		else walk1(root), printf("\n"), walk2(root), printf("\n");
	}
}

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

int main() {
  vector<vector<int>> c(3, vector<int>(3));
  for (int i = 0; i < 3; i++) {
    for (int j = 0; j < 3; j++) {
      cin >> c.at(i).at(j);
    }
  }
  
  bool answer = false;
  int a1, a2, a3, b1, b2, b3;
  for (int a1 = 0; a1 < 101; a1++) {
    int b1 = c.at(0).at(0) - a1;
    int b2 = c.at(0).at(1) - a1;
    int b3 = c.at(0).at(2) - a1;
    int a2 = c.at(1).at(0) - b1;
    int a3 = c.at(2).at(0) - b1;
    if (a2 + b2 == c.at(1).at(1) && a2 + b3 == c.at(1).at(2) 
        && a3 + b2 == c.at(2).at(1) && a3 + b3 == c.at(2).at(2)) {
      answer = true;
      break;
    }
  }
  if (answer) {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
}
    

Measured memory_bytes: 256
(defun flip (c)
  (if (eql #\1 c)
      #\0
      #\1))

(defun f (s index req acc)
  (cond
    ((< index (length s))
     (if (eql (aref s index) req)
         (f s (1+ index) (flip req) acc)
         (f s (1+ index) (flip req) (1+ acc))))
    (t
     acc)))

(let ((s (read-line)))
  (format t "~A~%"
          (min (f s 0 #\1 0) (f s 0 #\0 0))))

Measured memory_bytes: 6376
#include<iostream>

int n,d;

int main(){

    std::cin>>n>>d;

    if(n%(d*2+1)>0)
    std::cout<<n/(d*2+1)+1<<std::endl;
    else
    std::cout<<n/(d*2+1)<<std::endl;
    

    return 0;
}

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

int main(){
        double a,b,c,d,e,f;
        double x,y;

        while(cin >> a >> b >> c >> d >> e >> f){
                x = ((e*c-b*f) / (a*e - b*d));
                y = ((-(d*c) + a*f) / (a*e - b*d));

        if(x == 0)
                x = 0;
        if(y == 0)
                y = 0;

        printf("%.3f %.3f\n", x, y);

        }

        return 0;
}

Measured memory_bytes: 1236