akhauriyash/Code-Regression huggingface dataset:
/*input
aaaaaaaaaaaaaaab
aaaaaaaaaaaaaaab
*/
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
using namespace std;
using namespace __gnu_pbds;
#define REP(i,j,k)     for(int i = j ; i < k ; ++i)
#define RREP(i,j,k)    for(int i = j ; i >=k ; --i)
#define A    first
#define B    second
#define mp   make_pair
#define pb   emplace_back
#define PII pair<int , int>
#define MEM(i,j)   memset(i , j , sizeof i)
#define ALL(i)     i.begin() , i.end()
#define DBGG(i,j)     cout << i << " " << j << endl
#define DB4(i,j,k,l)  cout << i << " " << j << " " << k << " " << l << endl
#define IOS cin.tie(0) , cout.sync_with_stdio(0)
#define endl "\n"
///------------------------------------------------------------
#define MAX 
#define INF 0x3f3f3f3f

string a , b;
int32_t main(){
    IOS;
    cin >> a >> b;
    int len = a.size() , ok = 0;
    if(a == b) ok = 1;
    REP(i , 1 , a.size()){
        string p = a.substr(i , a.size()) + a.substr(0 , i);
        if(p == b) ok = 1;
    }
    if(ok == 1) cout << "Yes" << endl;
    else cout << "No" << endl;
    return 0;
}

Measured memory_bytes: 256
ans' 1 s p =
  if elem s p then Just [[s]] else Nothing

ans' _ _ [] = Nothing

ans' k s (p:ps) =
  let a1 = ans' k s ps
      a2 = ans' (k-1) (s-p) ps
      a1'= case a1 of
             Just a -> a
             Nothing -> []
      a2'= case a2 of
             Just a -> map (\aa -> (p:aa) ) a
             Nothing -> []
  in
    Just (a1'++a2')

ans [n,k,s] =
  let p = [1..n]
      a = ans' k s p
  in
    case a of
      Just aa -> length aa
      Nothing -> 0

main = do
  c <- getContents
  let i = map (map read) $ map words $ lines c :: [[Int]]
      o = map ans $ takeWhile (\x -> x /= [0,0,0]) i
  mapM_ print o
  



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

using namespace std;

int main(int argc, char *argv[])
{
  int H, W;
  string C[101];
  cin >> H >> W;


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

  for (int i = 0; i < H*2; i++) {
    cout << C[i/2]<< endl;
  }

  return 0;
}


Measured memory_bytes: 256
'use strict';

function Main(INPUT) {
    const N = INPUT.split(" ").map(n => Number(n));
    if (N[0] <= 8 && N[1] <= 8) {
        console.log("Yay!");
    } else {
        console.log(":(");
    }
}

Main(require("fs").readFileSync("/dev/stdin", "utf8"));


Measured memory_bytes: 7372
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include<stdbool.h>

int max(int a,int b){if(a>b){return a;}return b;}
int min(int a,int b){if(a<b){return a;}return b;}
int sortfncsj(const void *a,const void *b){if(*(int *)a>*(int *)b){return 1;}if(*(int *)a==*(int *)b){return 0;}return -1;}

int isbr(char c){
  if(c=='('){return 1;}
  if(c=='['){return 2;}
  if(c==']'){return 3;}
  if(c==')'){return 4;}
  return 0;
}

int main(){
  int i,c;
  char s[128],stk[128];
  while(fgets(s,105,stdin),(!(strlen(s)<=2&&s[0]=='.'))){
    i=0;c=0;
    while(s[i]!=0){
      if(isbr(s[i])!=0){
        if(c==0 && isbr(s[i])>=3){c=5000;break;}
        if(c!=0 && isbr(stk[c-1])+isbr(s[i])==5 && (isbr(stk[c-1])<isbr(s[i]))){
          c--;
        }
        else{
          stk[c]=s[i];
          c++;
        }
      }
      i++;
    }
    if(c==0){printf("yes\n");}
    else{printf("no\n");}
  }
  return 0;
}



Measured memory_bytes: 2028
#include<stdio.h>

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

  int max;
  if((a>b)&&(a>c))
    max = a;
  if((b>a)&&(b>c))
    max = b;
  if((c>a)&&(c>b))
    max = c;

  int i;
  for(i=0;i<k;i++){
    if((a>b)&&(a>c))
      a *= 2;
    if((b>a)&&(b>c))
      b *= 2;
    else
      c *= 2;
  }

  printf("%d\n",a+b+c);
  return 0;
}

Measured memory_bytes: 1728
/*
 * Since g++10 is released, some characters is not valid inside #if 0 :(
 * So, why not using clang++? :D

 * Date:
  echo -n '  ' && date +%Y.%m.%d # Just Run this (Type !!sh in Vim).

 * Solution:
  To be updated after "Accept".

 * Digression:

 * CopyRight:
          ▁▃▄▄▄▃▃▃▃▄▶
        ▗▇▀▔    ▔▔▔▔
       ▄▛   ▃▅━━■▄▂
      ▟▊   ▐▘     ▀▙
     ▟▜▌   ▐▖   ▋  ▐▍
    ▟▘ ▜   ▝▀▇▆●▘  ▐▌
  ▗▟▘   ▜▃       ▁▅▛
  ▔▀▼▅▄▃▃██▅▄▄▄▅■▀▔
        ▔▔▔▔▔▔
 */

#include <cstdio>
#include <algorithm>
#define debug(...) fprintf(stderr, __VA_ARGS__)

typedef long long ll;

struct {
	inline operator int () { int x; return scanf("%d", &x), x; }
	inline operator ll () { ll x; return scanf("%lld", &x), x; }
	template<class T> inline void operator () (T &x) { x = *this; }
	template<class T, class ...A> inline void operator () (T &x, A &...a)
	{ x = *this; this -> operator () (a...); }
} read;

const int maxn = 55, maxk = 18;
int c[maxn];
ll C[maxn][maxn];

