akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define rep(i,n)  FOR(i,0,n)
#define req(i,n) for(int i = 1;i <=n;i++)
#define pai 3.14159265358979323846
const int INF = 1001001001;
typedef long long ll;
int A[3][3], N;
bool punched[3][3];
bool ok[3][3];
//using Graph = vector<vector<int>>;


const int MOD = 1000000007;
typedef pair<int,int> P;

//最大公約数
ll gcd(ll a,ll b){
	if (a%b == 0){
		return b;
	}
	else{
		return gcd(b,a%b);
	}

}

//最小公倍数
ll lcm(ll a,ll b){
	return a /gcd(a,b) * b;
}

//素数判定
bool is_prime(long long N) {
    if (N == 1) return false;
    for (long long i = 2; i * i <= N; ++i) {
        if (N % i == 0) return false;
    }
    return true;
}

// 素因数分解
vector<pair<long long, long long> > prime_factorize(long long n) {
    vector<pair<long long, long long> > res;
    for (long long p = 2; p * p <= n; ++p) {
        if (n % p != 0) continue;
        int num = 0;
        while (n % p == 0) { ++num; n /= p; }
        res.push_back(make_pair(p, num));
    }
    if (n != 1) res.push_back(make_pair(n, 1));
    return res;
}

// 10進数から2進数
int binary(int bina){
    int ans = 0;
    for (int i = 0; bina>0 ; i++)
    {
        ans = ans+(bina%2)*pow(10,i);
        bina = bina/2;
    }
    return ans;
}









int main() {
  string s;
  cin >> s;
  int cnt = 0;
  rep (i,s.size()){
    if (s[i]=='R') cnt++;
    if (cnt==1 && s[i]!='R') break;
  }
  cout << cnt << endl;

}


Measured memory_bytes: 3720
N = int(input())
dp = []
h0 = list(map(int, input().split()))
dp.append(h0)
for i in range(1, N):
  a, b, c = map(int, input().split())
  prev = dp[-1]
  ha = a + max(prev[1], prev[2])
  hb = b + max(prev[0], prev[2])
  hc = c + max(prev[0], prev[1])
  dp.append([ha, hb, hc])
#print(dp)
ans = max(dp[N-1])
print(ans)

Measured memory_bytes: 22772
#include <algorithm>  
#include <iostream>  
#include <sstream>  
#include <string>  
#include <cstring>
#include <vector>  
#include <queue>  
#include <set>  
#include <map>  
#include <cstdio>  
#include <cstdlib>  
#include <cctype>  
#include <cmath>  
#include <list>  
#include <cassert>
#include <ctime>
#include <climits>
using namespace std;  

#define PB push_back  
#define MP make_pair  
#define SZ(v) ((int)(v).size())  
#define FOR(i,a,b) for(int i=(a);i<(b);++i)  
#define REP(i,n) FOR(i,0,n)  
#define FORE(i,a,b) for(int i=(a);i<=(b);++i)  
#define REPE(i,n) FORE(i,0,n)  
#define FORSZ(i,a,v) FOR(i,a,SZ(v))  
#define REPSZ(i,v) REP(i,SZ(v))  
typedef long long ll;
typedef unsigned long long ull;
ll gcd(ll a,ll b) { return b==0?a:gcd(b,a%b); }

const int MAXN=100000;

int n,k;
int x[MAXN];

ll solve() {
	ll ret=0;
	if(k>n) return ret;
	ll posbefore=0,posafter=0,last=0; int l=0,r=k;
	REP(i,n) if(i<k) last+=x[i]; else if(x[i]>0) posafter+=x[i];
	while(true) {
		{ ll cur=last+posbefore+posafter; if(cur>ret) ret=cur; }
		{ ll cur=posbefore+posafter; if(cur>ret) ret=cur; }
		//printf("%d..%d: %lld %lld %lld\n",l,r,posbefore,last,posafter);
		if(r==n) break;
		last-=x[l]; if(x[l]>=0) posbefore+=x[l]; ++l;
		last+=x[r]; if(x[r]>=0) posafter-=x[r]; ++r;
	}
	return ret;
}

void run() {
	scanf("%d%d",&n,&k); REP(i,n) scanf("%d",&x[i]);
	printf("%lld\n",solve());
}

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


Measured memory_bytes: 640
#include<iostream>
#include<vector>
#define FOR(i,a,b) for(int i=(a);i<(b);++i) 
#define REP(i,n) FOR(i,0,n)
#define EACH(x,a) for(auto& (x):(a))
#define ALL(obj) (obj).begin(),(obj).end()
#define Yes(n) cout<<((n)?"Yes":"No")<<endl;
using namespace std;
using ll=long long;
const int INF=1e9;
const ll LINF=1e18;
int gcd(int a,int b){return b?gcd(b,a%b):a;}

struct UnionFind{
  vector<int> par;

  UnionFind(int N): par(N){
    REP(i,N) par[i] = i;
  }

  int root(int x){
    if(par[x] == x) return x;
    return par[x] = root(par[x]);
  }

  void unite(int x, int y){
    int rx = root(x);
    int ry = root(y);
    if(rx == ry) return;
    par[rx] = ry;
  }

  bool same(int x, int y){
    int rx = root(x);
    int ry = root(y);
    return rx == ry;
  }
};

int main(){
  int N, M; cin>>N>>M;
  vector<int> p(N); REP(i,N) cin>>p[i];
  UnionFind tree(N);
  REP(i,M){
    int x, y; cin>>x>>y;
    tree.unite(x-1, y-1);
  }

  int cnt=0;
  REP(i,N) if(tree.same(i, p[i]-1)) ++cnt;

  cout<<cnt<<endl;

  return 0;
}


Measured memory_bytes: 1024
#include <iostream>
#include <algorithm>
#include <queue>
#include <vector>

using namespace std;

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

int main()
{
  int N;

  cin >> N;
  vector<int> a(3 * N);
  for (int i = 0; i < 3 * N; i++) {
    cin >> a[i];
  }

  vector<ll> dsum(N + 1, 0);
  priority_queue<int, vector<int>, greater<int>> dpq;
  for (int i = 0; i < N; i++) {
    dsum[0] += a[i];
    dpq.push(a[i]);
  }
  for (int i = 1; i <= N; i++) {
    dsum[i] = dsum[i - 1] + a[N + i - 1];
    dpq.push(a[N + i - 1]);
    dsum[i] -= dpq.top(); dpq.pop();
  }

  vector<ll> lsum(N + 1, 0);
  priority_queue<int> lpq;
  for (int i = 0; i < N; i++) {
    lsum[0] += a[2 * N + i];
    lpq.push(a[2 * N + i]);
  }
  for (int i = 1; i <= N; i++) {
    lsum[i] = lsum[i - 1] + a[2 * N - i];
    lpq.push(a[2 * N - i]);
    lsum[i] -= lpq.top(); lpq.pop();
  }


  ll ans = -110000000000000;
  for(int i = 0; i <= N; i++) {
    ans = max(ans, dsum[i] - lsum[N - i]);
  }
  cout << ans << endl;

  return 0;
}



Measured memory_bytes: 4088
#include <bits/stdc++.h>
#define all(a) a.begin(), a.end()
#define forn(i,n) for(int i = 0; i < (int) n; i++)
#define ios ios::sync_with_stdio(false); cin.tie(0); cout.tie(0)