int main () {
	int n = read, m = read, a = read, b = read, ab = a ^ b;
	for (int k = 0; k < maxk; k ++)
		if (!(b >> k & 1) and a >> k & 1)
			return puts("0"), 0;

	int p = 0;
	for (int i = 1; i <= n; i ++) {
		int x = read;
		for (int k = 0; k < maxk; k ++)
			if (!(ab >> k & 1) and (x >> k & 1) != (a >> k & 1))
				goto fail;
		c[++ p] = x;
fail:;
	}
	n = p;
	if (m > n) m = n;

	for (int i = 0; i <= n; i ++) {
		C[i][0] = 1;
		for (int j = 1; j <= i; j ++)
			C[i][j] = C[i - 1][j] + C[i - 1][j - 1];
	}

	ll ans = 0;
	for (int S = ab; S >= 0; S --) {
		S &= ab;
		ll now = 0;
		for (int i = 1; i <= n; i ++) {
			int x = 0;
			for (int j = i + 1; j <= n; j ++)
				if ((c[i] & S) == (c[j] & S))
					++ x;
			/* debug("%d\n", x); */
			for (int j = 0; j < m; j ++)
				now += C[x][j];
		}
		for (int k = 0; k < maxk; k ++)
			if (S >> k & 1)
				now = -now;
		/* debug("%d : %lld\n", S, now); */
		ans += now;
	}

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


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

template<class T>
struct SegTree {
    int NN;
    T default_value;
    vector<T> data;

    T func(int a, int b) {
        return max(a, b);
    }

    SegTree(int N, T val) {
        default_value = val;
        NN = 1; while (NN < N) NN <<= 1;
        data = vector<T>(2 * NN, val);
    }

    SegTree(const vector<T> v, T val) {
        default_value = val;
        int N = v.size();
        NN = 1; while (NN < N) NN <<= 1;
        data = vector<T>(2 * NN, val);
        copy(v.begin(), v.end(), data.begin() + (NN - 1));
        build(0, 0, NN);
    }

    void build(int u, int l, int r) {
        if (r - l == 1) return;
        int m = (l + r) / 2;
        build(u * 2 + 1, l, m);
        build(u * 2 + 2, m, r);
        data[u] = func(data[2 * u + 1], data[2 * u + 2]);
    }

    T query(int a, int b, int u, int l, int r) {
        if (l >= b || r <= a)
            return default_value;
        if (l >= a && r <= b)
            return data[u];
        int m = (l + r) / 2;
        T res1 = query(a, b, u * 2 + 1, l, m);
        T res2 = query(a, b, u * 2 + 2, m, r);
        return func(res1, res2);
    }

    void update_value(int idx, T x, int u, int l, int r) {
        if (idx < l || idx >= r)
            return;
        if (idx == l && r - l == 1) {
            data[u] = x;
            return;
        }
        int m = (l + r) / 2;
        update_value(idx, x, u * 2 + 1, l, m);
        update_value(idx, x, u * 2 + 2, m, r);
        data[u] = func(data[2 * u + 1], data[2 * u + 2]);
    }

    void update_delta(int idx, T x, int u, int l, int r) {
        update_value(idx, data[NN - 1 + idx] + x, u, l, r);
    }
};

int solve() {
    int H, W, M;
    cin >> H >> W >> M;

    auto cntR = vector<int>(H, 0);
    auto cntC = vector<int>(W, 0);
    auto t = vector<vector<int>>(H, vector<int>());
    for (int i = 0; i < M; i++) {
        int r, c; 
        cin >> r >> c;
        r--; c--;
        cntR[r]++;
        cntC[c]++;
        t[r].push_back(c);
    }

    auto seg = SegTree<int>(cntC, 0);
    int ans = -1;
    for (int r = 0; r < H; r++) {
        for (auto c : t[r]) {
            seg.update_delta(c, -1, 0, 0, seg.NN);
        }
        int val = cntR[r] + seg.query(0, W, 0, 0, seg.NN);
        ans = max(ans, val);
        for (auto c : t[r]) {
            seg.update_delta(c, +1, 0, 0, seg.NN);
        }
    }
    return ans;
}

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

    cout << solve() << endl;

    return 0;
}

Measured memory_bytes: 27212
#include <bits/stdc++.h>
  using namespace std;
#define ll long long
#define fw(p) for(int w=0;w<(p);w++)
#define fx(p) for(int x=0;x<(p);x++)
#define fy(p) for(int y=0;y<(p);y++)
#define fz(p) for(int z=0;z<(p);z++)
#define fyg(p,g) for(int y=(g);y<(p);y++)
#define fzg(p,g) for(int z=(g);z<(p);z++)
#define ce(d) cout<<d<<endl;
 
int main() {
	string N,M;
	cin>>N>>M;
	map<char,int> S;
	bool ans=true;
	fx(M.size()){
if(x>=M.size()){break;}
		if(N.at(x)!=M.at(x)){
			if(S[N.at(x)]==0){
				S[N.at(x)]++;
				fyg(M.size(),x+1){
if(y>=M.size()){break;}
					if(M.at(y)==M.at(x)){
						if((N.at(y)!=N.at(x))){
if(!(M.at(y)==N.at(x)&&M.at(x)==N.at(y))){
						ans=false;
						y=M.size();
						x=M.size();
}
						}
					}

				}//fyg
				
fyg(M.size(),x+1){
if(y>=M.size()){break;}
					if(N.at(y)==N.at(x)){
						if((M.at(y)!=M.at(x))){
if(!(M.at(y)==N.at(x)&&M.at(x)==N.at(y))){
						ans=false;
						y=M.size();
						x=M.size();
}
						}
					}

				}//fyg

			}
		}
	}

if(ans){
ce("Yes")
}else{
	ce("No")
}
	
}

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

int main(void){
  int a,b,c,d,e,ans;
  
  cin >> a >> b >> c >> d >> e;
  if (a<0){
    ans = -a*c+d+b*e;
  } else {
    ans = (b-a)*e;
  }
  cout << ans << endl;
  return 0;
}



Measured memory_bytes: 3088
/*
　　　  ∧＿∧　やあ
　　 （´・ω・｀)　　　　　/　　　　　ようこそ、バーボンハウスへ。
　　 ／∇y:::::＼　　　 [￣]　　　　　このテキーラはサービスだから、まず飲んで落ち着いて欲しい。
　　 |:⊃:|:::::|　　　|──|
￣￣￣￣￣￣￣￣￣￣￣￣￣￣￣￣￣|　うん、「また」なんだ。済まない。
￣￣￣￣￣￣￣￣￣￣￣￣￣￣￣|￣　  仏の顔もって言うしね、謝って許してもらおうとも思っていない。
￣￣￣￣￣￣￣￣￣￣￣￣￣￣／|
　　　　∇　∇　∇　∇　　　／.／|　　　でも、この提出を見たとき、君は、きっと言葉では言い表せない
　　　　┴　┴　┴　┴　／ ／　  |　　　「ときめき」みたいなものを感じてくれたと思う。
￣￣￣￣￣￣￣￣￣￣|／　　  |　　　殺伐としたコンテストの中で、そういう気持ちを忘れないで欲しい
￣￣￣￣￣￣￣￣￣￣　　　　 |　　　そう思って、この提出を投げたんだ。
　　　(⊆⊇)　(⊆⊇)　(⊆⊇)　　|
　    ||　　 ||　　||　　|　　　 じゃあ、判定を聞こうか。
　　.／|＼　／|＼ ／|＼
*/

#include <iostream>
#include <cstdlib>
#include <algorithm>
#include <array>
#include <bitset>
#include <climits>
#include <cmath>
#include <cstdio>
#include <ctype.h>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <string>
#include <vector>
using namespace std;
#define fst first
#define snd second
#define ALL(obj) (obj).begin(),(obj).end()
#define debug(x) cerr << #x << " -> " << x << " (line:" << __LINE__ << ")" << '\n';
#define debugpair(x, y) cerr << "(" << #x << ", " << #y << ") -> (" << x << ", " << y << ") (line:" << __LINE__ << ")" << '\n';
typedef long long lint;
typedef priority_queue<int> p_que;
typedef priority_queue<int, vector<int>, greater<int>()> p_que_rev;
// const int INF = INT_MAX;
const lint LINF = LLONG_MAX;
const lint MOD = 1000000000 + 7;
const double EPS = 1e-9;
const double PI = acos(-1);
const int di[]{0, -1, 0, 1, -1, -1, 1, 1};
const int dj[]{1, 0, -1, 0, 1, -1, -1, 1};