#define MOD 998244353
using namespace std;
typedef long long ll;

vector<int> v;

ll exp(ll a, ll p) {
  if (!a) return 0;
  ll ans = 1;
  while(p) {
    if (p & 1)
      ans = (ans * a) % MOD;
    a = (a * a) % MOD;
    p >>= 1;
  }
  return ans;
}

vector<vector<ll>> memo;
ll solve(int n, int s) {
  if (memo[n][s] != -1) return memo[n][s];
  if (s == 0) return exp(2, n);
  if (n == 0) return 0;

  ll lhs = solve(n - 1, s), rhs = 0;
  if (s >= v[n - 1])
    rhs = solve(n - 1, s - v[n - 1]);

  lhs = lhs * 2 % MOD;
  return memo[n][s] = (lhs + rhs) % MOD;
}

int main() {
  ios;
  int n, s;
  cin >> n >> s;

  memo = vector<vector<ll>>(n+1, vector<ll>(s+1, -1));

  v.resize(n);
  forn(i, n) cin >> v[i];

  cout << solve(n, s) << "\n";
}


Measured memory_bytes: 73952
i;X,Y,Z,W;main(x,y,a){for(;~scanf("%d%d%d",&x,&y,&a);)!i++?Z=x,W=y:a>2?a%2?Y=y<Y?Y:y:(W=y>W?W:y):a%2?X=x<X?X:x:(Z=x>Z?Z:x);printf("%d",X<Z&Y<W?(Z-X)*(W-Y):0);}

Measured memory_bytes: 128
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define f(n) for (int i = 0; i < n; i++)
#define fo(i, x, n) for (int i = x; i < n; i++)
#define fb(i, x, n) for (int i = n - 1; i >= x; i--)
#define w(t)  \
    int t;    \
    cin >> t; \
    while (t--)

typedef unsigned long long ull;
typedef vector<long long> vi;
#define msi map<string, long long>
#define mii map<long long, long long>
const int MX = 2e5 + 5;
const int INF = 1e18;
#define pb push_back
//#define endl "\n"
#define yes cout << "YES\n"
#define no cout << "NO\n"
#define all(x) x.begin(), x.end()
#define ff first
#define ss second

void print(int a[], int n)
{
    for (int i = 0; i < n; i++)
    {
        cout << a[i] << " ";
    }
    cout << endl;
}

void print(vi &v)
{
    f(v.size())
    {
        cout << v[i] << " ";
    }
    cout << endl;
}

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

    int n;
    cin>>n;
    vi v;

        for(int j=1;j*j<=n;j++)
        {
            if(n%j)
            {
                v.pb(n/j);
            }
            else{
                v.pb((n/j)-1);
            }

        }
        fo(i,1,v.size())
        {
            v[i]-=i;
        }
        //print(v);
        int s=accumulate(all(v),0);
        double x=sqrt(n);
        int y;
        if(x==(int)x)
        {
            y=x-1;
        }
        else
        {
            y=x;
        }
        //cout<<x<<endl;
        cout<<s*2-y<<endl;



    cerr<< "Time Killed: " << 1.0 * clock() / CLOCKS_PER_SEC << "s\n";
    return 0;
}


Measured memory_bytes: 3844
q = gets.to_i
q.times{
  x0, y0, x1, y1, x2, y2, x3, y3 = gets.split.map(&:to_f)
  a0 = (y1 - y0) / (x1 - x0)
  b0 = y0 - a0 * x0
  a1 = (y3 - y2) / (x3 - x2)
  b1 = y2 - a1 * x2
  if x0 == x1
    xp = x0
    yp = a1 * xp + b1
  elsif x2 == x3
    xp = x2
    yp = a0 * xp + b0
  else
    xp = (b0 - b1) / (a1 - a0)
    yp = a0 * xp + b0
  end
  puts "%.12f %.12f" % [xp, yp]
}

Measured memory_bytes: 8932
import java.util.*;

public class Main {
    private static final Scanner scn = new Scanner(System.in);
    
    public static void main(String[] args) {
        for(int i = 0, n = scn.nextInt(); i < n; i++) {
            int[] ary = {scn.nextInt(), scn.nextInt(), scn.nextInt()};
            Arrays.sort(ary);
            boolean flg = ary[0] * ary[0] + ary[1] * ary[1] == ary[2] * ary[2];
            System.out.println(flg ? "YES" : "NO");
        }
    }
}

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

int f(int x){
	return (x*x);
}

int main(){
	int d,s;

	while( cin >> d ){
		s = 0;
		for(int i=1 ; (d*i)<=(600-d) ; i++){
			s += f(d*i)*d;
		}
		cout << s << endl;
	}
}

Measured memory_bytes: 3072
// --------------------<optimizations>--------------------
#pragma GCC optimize("O3")
//(UNCOMMENT WHEN HAVING LOTS OF RECURSIONS)\
#pragma comment(linker, "/stack:200000000")
//(UNCOMMENT WHEN TRYING TO BRUTEFORCE WITH A LOT OF LOOPS)\
#pragma GCC optimize("unroll-loops")
#include<bits/stdc++.h>

using namespace std;

#define ll long long
#define mp make_pair
#define pb push_back
#define eb emplace_back
#define pii pair<ll,ll>
#define vpii vector<pair<ll,ll> >
#define F first
#define S second
#define ld long double
#define built __builtin_popcountll
#define mst(a,i) memset(a,i,sizeof(a))
#define all(x) x.begin(),x.end()
#define itit(it,a) for(auto it=(a).begin(); it!=(a).end(); it++)
#define rep(i,a,b) for(ll i=a; i<b; i++)
#define repr(i,a,b) for(ll i=a; i>b; i--)
#define reprr(i,a,b) for(ll i=a; i>=b; i--)
#define pi 3.14159265358979323846264338327950288419716939937510582097494459230
ll max3(ll x,ll y,ll z) {return max(max(x,y),z);}
ll min3(ll x,ll y,ll z) {return min(min(x,y),z);}
const ll M=2e5+10,M2=1e6+10,mod=1e9+7,inf=1e17+10;
void add(int& a, int b) {a+=b;if(a>=mod){a-=mod;}}
#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
int X[] = {0, 1, 0, -1};
int Y[] = {-1, 0, 1, 0};
ll power(ll x,ll n){ll result=1;while(n>0){if(n%2==1)result=(result*x); x=((x)*(x));n=n/2;}return result;}



int main()
{
	ios::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);
	ll a;
	cin >> a;
	string s;
	cin >> s;
	if(a>=3200) cout << s;
	else cout << "red";
	return 0;
}


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

int main(){
  	int N, A[210], flag = 0;
  	int number = 0;
  
  	cin >> N;
  	for(int i = 0;i < N; i++)	cin >> A[i];
  
  	for(int i = 0;; i++){
      	for(int j = 0;j < N; j++){
          	if(A[j] % 2 == 1){
              	flag = -1;
              	break;
            }
          	else if(A[j]%2 == 0){
              	A[j] /= 2;
            }
        }
    	if(flag == -1)	break;
      	else if(flag == 0)	number++;
      	
    }
  
  	cout << number << endl;
  
  	return 0;
}

Measured memory_bytes: 256
/*input
8 6
*/
#include <bits/stdc++.h>
#pragma GCC optimize("unroll-loops,no-stack-protector")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef pair<double,double> pdd;
#define IOS ios_base::sync_with_stdio(0); cin.tie(0)
#define ALL(a) a.begin(),a.end()
#define SZ(a) ((int)a.size())
#define F first
#define S second
#define REP(i,n) for(int i=0;i<((int)n);i++)
#define pb push_back
#define MP(a,b) make_pair(a,b)
#define SORT_UNIQUE(c) (sort(c.begin(),c.end()), c.resize(distance(c.begin(),unique(c.begin(),c.end()))))
#define GET_POS(c,x) (lower_bound(c.begin(),c.end(),x)-c.begin())
#ifdef leowang
#define debug(...) do{\
	fprintf(stderr,"%s - %d : (%s) = ",__PRETTY_FUNCTION__,__LINE__,#__VA_ARGS__);\
	_DO(__VA_ARGS__);\
}while(0)
template<typename I> void _DO(I&&x){cerr<<x<<endl;}
template<typename I,typename...T> void _DO(I&&x,T&&...tail){cerr<<x<<", ";_DO(tail...);}
#else
#define debug(...)
#endif
template<typename T1,typename T2>
ostream& operator<<(ostream& out,pair<T1,T2> P){
	out<<'('<<P.F<<','<<P.S<<')';
	return out;
}
//}}}
const ll maxn=300005;
const ll maxlg=__lg(maxn)+2;
const ll INF64=8000000000000000000LL;
const int INF=0x3f3f3f3f;
const ll MOD=ll(1e9+7);
const double PI=acos(-1);
//const ll p=880301;
//const ll P=31;

ll mypow(ll a,ll b){
	ll res=1LL;
	while(b){
		if(b&1) res=res*a%MOD;
		a=a*a%MOD;
		
		b>>=1;
	}
	return res;
}
int main()
{
	IOS;
	string s;
	cin>>s;
	int ans=0;
	for(char c:s)
		if(c=='+') ans++;
		else ans--;
	cout<<ans;
	return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
int n,m;
std::map<std::string,int>cnt;
std::string s;
int main(){
    std::ios::sync_with_stdio(false);
    std::cin.tie(nullptr);
    std::cin >> n;
    std::cin >> s;
    std::vector<int>max_pos(10,-1);
    std::vector<int>min_pos(10,n + 1);
    for(int i = 0; i <= 9; ++i) min_pos[i] = n + 1,max_pos[i] = -1;
    for(int i = 0; i < n; ++i){
        int m = s[i] - '0';
        max_pos[m] = i;
        min_pos[m] = std::min(min_pos[m],i);
    }
    std::vector<int>memo(1000,0LL);
    for(int i = 0; i < n; ++i){
        int key = s[i] - '0';
        for(int l = 0; l <= 9; ++l){
            for(int r = 0; r <= 9; ++r){
                if(max_pos[r] == -1 or min_pos[l] == n + 1)
                    continue;
                if(min_pos[l] < i && i < max_pos[r])
                    memo[l * 100 + key * 10 + r] = 1;
            }
        }
    }
    std::cout << std::count_if(memo.begin(),memo.end(),[](int e){return e > 0;})<< '\n';
}




Measured memory_bytes: 384
import Data.List
import Data.Function
import Data.Maybe
import Debug.Trace

data Node = Node Int deriving (Show, Eq, Ord)
type Edge = (Node, Node)
type Distance = (Node, Int)

maxD = 101

getId :: Node -> Int
getId (Node i) = i

getNodes :: Int -> [Edge] -> [Node]
getNodes n edges = sort $ map snd . filter (\(s,e) -> getId s == n) $ edges

visit :: [Edge] -> [Distance] -> [Distance] -> [Distance]
visit _     []    distances  = distances
visit edges stack distances = let neighbors           = getNodes (getId lastNode) edges
                                  neighborsDistances  = map (\x -> (x, d+1)) . filter (\node-> not (visited node distances)) $ neighbors
                                  updatedStack        = foldr (:) remain neighborsDistances
                                  updatedDistances    = mergeDistances distances neighborsDistances
                              in (visit edges updatedStack updatedDistances)
  where (remain, (lastNode, d)) = (init stack, last stack)

mergeDistances :: [Distance] -> [Distance] -> [Distance]
mergeDistances xs ys = nub $ (doMerge xs ys) ++ (doMerge ys xs)
  where doMerge []     _            = []
        doMerge (x:xs) newDistances = (minDist x newDistances) : (doMerge xs newDistances)
        minDist (Node i1, d1) distances = let dist = find (\(Node i, d) -> i == i1) distances
                                          in (Node i1, min d1 (maybe maxD (getId . fst) dist))

visited :: Node -> [Distance] -> Bool
visited node distances = node `elem` (map fst distances)

getDistance :: Node -> [Distance] -> Maybe Distance
getDistance node distances = find (\(n, d) -> node == n) distances

parseEdge :: [String] -> [Edge]
parseEdge (s:_:xs) = map (\e -> (Node (read s), Node (read e))) xs

listNodeDistances :: Int -> [Distance] -> [Distance]
listNodeDistances n distances = sortBy (compare `on` (getId . fst)) . map (\i -> if visited (Node i) distances then fromJust (getDistance (Node i) distances) else (Node i, -1)) $ [1..n]

format :: [Distance] -> [String]
format []     = []
format ((Node i, d):ds) = (show i ++ " " ++ show d) : (format ds)

main = do
  n <- fmap (read) getLine
  inputs <- fmap (map words . lines) $ getContents
  let edges = concatMap parseEdge inputs
  mapM_ putStrLn (format . listNodeDistances n $ visit edges [(Node 1, 0)] [(Node 1, 0)])

Measured memory_bytes: 4800
n = int(input())

lst = []
while n % 2 == 0:
  lst.append(2)
  n //= 2
f = 3
while f * f <= n:
  if n % f == 0:
    lst.append(f)
    n //= f
  else:
    f += 2
if n != 1:
  lst.append(n)
#print(lst)
count = 0
while lst:
  s = 0
  i = 1
  num = lst[0]
  for ele in lst:
    if ele == num:
      s += 1
  for j in range(s):
    lst.remove(num)
  while s > 0:
    s -= i
    i += 1
    if s >= 0:
      count += 1
  #print(lst)
print(count)

Measured memory_bytes: 9216
#include "bits/stdc++.h"
#define FOR(i, a, b) for (int i = a; i < b; i++)
#define mFOR(i, a, b) for (int i = a; i > b; i--)
#define MP make_pair
#define PB push_back
#define ALL(v) v.begin(), v.end()
#define N 100007
#define INF 1000000007
using namespace std;

typedef long long ll;

ll gcd(ll a, ll b) { return b == 0 ? a : gcd(b, a % b); }
ll fceil(ll a, ll b) { return (a % b == 0 ? a / b : a / b + 1); }

int main()
{
   ll d, g, sum_score = 0;
   int ans = INF, sum_qnum = 0, partial_ans = -1;
   cin >> d >> g;
   vector<ll> p(d, 0), c(d, 0);
   for (int i = 0; i < d; i++)
      cin >> p[i] >> c[i];

   for (int i = 0; i < (1 << d); i++)
   {
      sum_score = 0;
      sum_qnum = 0;
      partial_ans = -1;
      for (int j = 0; j < d; j++)
      {
         if ((i >> j) & 1)
         {
            sum_score += 100 * (j + 1) * p[j] + c[j];
            sum_qnum += p[j];
         }
         else
         {
            partial_ans = j;
         }
      }
      if (sum_score < g)
      {
         ll need = fceil(g - sum_score, 100 * (partial_ans + 1));
         if (need >= p[partial_ans])
            continue;
         sum_qnum += need;
      }
      ans = min(ans, sum_qnum);
   }
   cout << ans << endl;
   return 0;
}


Measured memory_bytes: 256
/*長方形の中に円が含まれるかを判定するプログラムを作成*/
/*長方形は左下の頂点を原点とし、右上の頂点の座標 (W,H) が与えられる*/
/*円はその中心の座標 (x,y) と半径 r で与えられる*/

#include <stdio.h>

int main(){
    
    int W, H;
    int x, y, r;
    
    /*制約：−100≤x,y≤100、0<W,H,r≤100*/
    do{
    scanf("%d %d %d %d %d",&W,&H,&x,&y,&r);
    }while(x<-100 || x>100 || y<-100 || y>100 || W<=0 || W>100 || H<=0 || H>100 || r<=0 || r>100);
    
    if(0<=(x-r) && (x+r)<=W){      /*横の判定*/
        if(0<=(y-r) && (y+r)<=H){  /*縦の判定*/
            printf("Yes\n");
        }
        else{
            printf("No\n");
        }
    }
    else{
        printf("No\n");
    }
    
    return 0;
}


Measured memory_bytes: 2104
import math
A, B, H, M = map(int,input().split())

x = abs(1/60  - 1 /(12*60))*(60*H+M) * 360
y = math.radians(x)

C = A**2 + B **2 -2*A*B*math.cos(y)

print(math.sqrt(C))


Measured memory_bytes: 9560
#include <bits/stdc++.h>
using namespace std;
 
long long solve(vector<vector<long long> >&ans, vector<int> &val, vector<int> &wt, int i, int w)
{
    
    if(i<0)return 0;
    if(w==0)return 0;
 
    if(ans[i][w]!=-1)return ans[i][w];
 
    ans[i][w]=0;
    long long temp1 = solve(ans,val,wt,i-1, w);
    if(w>=wt[i])
        temp1 = max(temp1, (long long)val[i] + solve(ans,val,wt,i-1,w-wt[i]));
    ans[i][w]=temp1;
    return ans[i][w];
}
 
int main()
{
    int n,w;
    cin>>n>>w;
    vector<int> val(n);
    vector<int> wt(n);
    
    for(int i=0; i<n; i++)
        cin>>wt[i]>>val[i];
 
    vector<vector<long long> >  ans(n,vector<long long> (w+1,-1));
 
    cout<<solve(ans,val,wt,n-1,w);
 
    return 0;
} 


Measured memory_bytes: 79488
#include<bits/stdc++.h>
using namespace std;
#define rep(i,n) for (int (i)=0;(i)<(n);i++)
#define INF 1001001001
#define LLINF 1001001001001001001
#define MOD 1000000007
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }
#define ALL(v) v.begin(), v.end()
typedef long long ll;