int main()
{
    cin.tie(0);
    ios_base::sync_with_stdio(false);
    int a, b, c;
    cin >> a >> b >> c;
    cout << min(a + b, min(b + c, c + a)) << endl;
    return 0;
}

Measured memory_bytes: 256
// #define DEBUGGING
#include <bits/stdc++.h>
using namespace std;
#define endl '\n'
#define ALL(V) (V).begin(), (V).end()
#define ALLR(V) (V).rbegin(), (V).rend()

template <typename T> using V = vector<T>;
template <typename T> using VV = V<V<T>>;
template <typename T, typename U> using P = pair<T, U>;
using ll = int64_t;
using PLL = P<ll, ll>;

template <typename T> const T& var_min(const T &t) { return t; }
template <typename T> const T& var_max(const T &t) { return t; }
template <typename T, typename... Tail> const T& var_min(const T &t, const Tail&... tail) { return min(t, var_min(tail...)); }
template <typename T, typename... Tail> const T& var_max(const T &t, const Tail&... tail) { return max(t, var_max(tail...)); }
template <typename T, typename... Tail> void chmin(T &t, const Tail&... tail) { t = var_min(t, tail...); }
template <typename T, typename... Tail> void chmax(T &t, const Tail&... tail) { t = var_max(t, tail...); }
template <typename T> const T& clamp(const T &t, const T &low, const T &high) { return max(low, min(high, t)); }
template <typename T> void chclamp(T &t, const T &low, const T &high) { t = clamp(t, low, high); }

namespace init__ {

struct InitIO {
    InitIO() {
        cin.tie(nullptr);
        ios_base::sync_with_stdio(false);
        cout << fixed << setprecision(30);
    }
} init_io;

}

#ifdef DEBUGGING
#include "../debug.cpp"
#else
#define DEBUG(...) 0
#define DEBUG_SEPARATOR_LINE 0
#endif

template <typename T>
T make_v(T init) { return init; }

template <typename T, typename... Tail>
auto make_v(T init, size_t s, Tail... tail) {
#define rec make_v(init, tail...)
    return V<decltype(rec)>(s, rec);
#undef rec
}

int main() {
    ll N;
    cin >> N;
    V<ll> p(N);
    for(ll &e : p) cin >> e;
    ll ans = 0;
    for(ll i = 1; i < N - 1; i++) {
        ll tmp[] = { p[i - 1], p[i], p[i + 1] };
        sort(tmp, tmp + 3);
        ans += tmp[1] == p[i];
    }
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 256
//Now you are making me a boy with luvv...
//I don't want to do this but I'm being forced to ....pls help!!
#include <bits/stdc++.h>
using namespace std;
#define loop(x,n) for(int x = 0; x < n; ++x)
#define ed end()  
#define bg begin()
# define ld long double
#define ll long long
#define ub(v,a) upper_bound(all(v),a)
#define lb(v,a) lower_bound(all(v),a)
#define sz(a) (int)(a.size())
#define pb push_back
#define mp make_pair
#define all(v) v.begin(),v.end()
#define tr(v,it) for(auto it=v.begin();it!=v.end();it++)
#define present(v,x) (v.find(x)!=v.end()) //set/map etc.
#define vpresent(v,x) (find(all(v),x)!=v.end()) // vector
typedef vector< int > vi;
typedef vector< long long > vll;
typedef vector<pair<ll,ll>> vp;
typedef vector< vi > vvi;
typedef pair< int,int > pii;
const long long max_sz = 1e5 + 1;
const long long mod = 1e9 + 7;
const long long MAXN = 4e18 + 1;
char flip(char k){ if(k=='0') return '1'; return '0'; }
ll sum_digit(ll n){ ll a=0,i; for(i=n;i>0;i=i/10){ a+=(i%10);} return a; }
ll gcd(ll a, ll b){
	if(b == 0) return a;
	return gcd(b, a%b);
}
int main(){
                   // ios_base::sync_with_stdio(false);
                    //cin.tie(NULL);
                    //cout.tie(NULL);
 
                     ll t;
                   //  cin >> t;
                     t=1;
                     while (t--){
                           string s;cin>>s;
                           for(ll i=0;i<s.length();i++){
                               if(s[i]=='?')s[i]='D';
                           }
                           cout<<s<<endl;
                     }
                    cerr << endl
                                  << "Time : " << 1000 * ((double)clock()) / (double)CLOCKS_PER_SEC << "ms\n";
                      return 0;
}


Measured memory_bytes: 3856
#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;
    cin>>n;
    vector<ll>a(n),b(n);
    rep(i,n)cin>>a[i]>>b[i];
    reverse(a.begin(),a.end());
    reverse(b.begin(),b.end());
    ll ans=0;
    rep(i,n){
        a[i]+=ans;
        if(a[i]%b[i]!=0)ans+=b[i]-(a[i]%b[i]);
    }
    cout<<ans<<endl;
    return 0;
}

Measured memory_bytes: 1792
s = input()

if s[0] != "A":
  print("WA")
  exit()
  
if "C" not in s[2:-1]:
  print("WA")
  exit()
else:
  l = list(s[2:-1])
  l.remove("C")
  if "C" in l:
    print("WA")
    exit()

lst = list(s)
lst.remove("A")
lst.remove("C")
a = "".join(lst)

if a == a.lower():
  print("AC")
else:
  print("WA")
  

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

int main()
{
     string str;
     char apple[6] = "apple", peach[6] = "peach";
     getline(cin, str);
     int i = 0;
     while (i < str.size()) {
          if (str[i] == 'a') {
               string tmp;
               for (int k = 0; k < 5 && k + i < str.size(); k++)
                    tmp += str[i+k];
               if (tmp == "apple") {
                    for (int k = 0; k < 5; k++)
                         str[i+k] = peach[k];
                    i += 5;
	       }else i++;
          }else if (str[i] == 'p') {
	       string tmp;
	       for (int k = 0; k < 5 && i + k < str.size(); k++)
                    tmp += str[i+k];
	       if (tmp == "peach") {
                    for (int k = 0; k < 5; k++)
                         str[i+k] = apple[k];
                    i += 5;
	       }else i++;
          }else i++;
     }

     cout << str << endl;

     return 0;
}

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

using namespace std;
typedef long long ll;

ll n,arr[100005][5],dp[100005][5];