int main(){

string s;
cin >> s;
bool ans = false;
for(int i=0;i<3;i++){
    if(s.at(i)==s.at(i+1))ans=true;
}

if(ans==true)cout << "Bad" << endl;
else cout << "Good" << endl;

return 0;

}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int a[100]={0};
int main()
{
	int n,s,i,j,m=120,M=-1,MM=1e9+5;
	scanf("%d",&n);
	for(i=0;i<n;i++)
	{
		scanf("%d",&a[i]);
		if(a[i]>M)M=a[i];
		if(a[i]<m)m=a[i];
	}
	for(i=m;i<=M;i++)
	{	
		s=0;
		for(j=0;j<n;j++)
			s+=(a[j]-i)*(a[j]-i);
		if(s<MM)MM=s;
	}
	cout<<MM;	
	return 0;
} 

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

using namespace std;


string s;

int main(){
	ios_base :: sync_with_stdio(0);
	cin.tie(0);
    cin >> s;
    int ans = 0;
    for(int i = 0; i < s.size() - 1; i++){
    	ans+=(s[i] != s[i+1]);
    }
    cout << ans;
	return 0;
}

Measured memory_bytes: 512
#include <stdio.h>

int main(void){
    int a, b;
    scanf("%d%d", &a, &b);

    if(a<=b){
        for(int i = 0; i < b; i++){
            printf("%d", a);
        }
        return 0;
    }else{
        for(int i = 0; i < a; i++){
            printf("%d", b);
        }
    }
}

Measured memory_bytes: 128
q = int(input())
ans = [0, 0]
import heapq
p1 = []
p2 = []
heapq.heapify(p1)
heapq.heapify(p2)
sum_b = 0
sum_p1 = 0
sum_p2 = 0
for _ in range(q):
    ql = list(map(int,input().split()))
    if ql[0] == 2:
        if len(p1) == len(p2):
            print(-p2[0], sum_p1 - len(p1) * -p2[0] + len(p2) * -p2[0] - sum_p2 + sum_b)
        else:
            print(p1[0], sum_p1 - len(p1) * p1[0] + len(p2) * p1[0] - sum_p2 + sum_b)
    else:
        sum_b += ql[2]
        if len(p1) == 0:
            heapq.heappush(p1, ql[1])
            sum_p1 += ql[1]
        elif p1[0] <= ql[1]:
            heapq.heappush(p1, ql[1])
            sum_p1 += ql[1]
        else:
            heapq.heappush(p2, -ql[1])
            sum_p2 += ql[1]
        if len(p1) < len(p2):
            k = heapq.heappop(p2)
            heapq.heappush(p1, -k)
            sum_p2 += k
            sum_p1 -= k
        if len(p1) - 1 > len(p2):
            k = heapq.heappop(p1)
            heapq.heappush(p2, -k)
            sum_p1 -= k
            sum_p2 += k



Measured memory_bytes: 90072
#include <bits/stdc++.h>
long long int n,k,a[1000000],ans;
using namespace std;
bool cmp(long long int a,long long int b)
{  return a>b;
}
int main()
{
   scanf("%lld %lld",&n,&k);
   for(int i=0;i<n;i++)
    scanf("%lld",&a[i]);
   sort(a,a+n,cmp);
   for(int i=k;i<n;i++)
   {  ans+=a[i];
   }
   printf("%lld",ans);


    return 0;
}