int main(){
    ios_base::sync_with_stdio(0);
    cin.tie(0);cout.tie(0);
    cin>>n;
    for(int i=0;i<n;i++)cin>>arr[i][0]>>arr[i][1]>>arr[i][2];
    dp[0][0]=arr[0][0];dp[0][1]=arr[0][1];dp[0][2]=arr[0][2];
    for(int i=1;i<n;i++){
        dp[i][0]=max(dp[i-1][1],dp[i-1][2])+arr[i][0];
        dp[i][1]=max(dp[i-1][0],dp[i-1][2])+arr[i][1];
        dp[i][2]=max(dp[i-1][1],dp[i-1][0])+arr[i][2];
    }
    cout<<max(dp[n-1][0],max(dp[n-1][1],dp[n-1][2]));
}

Measured memory_bytes: 8064
N, K = gets.split.take(2).map(&:to_i)
A = gets.split.take(N).map(&:to_i).sort

a = A.dup
while a.size > 1 && a[0] > 1
  b = a.pop - a[-1]
  if b > 0
    a[a.bsearch_index{|v|v>b}||a.size, 0] = b
  end
end

A.each{|n|
  if n >= K && (n - K) % a[0] == 0
    puts :POSSIBLE
    exit
  end
}
puts :IMPOSSIBLE


Measured memory_bytes: 11076
import java.util.*;
import java.io.*;

public class Main {
    public static void main(String[] args) throws Exception {
        // Your code here!
        
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String[] stdR1 = br.readLine().split(" ");
        int N = Integer.parseInt(stdR1[0]);
        int M = Integer.parseInt(stdR1[1]);
        
        String[] stdR2 = br.readLine().split(" ");
        PDT pdt = new PDT(N, M);
        
        for(int i = 0; i < N; i++){
            pdt.pq.add(Integer.parseInt(stdR2[i]));
        }
        
        System.out.println(pdt.minCost());
    }
}


class PDT {
    int N;
    int M;
    Queue pq;
    
    public PDT(int N, int M){
        this.N = N;
        this.M = M;
        pq  = new PriorityQueue(N, new MyComparator());
    }
    
    public long minCost(){
        
        long sum = 0;
        Iterator iterator = pq.iterator();
        while(iterator.hasNext()){
            sum += (int)iterator.next();
        }
        
        for(int i = 0; i < M; i++){
            int x = (int)pq.poll();
            int xdiv = x / 2;
            pq.add(xdiv);
            sum = sum - x + xdiv;
        }
        
        return sum;
    }
    
}

class MyComparator implements Comparator {
    
    public int compare(Object obj1, Object obj2){
        int num1 = (int)obj1;
        int num2 = (int)obj2;
        
        if(num1<num2){
            return 1;
        }else if(num1>num2){
            return -1;
        }else {
            return 0;
        }
    }
    
}










Measured memory_bytes: 49020
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using PII = pair<ll, ll>;
#define FOR(i, a, n) for (ll i = (ll)a; i < (ll)n; ++i)
#define REP(i, n) FOR(i, 0, n)
#define ALL(x) x.begin(), x.end()
template<typename T> void chmin(T &a, const T &b) { a = min(a, b); }
template<typename T> void chmax(T &a, const T &b) { a = max(a, b); }
struct FastIO {FastIO() { cin.tie(0); ios::sync_with_stdio(0); }}fastiofastio;
#ifdef DEBUG_ 
#include "../program_contest_library/memo/dump.hpp"
#else
#define dump(...)
#endif
const ll INF = 1LL<<60;

int main(void) {
    ll h, n;
    cin >> h >> n;
    vector<ll> a(n);
    REP(i, n) cin >> a[i];

    ll sum = 0;
    REP(i, n) sum += a[i];

    if(sum >= h) cout << "Yes" << endl;
    else cout << "No" << endl;

    return 0;
}

Measured memory_bytes: 1024
#include <iostream> // cout, endl, cin
#include <string> // string, to_string, stoi
#include <vector> // vector
#include <algorithm> // min, max, swap, sort, reverse, lower_bound, upper_bound
#include <utility> // pair, make_pair
#include <tuple> // tuple, make_tuple
#include <cstdint> // int64_t, int*_t
#include <cstdio> // printf
#include <map> // map
#include <queue> // queue, priority_queue
#include <set> // set
#include <stack> // stack
#include <deque> // deque
#include <unordered_map> // unordered_map
#include <unordered_set> // unordered_set
#include <bitset> // bitset
#include <cctype> // isupper, islower, isdigit, toupper, tolower
#include <iomanip> // fixed, setprecision 
#include <math.h> // double sqrt
#define rep(i,n) for(int i=0;i<(n);++i)
#define ll long long
using namespace std;
int enm(int n){
    int count=0,p=1;
    while(n>=0){
        n-=p;p++;count++;
        if(n-p<0)return count;
    }
};

vector<pair<long long, long long> > prime_factorize(long long N) {
    vector<pair<long long, long long> > res;
    for (long long a = 2; a * a <= N; ++a) {
        if (N % a != 0) continue;
        long long ex = 0; // 指数

        // 割れる限り割り続ける
        while (N % a == 0) {
            ++ex;
            N /= a;
        }

        // その結果を push
        res.push_back(make_pair(a,ex));
    }

    // 最後に残った数について
    if (N != 1) res.push_back(make_pair(N,1));
    return res;
}


int main(){
    ll n;
    cin>>n;
    vector<pair< long long, long long> > x= prime_factorize(n);
    ll ans=0;
    for(int i=0;i<x.size();i++){
        ans+=enm(x[i].second);
    }
cout<<ans;
return 0;
}

Measured memory_bytes: 3192
import java.util.*;
import java.io.*;

public class Main {
    public static void main(String[] args) throws IOException {
        FastScanner in = new FastScanner(System.in);
        PrintWriter out = new PrintWriter(System.out);
        int n = in.nextInt();
        long[] nums = in.nextLongArr(n);
        Arrays.sort(nums);
        int ct = 0;
        for (int i = 0; i < n; i++) {
            for (int j = i + 1; j < n; j++) {
                if (nums[j] == nums[i]) continue;
                for (int k = j + 1; k < n; k++) {
                    if (nums[k] == nums[j]) continue;
                    if (nums[i] + nums[j] > nums[k]) ct++;
                }
            }
        }
        out.println(ct);
        out.close();

    }


    static class FastScanner {
        BufferedReader br;
        StringTokenizer st;
        public FastScanner(InputStream i) {
            br = new BufferedReader(new InputStreamReader(i));
            st = new StringTokenizer("");
        }
        public String next() throws IOException {
            if (st.hasMoreTokens()) {
                return st.nextToken();
            }
            else
                st = new StringTokenizer(br.readLine());
            return next();
        }
        public int nextInt() throws IOException {
            return Integer.parseInt(next());
        }
        public double nextDouble() throws IOException {
            return Double.parseDouble(next());
        }
        public long nextLong() throws IOException {
            return Long.parseLong(next());
        }
        public String nextLine() throws IOException {
            if (!st.hasMoreTokens()) {
                st = new StringTokenizer(br.readLine());
                return nextLine();
            }

            String ret = "";
            while (st.hasMoreTokens()) {
                ret += st.nextToken();
            }
            return ret;
        }
        public int[] nextIntArr(int size) throws IOException {
            int[] arr = new int[size];
            for (int i = 0; i < arr.length; i++) {
                arr[i] = nextInt();
            }
            return arr;
        }
        public long[] nextLongArr(int size) throws IOException {
            long[] arr = new long[size];
            for (int i = 0; i < arr.length; i++) {
                arr[i] = nextLong();
            }
            return arr;
        }
        public double[] nextDoubleArr(int size) throws IOException {
            double[] arr = new double[size];
            for (int i = 0; i < arr.length; i++) {
                arr[i] = nextDouble();
            }
            return arr;
        }
    }
}

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

int main() {
	char s1[11], s2[11], s3[11];

	cin >> s1 >> s2 >> s3;
	char p1 = (char)(s1[0] - 'a' + 'A'),  p2 = (char)(s2[0] - 'a' + 'A'), p3 = (char)(s3[0] - 'a' + 'A');

	cout << p1 << p2 << p3 << endl;
}

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

int a[1000010];

int main(){
  int s; cin >> s;
  for(int i=0; i<1000010; i++) a[i]=0;
  
  for(int i=1; i<1000010; i++){
    if(a[s]==0){
      a[s]=1;
      if(s%2==0) s/=2;
      else s=s*3+1;
    }else{
      cout << i << endl;
      return 0;
    }
  }
}

Measured memory_bytes: 4096
#include <bits/stdc++.h>
#define rep(i, n) for(long long int i = 0; i < n; i++)
#define _rep(i, m, n) for(long long int i = m; i < n; i++)
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
const int N = 1000000;
const ll mod = 1000000007;
const int dx[4] = {1, 0, -1, 0};
const int dy[4] = {0, 1, 0, -1};

ll gcd(ll A, ll B){
    if(B == 0)return A;
    return gcd(B, A % B);
}
ll lcm(ll A, ll B){
    return A * B / gcd(A, B);
}

/*------------------------------------------------------------------*/
struct Edge{
    int to;
    ll welght;
    Edge(int t, ll w) : to(t), welght(w) { }
};
using Graph = vector<vector<Edge>>;
vector<ll> Weight;

void dfs(const Graph &G, int v, int p, ll w){
    Weight[v] = w;
    for(auto nv : G[v]){
        if(nv.to == p) continue;
        dfs(G, nv.to, v, w + nv.welght); 
    }
}

int main(){
    int n; cin >> n;
    Graph G(n);
    Weight.resize(n);

    for(int i = 0; i < n - 1; i++){
        int from, to, weight; cin >> from >> to >> weight;
        from--, to--;
        G[from].push_back(Edge(to, weight));
        G[to].push_back(Edge(from, weight));
    }
    int q, k; cin >> q >> k;
    k--;

    dfs(G, k, -1, 0);
    for(int i = 0; i < q; i++){
        int x, y; cin >> x >> y;
        x--, y--;
        cout << Weight[x] + Weight[y] << endl;
    }
}


Measured memory_bytes: 15872
import sys
from collections import deque
read = sys.stdin.buffer.read
readline = sys.stdin.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10 ** 7)

s = input()
q = int(input())
ans = deque(s)
cnt = 0
for _ in range(q):
    inp = readline().rstrip()
    if inp[0] == "2":
        if inp[2] == "1":
            if cnt % 2 == 0:
                ans.appendleft(inp[4])
            else:
                ans.append(inp[4])
        else:
            if cnt % 2 == 1:
                ans.appendleft(inp[4])
            else:
                ans.append(inp[4])
    else:
        cnt += 1

if cnt % 2 == 1:
    ans = list(ans)[::-1]
    
print("".join(ans))


Measured memory_bytes: 10092
#include <bits/stdc++.h>
#define rep(i,n) for(int i = 0; i < (int)(n); i++)
#define rrep(ri,n) for(int ri = (int)(n-1); ri >= 0; ri--)
#define rep2(i,x,n) for(int i = (int)(x); i < (int)(n); i++)
#define repit(itr,x) for(auto itr = x.begin(); itr != x.end(); itr++)
#define rrepit(ritr,x) for(auto ritr = x.rbegin(); ritr != x.rend(); ritr++)
#define ALL(n) begin(n), end(n)
using ll = long long;
using namespace std;

int main(){
  int a, p;
  cin >> a >> p;
  int ans = (a*3+p)/2;
  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define N 3009
#define INF 1000000009
#define MOD 1000000007
typedef long long int ll;
#define sd(x) scanf("%d",&x)
#define sd2(x,y) scanf("%d%d",&x,&y)
#define sd3(x,y,z) scanf("%d%d%d",&x,&y,&z)
#define pf(x) printf("%d",x);
#define pf2(x,y) printf("%d %d\n",x,y);
#define pf3(x,y,z) printf("%d %d %d\n",x,y,z);
#define fi first
#define se second
#define pb(x) push_back(x)
#define mp(x,y) make_pair(x,y)
#define _ ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define tr(x) cout<<x<< endl;
#define tr2(x,y) cout<<x<<" "<<y<<" " << endl;
#define tr3(x,y,z) cout<<x<<" "<<y<<" "<<z<<endl;
#define tr4(x,y,z,a) cout<<x<<" "<<y<<" "<<z<<  " " << a << " " << endl;
ll a[N];
ll dp[N][N],s[N][N];
ll fun(int i,int j){
    if(i==j){return a[i];}
    if(i>j || j<i){return -100000000000000;}
    if(dp[i][j]){return dp[i][j];}
    dp[i][j] = max(s[i][j]-fun(i+1,j),s[i][j]-fun(i,j-1));
    return dp[i][j];
}
int main(){ 
    int i,j,n,m,t,k,x,y;
    sd(n);
    for(i=0; i<n; i++){
        cin >> a[i];
    }
    for(i=0; i<n; i++){
        s[i][i]=a[i];
        for(j=i+1; j<n; j++){
            s[i][j]=s[i][j-1]+a[j];
            // tr3(i,j,s[i][j]);
        }
    }
    ll ans=2*fun(0,n-1)-s[0][n-1];
    tr(ans);
}


Measured memory_bytes: 141696
N,M = map(int,input().split())
ab = [list(map(int,input().split())) for _ in range(M)]
a = [0] * N

for i in range(M):
    a[ab[i][0] - 1] += 1
    a[ab[i][1] - 1] += 1
for i in range(N):
    print(a[i])

Measured memory_bytes: 3060
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <cmath>
#include <cassert>
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define REP(i,n) FOR(i,0,n)
#define rep(i,n) FOR(i,0,n)
#define DEBUG(x) cout<<#x<<": "<<x<<endl
#define vint vector<int>
#define vdouble vector<double>
#define vstring vector<string>
using namespace std;

#include<map>
#include<set>
#include<queue>

typedef long long ll;
typedef unsigned long long ull;

const int MAX_N = 1000000;
const int INFTY = (1 << 21); // 2097152
// const ll INFTY = (1LL << 60);
const ll MD = 1000000007LL;
// fprintf(stderr, "%d %lld \n", x, xll);


int A, B, C;
int main() {
	cin >> A >> B >> C;
	if(A == B) {cout << C << endl;}
	if(B == C) {cout << A << endl;}
	if(A == C) {cout << B << endl;}
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
#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<<')';
}
//}}}
const ll maxn=300005;
const ll maxlg=__lg(maxn)+2;
const ll INF64=8000000000000000000LL;
const int INF=2000000000;
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) a=a*a%MOD;
		else res=res*a%MOD;
		b>>=1;
	}
	res=res*a%mod;
	return res;
}
*/
int n,m;
int a[maxn];
string s,t;