Measured memory_bytes: 1920
#include<bits/stdc++.h>
using namespace std;
const int N=1e5+5;
const double eps=1e-6;
struct vec
{
    double x,y;
    vec(double x=0,double y=0):x(x),y(y){}
    vec operator+(const vec&o)const{ return vec(x+o.x,y+o.y);}
    vec operator-(const vec&o)const{ return vec(x-o.x,y-o.y);}
    double operator*(const vec&o)const{ return x*o.x+y*o.y;}
    double operator^(const vec&o)const{ return x*o.y-y*o.x;}
    vec operator/(const double&o)const{ return vec(x/o,y/o);}
    vec operator*(const double&o)const{ return vec(x*o,y*o);}
    void sc(){scanf("%lf%lf",&x,&y);}
    double len(){return sqrt(x*x+y*y);}
};
bool line(vec a,vec b)
{
    return  fabs(a.y*b.x-b.y*a.x)<eps;
}
int n;
vec ans,v[N];
double r;
int main()
{
    scanf("%d",&n);
    for(int i=1;i<=n;i++) v[i].sc();
    random_shuffle(v+1,v+1+n);
    ans=v[1];
    for(int i=1;i<=n;i++)
        if((ans-v[i]).len()>r)
    {
        ans=v[i];r=0;
        for(int j=1;j<i;j++)
            if((ans-v[j]).len()>r)
            {
                ans=(v[i]+v[j])/2;
                r=(ans-v[j]).len();
                for(int k=1;k<j;k++)
                    if((ans-v[k]).len()>r)
                    {
                        double a=v[j].x-v[i].x;
                        double b=v[j].y-v[i].y;
                        double c=v[k].x-v[j].x;
                        double d=v[k].y-v[j].y;
                        double e=v[j].x*v[j].x-v[i].x*v[i].x+v[j].y*v[j].y-v[i].y*v[i].y;
                        double f=v[k].x*v[k].x-v[j].x*v[j].x+v[k].y*v[k].y-v[j].y*v[j].y;
                        double x=(f*b-e*d)/(c*b-a*d)/2.0;
                        double y=(a*f-e*c)/(a*d-b*c)/2.0;
                        ans=vec(x,y);
                        r=(ans-v[i]).len();
                        //r=sqrt((v[i].x-x)*(v[i].x-x)+(v[i].y-y)*(v[i].y-y));
                        //cout<<v[i].x<<' '<<v[i].y<<' '<<ans.x<<' '<<ans.y<<' '<<x<<' '<<y<<endl;
                        //cout<<(v[i]-ans).len()<<' '<<r<<' '<<v[i].x-x<<' '<<v[i].y-y<<' '<<(v[i]-ans).x<<' '<<(v[i]-ans).y<<endl;
                    }
            }
    }
    printf("%.10f\n",r);
}


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

int main()
{
  for(int i=1; i<=5; i++)
  {
    int tmp;
    
    cin>>tmp;
    
    if(tmp==0)
    {
      cout<<i<<endl;
      
      break;
    }
  }
  
  return 0;
}

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

const ll INF = 1e17;
const ll MOD = 1e9+7;


int main() {
    // input, ready
    string S,T;
    cin >> S >> T;

    //resolve

    // output
    cout << T << S << endl;

    return 0;
}

Measured memory_bytes: 256
#pragma GCC optimize ("O3")
#pragma GCC target ("avx")
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for(int i = 0; i < (n); i++)
#define rep1(i, n) for(int i = 1; i <= (n); i++)
#define co(x) cout << (x) << "\n"
#define cosp(x) cout << (x) << " "
#define ce(x) cerr << (x) << "\n"
#define cesp(x) cerr << (x) << " "
#define pb push_back
#define mp make_pair
#define chmin(x, y) x = min(x, y)
#define chmax(x, y) x = max(x, y)
#define Would
#define you
#define please

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


	int A, B;
	cin >> A >> B;

	co(A * (A - 1) / 2 + B * (B - 1) / 2);

	Would you please return 0;
}

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


typedef long long ll;

#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define _GLIBCXX_DEBAC
/*map<Keyの型, Valueの型> 変数名;
queue<型> 変数名;
priority_queue<型> 変数名;
priority_queue<型, vector<型>, greater<型>> 変数名;*/
//copy(v1.begin(), v1.end(), back_inserter(v2));
using namespace std;

int gcd(int a, int b) {
	int c;
	if (a < b) {
		c = a; a = b; b = c;
	}
	while (b != 0) {
		c = a % b; a = b; b = c;
	}
	return a;
}

int sort_greater(int m,int n) {
	vector<int> a(m);
	for (int i = 0; i < m; i++) {
		cin >> a[i];
	}
	sort(a.begin(), a.end(),greater<int>());
	for (int i = 0; i < n; i++) {
		cout << a[i];
	}
		return 0;
}

int bubblesort(int a[], int n) {
	int sw = 0;
	bool flag = 1;
	for (int i = 0; flag; i++) {
		flag = 0;
		for (int j = n - 1; j >= i + 1; j--) {
			if (a[j] < a[j - 1]) {
				swap(a[j], a[j - 1]);
				flag = 1;
				sw += 1;
			}
		}
	}
	return sw;
}

int a_z()
{
	for (int i = 0; i <= ('Z' - 'A'); i++) {
		cout << (char)('A' + i);
	}
	return 0;
}

int selecttionsort(int a[], int n) {
	int t,sw = 0, minj;
	for (int i = 0; i < n - 1; i++) {
		minj = i;
		for (int j = 0; j < n - 1; j++) {
			if (a[j] < a[minj]) {
				minj = j;
			}
		}
		t = a[i]; a[i] = a[minj]; a[minj] = t;
		if (i != minj) sw += 1;

	}
	return sw;
}

bool is_prime(int x) {
	if (x <= 1) return false;
	for (int i = 2; i * i <= x; i++) {
		if (x % i == 0) return false;
	}
	return true;
}

map<string, int> memo;

using P=pair<int, int>;

struct Clock {
	int hour, minute, second;
	void set(int h, int m, int s) {
		hour = h; minute = m; second = s;
	}
	string to_str() {
		string h, m, s;
		h = to_string(hour);
		m= to_string(minute);
		s= to_string(second);
		if (h.size() < 2) h = "0" + h;
		if (m.size() < 2) m = "0" + m;
		if (s.size() < 2) s = "0" + s;
		return h + ":" + m + ":" + s;
	}
	void shift(int diff_second) {
		int h, m;
		h = diff_second / 3600;
		m = diff_second / 60;
		diff_second %= 60;
		second += diff_second;
		
	}
};


/*void dfs(int v, int p = -1) {
	for (int u : to[v]) {
		if (u == p) continue;
		ans[u] += ans[v];
		dfs(u, v);
	}
}*/
int main() {
	//sort(a.begin(),a.end());
	int a, b, c;
	cin >> a >> b >> c;
	if (c - (a - b) >= 0) cout << c - a + b;
	else cout << 0;
	return 0;
}









Measured memory_bytes: 256
package main

import(
    "fmt"
    "sort"
    "strings"
)

func SortString(s string) string{
    t := strings.Split(s, "")
    sort.Strings(t)
    return strings.Join(t, "")
}

func main() {
    var s string
    fmt.Scan(&s)
    ans := "No"
    if SortString(s) == "abc"{
        ans = "Yes"
    }
    fmt.Println(ans)
}





func abs32(a int) int {
    if a<0{
        return -a
    }
    return a
}

func abs64(a int64) int64 {
    if a<0{
        return -a
    }
    return a
}

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

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

func min64(a, b int64) int64 {
    if a >= b {
        return b
    }
    return a
}

func max64(a, b int64) int64 {
    if a >= b {
        return a
    }
    return b
}

func gcd(a, b int64) int64 {
    if a % b == 0 {
        return b
    } else {
        return gcd(b, a%b)
    }
}

func lcm(a, b int64) int64 {
    return a / gcd(a, b) * b
}

func scanNums(len int) (nums []int){
    var num int
    for i:=0; i<len; i++{
        fmt.Scan(&num)
        nums = append(nums,num)
    }
    return
}

func scanNums64(len int) (nums []int64){
    var num int64
    for i:=0; i<len; i++{
        fmt.Scan(&num)
        nums = append(nums,num)
    }
    return
}

func scanString(len int) (str []string){
    var s string
    for i:=0; i<len; i++{
        fmt.Scan(&s)
        str = append(str,s)
    }
    return
}