int main()
{
	//IOS;
	cin>>n>>m;
	if(n%500<=m) cout<<"Yes\n";
	else cout<<"No\n";

	return 0;
}


Measured memory_bytes: 256
def main():
	n = int(input())
	total = 0
	for _ in range(n):
		x, u = input().split()
		x = float(x)
		if u == "BTC":
			total += 380000.0*x
		else:
			total += x
	print(total)

if __name__ == '__main__':
    main()

Measured memory_bytes: 2940
import java.util.ArrayList;
import java.util.Scanner;
 
public class Main {
    public static void main(String[] args) {
        int i, m, f, r, gou, flg = 0, cnt = 0;
	String seiseki;
        Scanner sc = new Scanner(System.in);
        ArrayList<Integer> mid = new ArrayList<Integer>(); //??????????¨?????????°??¨
	ArrayList<Integer> fin = new ArrayList<Integer>(); //???????????????????????°??¨
	ArrayList<Integer> rit = new ArrayList<Integer>(); //???????¨?????????°??¨
	ArrayList<Character> sei = new ArrayList<Character>(); //????????¨

	//??\?????????
	for(i = 0; flg == 0; i++){
       	    m = sc.nextInt();
       	    mid.add(new Integer(m));
       	    f = sc.nextInt();
	    fin.add(new Integer(f));
       	    r = sc.nextInt();
       	    rit.add(new Integer(r));
	    cnt++;
	    if(m == -1 && f == -1 && r == -1)
		break;
        }
	//??????????????????
        for(i = 0; cnt != i; i++){
	    gou = fin.get(new Integer(i)) + mid.get(new Integer(i));
	    if(fin.get(new Integer(i)) == -1 || mid.get(new Integer(i)) == -1)
		sei.add('F');
	    else if(gou >= 80)
		sei.add('A');
	    else if(gou >= 65)
		sei.add('B');
	    else if(gou >= 50 || rit.get(new Integer(i)) >= 50)
		sei.add('C');
	    else if(gou >= 30)
		sei.add('D');
	    else
		sei.add('F');
	}
	for(i = 0; cnt - 1 != i; i++){
	    System.out.println(sei.get(new Integer(i)));
	}
    }
}

Measured memory_bytes: 26272
#include <stdio.h>
#include <ctype.h>
#include <string.h>

int main() {
  int alpha;
  int cnt[256] = {0};
  while( (alpha = getchar()) != EOF ) {
    alpha = tolower( alpha );
    cnt[alpha]++;
  }
  for(alpha = 'a'; alpha <= 'z'; alpha++) {
    printf( "%c : %d\n", alpha, cnt[alpha] );
  }
  return 0;
}

Measured memory_bytes: 936
/*input
1
58
*/

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

#define mx 100005
#define ll long long
#define MOD 1000000007
#define fs first
#define sc second


int main()
{
	bitset<4000000> dp(1);
	int sum = 0;
	int n;
	scanf("%d", &n);

	for(int i = 0; i<n; i++)
	{
		int a;
		scanf("%d", &a);
		sum += a;
		dp |= dp << a;
	}
	for(int i = (sum+1)/2; ; i++)
		if(dp[i]) printf("%d\n", i), exit(0);
	return 0;
}


Measured memory_bytes: 1664
class Dice

  def initialize( given_ary )
    @ary = given_ary
  end

  def roll( direction )
    case direction.downcase
    when "e"
      tmp = @ary[0]
      @ary[0] = @ary[3]
      @ary[3] = @ary[5]
      @ary[5] = @ary[2]
      @ary[2] = tmp
    when "w"
      tmp = @ary[0]
      @ary[0] = @ary[2]
      @ary[2] = @ary[5]
      @ary[5] = @ary[3]
      @ary[3] = tmp
    when "s"
      tmp = @ary[0]
      @ary[0] = @ary[4]
      @ary[4] = @ary[5]
      @ary[5] = @ary[1]
      @ary[1] = tmp
    when "n"
      tmp = @ary[0]
      @ary[0] = @ary[1]
      @ary[1] = @ary[5]
      @ary[5] = @ary[4]
      @ary[4] = tmp
    end
  end

  def top
    @ary[ 0 ]
  end

end

dice = Dice.new( gets.split.map(&:to_i) )
gets.split('').each do | which |
  dice.roll( which )
end
puts dice.top

Measured memory_bytes: 6112
def actual(n, s):
    # 方針: 0->25 の世界で nだけシフトさせる → 65-90の世界に復元
    answer = ''

    ord_A = ord('A')

    for char in s:
        x = ord(char) - ord_A  # Aが0になるように初期化する
        y = (x + n) % 26  # mod 26 で 26パターンに分類できる
        z = y + ord_A  # 復元できるように補正する

        answer += chr(z)

    return answer


n = int(input())
s = input()
 
print(actual(n, s))

Measured memory_bytes: 3060
a = int(input())
array = list(map(int, input().split())) 
ans = "APPROVED"
nu = 0
for i in range (a):
  nu = array[i]
  if nu % 2 == 0:
    if nu % 3 == 0 or nu % 5 == 0:
      pass
    else:
      ans = "DENIED"
print(ans)


Measured memory_bytes: 2940
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
typedef pair<int, P> P1;
typedef pair<P, P> P2;
#define pu push
#define pb push_back
#define mp make_pair
#define eps 1e-7
#define INF 1000000000
#define fi first
#define sc second
#define rep(i, x) for (long long i = 0; i < x; i++)
#define repn(i, x) for (long long i = 1; i <= x; i++)
#define SORT(x) sort(x.begin(), x.end())
#define ERASE(x) x.erase(unique(x.begin(), x.end()), x.end())
#define POSL(x, v) (lower_bound(x.begin(), x.end(), v) - x.begin())
#define POSU(x, v) (upper_bound(x.begin(), x.end(), v) - x.begin())
vector<pair<string, P> > vec;
// vector<vector<int>> data(3, vector<int>(4));