func scanTwoNums(n,m int) ([][]int){
    Nums := make([][]int, n)
    for i:=0; i<n; i++{
        Nums[i] = make([]int, m)
    }
    return Nums
}


Measured memory_bytes: 640
from collections import*
import sys
input=sys.stdin.readline
n=int(input())
a=list(map(int,input().split()))
a=Counter(a)
cnt=1
for i in range(min(a),max(a)+1):
	cnt_=a[i-1]+a[i]+a[i+1]
	if cnt_>cnt:cnt=cnt_
print(cnt)

Measured memory_bytes: 57500
//
//  main.cpp
//  Practice
//
//  Created by Hajime Sakamoto on 2019/12/17.
//  Copyright © 2019 Hajime Sakamoto. All rights reserved.
//  http://7ujm.net/stl/sort.html
//  https://marycore.jp/prog/cpp/vector-join/

#include <iostream>
#include <algorithm>
#include <vector>
#include <string>
#include <sstream>
#include <iterator>

using namespace std;

//数N，長さLの文字列を辞書順にソートして結合するクラス
class Iroha
{
public:
    int N;
    int L;
    vector<string> data;
    string s;
    string s_outPut;
    
    void s_input(){
        data.clear();
        
//        while(1) {
//            cin >> s;
//            if (cin.eof()) break;
//            data.push_back(s);
//        }
        for(int i = 0; i<N; i++) {
            cin >> s;
            data.push_back(s);
        }
    }
    
    void s_sort(){
        std::sort(data.begin(),data.end());//昇順ソート
                }
    
    void s_join(){//ostream_iteratorクラスで結合処理を実現
        std::ostringstream os;
        std::copy(data.begin(), data.end(), std::ostream_iterator<std::string>(os));
        s_outPut  = os.str(); // 文字列結合
    }
};



int main(int argc, const char * argv[]) {
    Iroha Prc;
    cin >> Prc.N;
    cin >> Prc.L;
    
    Prc.data.clear();
    for(int i = 0; i<Prc.N; i++) {
        cin >> Prc.s;
        Prc.data.push_back(Prc.s);
            }
    
    
    //Prc.s_input();
    Prc.s_sort();
    Prc.s_join();
    
    cout << Prc.s_outPut;
    
    return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <set>
#include <cmath>
#include <stdio.h>
#include <list>
#include <numeric>
#include <stack>
#include <queue>
#include <tuple>
#include <bitset>
#include <map>
#include <math.h>
//ceil(a/b)   (a + (b - 1))/ b
using namespace std;
#define rep(i,n) for(int i = 0; i < (n); i++)
typedef long long ll;
typedef pair<int,int> P;
const int inf=1000000007;
const ll mod=1000000007;
const double PI=3.14159265358979323846;
int dx[] = {1,-1,0,0};
int dy[] = {0,0,1,-1};

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

int cans(bool f){
  if(f) cout << "Yes" << endl;
  else cout << "No" << endl;
  return 0;
}

ll N,K;


ll man(ll N, ll val) {
  //  cout << val << endl;
  if(N==0) return val;
  return min(man(N-1, val*2),man(N-1, val + K));

}

int main() {
  ll N;

  ll sum = 0;
  ll ans = 0;
  cin >> N;
  ll A[N];
  rep(i,N) {
	cin >> A[i];
	A[i] %= mod;
	sum += A[i];
	sum %= mod;
  }
  
  rep(i,N-1) {
	sum -= A[i];
	if(sum < 0) sum += mod;
	ans += A[i]*sum;
	ans %= mod;
  }
  cout << ans << endl;
}



Measured memory_bytes: 4664
from queue import deque

k=int(input())
q=deque()
for i in range(1,10):
    q.append(i)

for i in range(k):
    x=q.popleft()
    if (x%10!=0):
        q.append(10*x+(x%10)-1)
    q.append(10*x+(x%10))
    if (x%10!=9):
        q.append(10*x+(x%10)+1)
        
print(x)

Measured memory_bytes: 18908
#include <iostream>
#include <algorithm>
#include <vector>
#include <cstring>

using namespace std;

int xdir[8] = {1, 1, 0, -1, -1, -1, 0, 1};
int ydir[8] = {0, 1, 1, 1, 0, -1, -1, -1};

struct Pa{
  int area;
  int num;
};

bool comp(const Pa& p1, const Pa& p2)
{
  return p1.area < p2.area;
}

int p;
void func(char a[1001][81], int s, int t, int prm[5], int dx, int dy)
{
  a[s][t] = ' ';
  for(int i = 0; i < 8; i++){
    if(a[s+ydir[i]][t+xdir[i]] == '*'){
      if(dx == xdir[i] && dy == ydir[i]){
	prm[p]++;
      } else {
	p++;
      }
      func(a, s+ydir[i], t+xdir[i], prm, xdir[i], ydir[i]);
      break;
    }
  }

  return ;
}

int main()
{
  int prm[5], n;
  char a[1001][81];
  bool f = false;
 
  while(cin >> n && n){
    vector<Pa> vec;
    int v = 0;
    cin.getline(a[0], sizeof(a[0]));
    for(int i = 0; i < n; i++){
      cin.getline(a[i], sizeof(a[i]));
    }
    if(f){
      cout << "----------" << endl;
    }

    for(int i = 0; i < n; i++){
      for(int j = 0, l= strlen(a[i]); j < l; j++){
	if(a[i][j] == '*'){
	  p = 0;
	  fill(prm, prm+5, 2);
	  func(a, i, j, prm, 0, 0);
	  int s = (prm[1]+prm[3])*prm[2]/2;
	  f = true;
	  for(int k = 0; k < v; k++){
	    if(vec[k].area == s){
	      vec[k].num++;
	      f = false;
	      break;
	    }
	  }
	  if(f){
	    Pa par;
	    par.area = s;
	    par.num = 1;
	    vec.push_back(par);
	    v++;
	  }
	}
      }
    }

    sort(vec.begin(), vec.end(), comp);
    for(int i = 0; i < v; i++){
      cout << vec[i].area << " " << vec[i].num << endl;
    }

    f = true;
  }

  return 0;
}

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

#define REP(i,init, n) for(lli i=init;i<n;i++)
#define REPE(i,init, n) for(lli i=init;i<=n;i++)
#define REPIT(it,container) for(auto it = container.begin(); it != container.end(); it++)
#define REPIT_R(it,container) for(auto it = container.rbegin(); it != container.rend(); it++)

#define ARRAY_LENGTH(array) (sizeof(array) / sizeof(array[0]))

typedef long long int lli;
typedef pair<lli, lli> P;

lli gcd(lli a, lli b) {
    if (a < b)
        swap(a, b);
    if (b == 0)
        return a;
    lli r;
      r = a % b;

  while(r!=0){
    a = b;
    b = r;
    r = a % b;
  }
  return b;
}

int main() {
    lli n;
    cin >> n;
    if (n == 1) {
        cout << 1 << endl;
        return 0;
    }
    vector<P> xy;
    REP(i, 0, n) {
        lli xi, yi;
        cin >> xi >> yi;
        xy.push_back(P(xi, yi));
    }
    sort(xy.begin(), xy.end());
    //REP(i, 0, xy.size()) {
    //    cout << "x: " << xy[i].first << ", y: " << xy[i].second << endl;
    //}
    lli ans = LLONG_MAX;
    REP(i, 0, n) {
        REP(j, 0, n) {
            if (i == j)
                continue;

            // この(p, q)の組み合わせでのコストを出す。
            lli p = xy[j].first - xy[i].first;
            lli q = xy[j].second - xy[i].second;

            // 集合を作る
            set<P> s;
            REP(i, 0, n) {
                s.insert(P(xy[i].first, xy[i].second));
            }

            // 一個取り出す => それに (p, q) を足してあったら消す、みたいにやっていく
            lli cur_cost = 0;
            lli x = xy[i].first;
            lli y = xy[i].second;
            bool is_first = true;
            while(true) {
                if (s.empty())
                    break;
                P target = P(x, y);
                if (s.find(target) != s.end()) {
                    s.erase(target);
                    if (is_first) {
                        cur_cost++;
                        is_first = !is_first;
                    }
                    x += p;
                    y += q;
                }
                else {
                    is_first = true;
                    auto it = s.begin();
                    x = it->first;
                    y = it->second;
                }

            }
            //REP(i, 0, n) {
            //    lli x = xy[i].first;
            //    lli y = xy[i].second;
            //    P orig = P(x, y);
            //    if (s.find(orig) == s.end()) {
            //        continue;
            //    }
            //    s.erase(orig);
            //    cur_cost++;
            //    while (true) {
            //        x += p;
            //        y += q;
            //        P target = P(x, y);

            //        if (s.find(target) == s.end()) {
            //            break;
            //        }

            //        s.erase(target);
            //    }
            //}

            ans = min(ans, cur_cost);
        }
    }
    cout << ans << endl;
}


Measured memory_bytes: 384
#include <cstdio>
#define FOR(i, l, r) for(int i = l; i <= r; ++i)

using namespace std;

long long n, a, b;

int main()
{
    scanf("%lld%lld%lld", &n, &a, &b);
    if (a * b < n || a + b - 1 > n) {puts("-1"); return 0;}
    FOR(i, 1, a) if (n - i * b + i < a)
    {
        for(int j = n - a + i; j > (i - 1) * b; --j) printf("%d ", j);
        FOR(j, n - a + i + 1, n) printf("%d ", j);
        break;
    }
    else for(int j = i * b; j > (i - 1) * b; --j) printf("%d ", j);
    return 0;
}


Measured memory_bytes: 2048
#include <bits/stdc++.h>
using namespace std;
typedef long long lint;
typedef pair<int,int> P;
const int INF=(int)1e9;
const int MOD=(int)1e9+7;
struct Accelerate_Cin{
    Accelerate_Cin(){
        cin.tie(0); ios::sync_with_stdio(0); cout<<fixed<<setprecision(20);
    };
};



int main(){
  int a[5];
  cin>>a[0]>>a[1]>>a[2];
  sort(a,a+3,greater<int>());
  int x=a[0]*10+a[1]+a[2];
  cout<<x<<"\n";

  return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int n,a[100050];
int main()
{
	cin>>n;
	for(int i=1;i<=n;i++)cin>>a[i];
	sort(a+1,a+n+1);
	printf("%d",a[n/2+1]-a[n/2]);
}

Measured memory_bytes: 640
// A - Beginner.cpp : このファイルには 'main' 関数が含まれています。プログラム実行の開始と終了がそこで行われます。
//

#include <iostream>
using namespace std;

int main()
{
	int N, R;
	cin >> N >> R;
	if (N > 10) {
		cout << R << endl;
	}else{
		cout << R - (100 * N) + 1000 << endl;
	}
	return 0;
}

Measured memory_bytes: 256
def myAnswer(A:int,B:int)-> str:
   if(A >B): return "GREATER"
   if(A<B): return "LESS"
   if(A==B): return "EQUAL"

def modelAnswer():
   tmp=1
def main():
   A = int(input())
   B = int(input())
   print(myAnswer(A,B))

if __name__ == '__main__':
   main()

Measured memory_bytes: 3060
#![allow(unused, non_snake_case, dead_code, non_upper_case_globals)]
use {
    proconio::{marker::*, *},
    std::{cmp::*, collections::*, mem::*},
};

#[fastout]
fn main() {
    input! {//
        n:usize,k:usize,
    }
    let mut dp = vec![vec![vec![0i128; 3333]; 55]; 55];
    dp[0][0][0] = 1;
    for i in 0..n {
        for rest in 0..n {
            for k in 0..=k {
                let ad = dp[i][rest][k];
                dp[i + 1][rest + 1][k + 2 * rest + 2] += ad;
                dp[i + 1][rest + 1][k + 2 * rest + 2] %= MOD;
                dp[i + 1][rest][k + 2 * rest] += ad;
                dp[i + 1][rest][k + 2 * rest] %= MOD;
                if rest > 0 {
                    dp[i + 1][rest - 1][k + 2 * rest - 2] += ad * (rest * rest) as i128;
                    dp[i + 1][rest - 1][k + 2 * rest - 2] %= MOD;
                    dp[i + 1][rest][k + 2 * rest] += ad * 2 * rest as i128;
                    dp[i + 1][rest][k + 2 * rest] %= MOD;
                }
                dp[i][rest][k] %= MOD;
            }
        }
    }
    println!("{}", dp[n][0][k] % MOD);
}
const MOD: i128 = 1000000007;


Measured memory_bytes: 159668
#include<bits/stdc++.h>
#include<algorithm>
 
#define  pb push_back
#define  mp make_pair
#define ll long long
#define vi vector<ll>
#define ff first
#define ss second
#define FOR(i,a,b) for(ll i=a;i<b;i++)
#define FORR(i,a,b) for(ll i=a-1;i>b;i--)
#define MOD 10e9+7
#define fastScan ios_base::sync_with_stdio(0); cin.tie(NULL)
#define s(v) sort(v.begin(),v.end())
 
 
using namespace std;
 
//vector<bool> s(1000000,true);

//vector<ll> a;
 
/*void prime(){
    FORor(ll i=2;i<1000000;i++){
        if(s[i] == true) a.pb((ll)i);
        ll j=2*i;
        while(j<1000000){
            if(s[j]!=FORalse) s[j]=FORalse;
            j+=i;
        }
    }
}
ll bs(ll s, ll l,ll h){
    ll m;
    while(l<=h){
        m = (l+h)>>1;
        if(a[m] < s) l= m+1;
        else h = m-1;
    }
    return l;
}
 
bool isprime(ll s, ll l,ll h){
    ll m;
    while(l<=h){
        m = (l+h)>>1;
        if(a[m]==s)return true;
        if(a[m] < s) l= m+1;
        else h = m-1;
    }
    return FORalse;
}
 
bool comp(pair<ll,ll> a, pair<ll,ll> b) {
    if(a.FORirst == b.FORirst)  return a.second<b.second;
    else return a.FORirst < b.FORirst;
}
 
ll FORact(ll n){
    if(n==1) return 1;
    else return n*FORact(n-1);
}

ll gcd(ll a,ll b){
    if(a==0)return b;
    return (b%a,a);
}*/

void solve(){
   ll n;
   cin >> n;
   vector<ll> a(n),dp(n);
    for(ll i=0;i<n;i++)cin >> a[i];
    dp[0] = 0;
    dp[1] = dp[0] + (abs(a[1] - a[0]));
    for(ll i=2;i<n;i++){
        dp[i] = min((dp[i-1] + abs(a[i] - a[i-1])),(dp[i-2] + abs(a[i] - a[i-2])));
    }
    cout << dp[n-1]<<endl;
    return;
}
 
int main(){
    fastScan;
    ll T=1;
    //cin >> T;
    while(T--){
        solve();
    }
    
    return 0;
}  

Measured memory_bytes: 1792
#include <iostream>
#include <cmath>
#include <vector>
using namespace std;

int mod = 998244353;

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

	long dp[n];
	dp[0] = 0;
	dp[1] = abs(a[1]-a[0]);
	for(int i=2;i<n;i++){
		dp[i] = min(dp[i-1]+abs(a[i]-a[i-1]),dp[i-2]+abs(a[i]-a[i-2]));
	}

	cout << dp[n-1] << endl;
}

Measured memory_bytes: 1792
#include <bits/stdc++.h>
#define endl "\n"
#define pb push_back
#define SZ(x) ((int)(x.size()))
#define FOR(i,s,n) for (ll i = (s); (i) < (n); ++i)
#define FORD(i,s,l) for (ll i = (s); (i) >= l; --i)
#define F first
#define S second
#define TC int __tc; cin >> __tc; FOR(case_num,1,__tc+1)
#define TEST(x,i) ((x)&(1ll<<(i)))
#define SET(x,i) ((x)|(1ll<<(i)))
#define FLIP(x,i) ((x)^(1ll<<(i)))
#define CLEAR(x,i) ((x)&~(1ll<<(i)))


const double pi = 4*atan(1);
using namespace std;
typedef long long ll;

const ll MOD = 1000000007;
const int MAXN = 200005;

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

	ll k;
	cin >> k;

	ll n = 50;
	vector<ll> a(n);
	iota(a.begin(),a.end(),0);

	ll r = k/n;

	FOR(i,0,n){
		a[i]+=r;
	}

	ll m = k%n;

	while(m--) {
		sort(a.begin(),a.end());
		a[0]+=n;
		FOR(i,1,n){
			a[i]--;
		}
	}
	cout << "50\n";
	FOR(i,0,n) {
		if (i) cout << " ";
		cout << a[i];
	}
	cout << "\n";


}