int main() {
    ll N, K;
    cin >> N >> K;
    vector<ll> A(N);
    rep(i, N) {
        cin >> A[i];
        A[i];
    }
    ll t = 0, r = 1;
    map<ll, ll> m;
    while (m[t] == 0) {
        m[t] = r;
        t = A[t] - 1;
        r++;
    }
    ll oldk = K;
    K -= m[t] - 1;
    r -= m[t] - 1;
    r--;

    K %= r;

    // cout << m[t] - 1 << endl;
    ll aa = m[t] - 1;

    t = 0;
    if (aa > oldk) {
        rep(i, oldk) { t = A[t] - 1; }
        cout << t + 1 << endl;
        return 0;
    }

    rep(i, aa) {
        t = A[t] - 1;
        // cout << t << endl;
    }
    // cout << t << endl;
    // cout << t << endl;
    // cout << r << endl;
    // cout << K << endl;
    rep(i, K) {
        t = A[t] - 1;
        // cout << t << endl;
    }
    cout << t + 1 << endl;
    return 0;
}


Measured memory_bytes: 17164
#include<bits/stdc++.h>
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
#define mod 1000000007
#define MAX 1000000000000000
#define all(v) v.begin(),v.end()
#define rep(i,a,b) for(i=(ll)a;i<(ll)b;i++)
#define revrep(i,a,b) for(i=(ll)a;i>=(ll)b;i--)
#define ii pair<ll,ll>
#define MP make_pair
#define pb push_back
#define f first
#define se second
#define ll long long int
#define vi vector<ll>
ll modexp(ll a,ll b){ ll res = 1; while(b > 0){  if(b & 1) res = (res * a)%mod;  a = (a * a)%mod;  b/=2;  }  return res; }
#define rs resize
typedef tree< ll, null_type, less<ll>, rb_tree_tag, tree_order_statistics_node_update > OST;
#define TRACE
#ifdef TRACE
#define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
    template <typename Arg1>
    void __f(const char* name, Arg1&& arg1){
        cout << name << " : " << arg1 << endl;
    }
    template <typename Arg1, typename... Args>
    void __f(const char* names, Arg1&& arg1, Args&&... args){
        const char* comma = strchr(names + 1, ','); cout.write(names, comma - names) << " : " << arg1<<" | ";__f(comma+1, args...);
    }
#else
#define trace(...)
#endif

const ll N = 100009;
ll n,t,i;
int main()
{
    std::ios_base::sync_with_stdio(false); cin.tie(NULL);
    cin>>n;
    rep(i,0,n / 4 + 1){
        t = n - 4 * i;
        if(t % 7 == 0){
            cout<<"Yes";
            return 0;
        }
    }
    cout<<"No";
    return 0;
}

Measured memory_bytes: 256
import numpy as np
from collections import defaultdict
from math import gcd
import time
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines


start = time.time()
N, M = map(int, input().split(' '))
A = list(map(int, input().split(' ')))

if N-sum(A) >= 0:
    print(N-sum(A))
else:
    print(-1)


Measured memory_bytes: 27944
#include <vector>
#include <stack>
#include <queue>
#include <list>
#include <bitset>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <algorithm>
#include <numeric>
#include <iostream>
#include <iomanip>
#include <string>
#include <chrono>
#include <random>
#include <cmath>
#include <cassert>
#include <climits>
#include <cstring>
#include <cstdlib>
#include <functional>
#include <sstream>

using namespace std;


int main(int argc, char** argv) {
    ios::sync_with_stdio(false);
    cin.tie(0);
    int a , b;
    cin >> a >> b;

    int res = 0;
    if (b > 1) {
        res = (b - 1 + (a - 2)) / (a - 1);
    }
    cout << res << "\n";
    

    return 0;
}

Measured memory_bytes: 256
line = require('fs').readFileSync('/dev/stdin', 'ascii').split('\n');
line = line.slice(1, parseInt(line[0]) + 1);

bld = [];
for (i = 0; i < 4; i++) {
	floor = [];
	for (j = 0; j < 3; j++) {
		room = [];
		for (k = 0; k < 10; k++) room[k] = 0;
		floor.push(room);
	}
	bld.push(floor);
}

line.forEach(function(line) {
	ary = line.split(' ').map(Number).map(function(x) { return x-1; });
	bld[ary[0]][ary[1]][ary[2]] += ary[3] + 1;
});

for (i in bld) {
	floor = bld[i];
	for (j in floor) {
		room = floor[j];
		console.log('', room.join(' '));
	}
	if (i !== '3') console.log('####################');
}

Measured memory_bytes: 15844
A,B,C =map(int,input().split())
K = int(input())
num = 0
for i in range(K):
    if A>=B:
        B *= 2
        num += 1
    else:
        break
for j in range(K-num):
    C *= 2
if A<B<C:
    print("Yes")
else:
    print("No")

Measured memory_bytes: 61816
#include <bits/stdc++.h>
#include <boost/multiprecision/cpp_int.hpp>
#define repd(i, a, b) for (int i = (a); i < (b); i++)
#define rep(i, n) repd(i, 0, n)
namespace mp = boost::multiprecision;
using namespace std;
typedef mp::cpp_int ll;
typedef vector<int> vi;
typedef vector<vector<int>> vvi;


int main(int argc, const char * argv[]) {
   	cin.tie(0); ios::sync_with_stdio(false);
    // source code
    long a, b, k;
    cin >> a >> b >> k;
    cout << std::max({a-k, 0L}) << " " << std::max ( {std::min({b, a + b - k }), 0L}) << "\n";
    return 0;
}


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

using namespace std;

long long count(int cur, int accum, int target, int limit, int depth) {
  if (cur > limit)
    return 0;
  if (accum > target)
    return 0;
  int ans = 0;
  if (depth < 3) {
    if (depth == 2 && accum + cur == target)
      ans += 1;
    else
      ans += count(cur + 1, accum + cur, target, limit, depth + 1);
  }
  ans += count(cur + 1, accum, target, limit, depth);
  return ans;
}

int main(int argc, char* argv[]) {
  vector<int> n;
  vector<int> x;

  while (true) {
    int tmp_n, tmp_x;
    cin >> tmp_n >> tmp_x;
    if (tmp_n == 0 && tmp_x == 0)
      break;
    n.push_back(tmp_n);
    x.push_back(tmp_x);
  }

  for (int i = 0; i < n.size(); ++i) {
    long long ans = count(1, 0, x[i], n[i], 0);

    cout << ans << endl;

  }
  return 0;
}


Measured memory_bytes: 3108
def rot(s):
    tmp = s[0]
    s = s[1:]
    s += tmp

    return s


s1 = input()
s2 = input()

for i in range(len(s1)):
    if s1 == s2:
        print("Yes")
        exit(0)

    s2 = rot(s2)

print('No')



Measured memory_bytes: 2940
#include <iostream>
#include <string>
#include <cstring>
#include <algorithm>
#include <cstdio>
#include <cmath>
#include <vector>

using namespace std;

int main()
{
    int r,g;
    cin>>r>>g;
    cout<<g*2-r<<endl;
    return 0;
}


Measured memory_bytes: 256
import sys
S = input()
T = input()

dct = {}

for x, y in zip(S, T):
    if x in dct.keys():
        if dct[x] != y:
            print("No")
            sys.exit()
    dct[x] = y

if len(set(dct.keys())) != len(set(dct.values())):
    print("No")
else:
    print("Yes")

Measured memory_bytes: 3632
import java.util.Scanner;

public class Main {
	
	public static void main(String[] args) {
		
		Scanner input = new Scanner(System.in);
		
		//get first part of input
		int numOfDatasets = input.nextInt();
		String[] sequences = new String[numOfDatasets * 2];
		
		input.nextLine();
		
		//get sequences from input
		for(int i = 0; i < sequences.length; i++) {
			sequences[i] = input.nextLine();
		}
		
		for(int i = 0; i < sequences.length; i += 2) {
			
			//initialize matrix
			int[][] matrix = new int[sequences[i].length() + 1][sequences[i + 1].length() + 1];
			
			//set first row and column to all 0s
			for(int j = 0; j < matrix.length; j++) {
				matrix[j][0] = 0;	
			}
			for(int j = 1; j < matrix[0].length; j++) {
				matrix[0][j] = 0;
			}
			
			//complete the table
			for(int j = 0; j < matrix.length - 1; j++) {
				
				char rowChar = sequences[i].charAt(j);
				
				for(int k = 0; k < matrix[0].length - 1; k++) {
					
					char columnChar = sequences[i+1].charAt(k);
					
					if(rowChar == columnChar) {
						matrix[j+1][k+1] = matrix[j][k] + 1;
					}
					else {
						matrix[j+1][k+1] = java.lang.Math.max(matrix[j][k+1], matrix[j+1][k]);
					}
					
				}
				
			}
			
			System.out.println(matrix[matrix.length-1][matrix[0].length-1]);
			
		}
		
	}

}


Measured memory_bytes: 63908
import java.util.*;

public class Main{
  public static void main(String args[]){
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    int k = sc.nextInt();
    
    int[] l = new int[n];
    for(int i = 0;i < n;i++){
      l[i] = sc.nextInt();
    }
    Arrays.sort(l);
    int max_length = 0;
    for(int i = n-k;i < n;i++){
      max_length = max_length + l[i];
    }
    System.out.println(max_length);
  }
}

Measured memory_bytes: 20820
package main

import (
	"bufio"
	"fmt"
	"os"
	"sort"
	"strconv"
)

func out(x ...interface{}) {
	fmt.Println(x...)
}

var sc = bufio.NewScanner(os.Stdin)

func getInt() int {
	sc.Scan()
	i, e := strconv.Atoi(sc.Text())
	if e != nil {
		panic(e)
	}
	return i
}

func getString() string {
	sc.Scan()
	return sc.Text()
}

// min, max, asub, absなど基本関数
func max(a, b int) int {
	if a > b {
		return a
	}
	return b
}

func min(a, b int) int {
	if a < b {
		return a
	}
	return b
}

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

func abs(a int) int {
	if a >= 0 {
		return a
	}
	return -a
}

func lowerBound(a []int, x int) int {
	idx := sort.Search(len(a), func(i int) bool {
		return a[i] >= x
	})
	return idx
}

func upperBound(a []int, x int) int {
	idx := sort.Search(len(a), func(i int) bool {
		return a[i] > x
	})
	return idx
}

func main() {
	sc.Split(bufio.ScanWords)
	N, M := getInt(), getInt()
	x := make([]int, M)
	for i := 0; i < M; i++ {
		x[i] = getInt()
	}
	sort.Ints(x)
	if N >= M {
		out(0)
		return
	}

	d := make([]int, M-1)
	for i := 0; i < M-1; i++ {
		d[i] = abs(x[i] - x[i+1])
	}
	sort.Ints(d)

	ans := 0
	for i := 0; i < M-N; i++ {
		ans += d[i]
	}
	out(ans)
}


Measured memory_bytes: 2944
/*
ID: wangjun30
LANG: C++11
TASK:
*/
#include<iostream>
#include<algorithm>
#include<unordered_map>
#include<map>
#include<set>
#include<list>
#include<unordered_set>
#include<vector>
#include<bitset>
#include<queue>
#include<iomanip>
#include<cmath>
#include<cstdio>
#include<cstring>
#include<cmath>
#include<climits>
//#include<fstream>
using namespace std;
//ifstream cin(".in");
//ofstream cout(".out");
map<string,int> mp;
int main(){
	int n,maxv=-1;
	cin>>n;
	for(int i=1;i<=n;i++){
		string s;
		cin>>s;
		mp[s]++;
	}
	for(auto x:mp){
		maxv=max(maxv,x.second);
	}
	for(auto x:mp){
		if(x.second==maxv){
			cout<<x.first<<endl;
		}
	}
	return 0;
}

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

int main() {
  string s;
  cin >> s;
  vector<int> a(1e5, 0);
  rep(i, s.size()) {
    if (a[s[i]]) {
      puts("no");
      return 0;
    }
    a[s[i]]++;
  }
  puts("yes");
  return 0;
}

Measured memory_bytes: 640
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
// clang-format off
#define REP(i,n) for(int i=0, i##_len=(n); i<i##_len; ++i)
#define all(x) (x).begin(),(x).end()
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; }
// clang-format on

void solve(long long a, long long b, long long x) {
  long double S = (long double)x / a;
  long double rad;
  if (S >= (long double)a * b / 2) {
    long double h = ((long double)a * b - S) * 2 / a;
    rad = atan2(h, a);
  } else {
    long double w = S * 2 / b;
    rad = atan2(b, w);
  }
  long double deg = rad / 2 / acos(-1) * 360;
  printf("%.10Lf\n", deg);
}

int main() {
  long long a;
  scanf("%lld", &a);
  long long b;
  scanf("%lld", &b);
  long long x;
  scanf("%lld", &x);
  solve(a, b, x);
  return 0;
}


Measured memory_bytes: 256
#include <stdio.h>
#include <string.h>
int main() {
    int i,j,len;
    char s[120],t[120],temp;
    scanf("%s",s );
    scanf("%s",t );
    len=strlen(s);
    for(i=0;i<len;i++){
        for(j=0;j<len-1;j++){
	temp=s[j];
	s[j]=s[j+1];
	s[j+1]=temp;
        }
        if(strcmp(s,t)==0) {
	printf("Yes\n");
	 return 0;
        }
    }
    printf("No\n" );
    return 0;
}

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

using namespace std;

int main(){
    int c[3][3];
    bool ans = true;
    for(int i=0;i<3;i++){
        for(int j=0;j<3;j++){
            cin >> c[i][j];
        }
    }

    for(int i=1;i<3;i++){
        for(int j=1;j<3;j++){
            if(c[i][j] != c[i-1][j] + c[i][j-1] - c[i-1][j-1]){
                ans = false;
                break;
            }
        }
        if(!ans){
            break;
        }
    }

    if(ans){
        cout << "Yes" << endl;
    }else{
        cout << "No" << endl;
    }
}

Measured memory_bytes: 256