Measured memory_bytes: 3644
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;

class TEST{
	static void Main(){
		Sol mySol =new Sol();
		mySol.Solve();
	}
}

class Sol{
	public void Solve(){
		if(A <= 0 || A >= 10 || B <= 0 || B >= 10){
			Console.WriteLine(-1);
		} else { 
			Console.WriteLine(A * B);
		}
	}
	int A,B;
	public Sol(){
		var d = ria();
		A = d[0]; B = d[1];
	}

	static String rs(){return Console.ReadLine();}
	static int ri(){return int.Parse(Console.ReadLine());}
	static long rl(){return long.Parse(Console.ReadLine());}
	static double rd(){return double.Parse(Console.ReadLine());}
	static String[] rsa(char sep=' '){return Console.ReadLine().Split(sep);}
	static int[] ria(char sep=' '){return Array.ConvertAll(Console.ReadLine().Split(sep),e=>int.Parse(e));}
	static long[] rla(char sep=' '){return Array.ConvertAll(Console.ReadLine().Split(sep),e=>long.Parse(e));}
	static double[] rda(char sep=' '){return Array.ConvertAll(Console.ReadLine().Split(sep),e=>double.Parse(e));}
}


Measured memory_bytes: 13140
#pragma GCC optimize("Ofast")
#pragma GCC optimization ("unroll-loops")
#include<bits/stdc++.h>
 
#define for0(i,n) for(ll i = 0;i < (n);i++)
#define for1(i,n) for(ll i = 1;i<=(n);i++)
#define for2(i,n) for(ll i = 2;i<=(n);i++)
std::pair<int,int> DR[] = {{-1,0},{0,1},{1,0},{0,-1},{-1,1},{-1,-1},{1,1},{1,-1}};
#define rep(i,st,en,cnt) for(ll i = st;i <= en;i+=cnt)
#define PB push_back
#define MP make_pair
#define fastio cin.tie(NULL);cout.tie(NULL);ios::sync_with_stdio(false)
#define F first
#define S second
#define EPS 1e-12
#define all(x) (x).begin(),(x).end()
#define INF ll(2e18)
#define NEGINF -INF
#define TYPEMAX(type)   std::numeric_limits<type>::max()
#define inp_arr(a,n) for0(i,n) {cin>>a[i];}
#define out_arr(a,n) for0(i,n) {cout<<a[i]<<" ";}cout<<endl;
#define deb1(a) cout<<(a)<<endl;
#define deb2(a,b) cout<<(a)<<" "<<(b)<<endl;
#define deb3(a,b,c) cout<<(a)<<" "<<(b)<<" "<<(c)<<endl;
 
using namespace std;
 
typedef pair<int,int> ii;
typedef long long ll;
typedef pair<ll,ll> pll;
typedef vector<int> vi;
typedef vector<vector<int> > vvi;
typedef vector<ii> vii;
typedef vector<ll> vl;
typedef vector<vector<ll> > vvl;
typedef vector<pair<ll,ll> > vll;
typedef long double LD;
 
const ll mod =  998244353;

/* 
ll nop = 100;
vi primes(nop,1);
 
void sieve(){
    primes[1] = primes[0] = 0;
    for(ll i = 2;i * i <= nop;i++){
        if(primes[i]){
            for(ll j = i*i; j <= nop;j+=i){
                primes[j] = 0;
            }
        }
    }
}

ll phi(ll n) {
    ll tot = n;
    for(ll i = 2;i*i <= n;i++) {
        if(n%i == 0) {
            tot -= tot/i;
        }
        while(n%i == 0) {
            n /= i;
        }
    }
    if(n > 1) {
        tot -= tot/n;
    }
    return tot;
}
*/
 
ll gcd(ll a,ll b){    //a larger, b smaller
    if(b>a) swap(b,a);
    if(b==0) return a;
    return gcd(b,a%b);
}
/*
void extgcd(ll a,ll b,ll& x,ll& y){  //a smaller b larger
    if(a==0) {
        x = a;y = b;
        return;
    }
    extgcd(b%a,a,x,y);
    ll y1 = y,x1 = x;
    x = y1 - (b/a)*x1;
    y = x1;
}
 
ll lcm(ll a,ll b){
    return (a*b)/gcd(a,b);
}
 */
ll bexp(ll num,ll e){
    ll ans = 1;
    while(e>0){
        if(e&1){
            ans *= num;
        }
        num *= num;
        e>>= 1;
    }
    return ans;
}
 
ll mexp(ll num,ll e){
    ll ans = 1;
    while(e>0){
        if(e&1){
            ans = (ans*num)%mod;
        }
        num = (num*num)%mod;
        e>>=1;
    }
    return ans%mod;
}
 
ll modinv(ll a){
    return mexp(a,mod-2);
}

void solve() {
    int n,k;
    cin>>n>>k;
    vi p(n);
    inp_arr(p,n);
    sort(all(p));
    int cost = 0;
    for0(i,k) cost += p[i];
    deb1(cost);
}

int main() {
    fastio;
    #ifndef ONLINE_JUDGE
    freopen("input.txt","r",stdin);
    freopen("output.txt","w",stdout);
    #endif
    int t = 1;
    //cin>>t;
    for1(T,t) {
        solve();
    }
    return 0;
}


Measured memory_bytes: 3648