akhauriyash/Code-Regression huggingface dataset:
#include<bits/stdc++.h>
using namespace std;
#define rep(i,n) for(ll i=0;i<((int)n);i++)
#define rep1(i,n) for(ll i=1;i<=((int)n);i++)
#define pb push_back
#define IOS ios_base::sync_with_stdio(0); cin.tie(0)
#define int long long
#define F first
#define S second
typedef long long ll;

signed main()
{
    //IOS;
    ll a,b,c;
    while(cin>>a>>b>>c)
    {
        if(a+b+c>=22) cout<<"bust\n";
        else cout<<"win\n";
    }

}


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

using namespace std;

int main(){
    int n, t;
    cin >> n >> t;
    vector<int> A(n), B(n);
    vector<array<int, 2>> C(n);

    for (int i = 0; i < n; i++){
        cin >> A[i] >> B[i];
        C[i][0] = A[i];
        C[i][1] = B[i];
    }

    sort(C.begin(), C.end(), [](auto l, auto r){return l[0] < r[0] or (l[0] == r[0] and l[1] > r[1]);});

    vector<vector<int>> DP(n + 1, vector<int>(t));

    for (int i = 0; i < n; i++){
        for (int j = 0; j < t; j++){
            DP[i + 1][j] = max(DP[i + 1][j], DP[i][j]);
            if (j + C[i][0] < t)
                DP[i + 1][j + C[i][0]] = max(DP[i + 1][j + C[i][0]], DP[i][j] + C[i][1]);
        }
    }

    int ans = 0;

    for (int i = 0; i < n; i++){
        for (int j = 0; j < t; j++)
            ans = max(ans, DP[i][j] + C[i][1]);
    }

    cout << ans << endl;
}

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

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

  int c112 = c[0][1] - c[0][0];
  int c212 = c[1][1] - c[1][0];
  int c312 = c[2][1] - c[2][0];
  if (!(c112 == c212 && c212 == c312)) {
    cout << "No" << endl;
    return 0;
  }
  int c123 = c[0][2] - c[0][1];
  int c223 = c[0][2] - c[0][1];
  int c323 = c[0][2] - c[0][1];
  if (!(c123 == c223 && c223 == c323)) {
    cout << "No" << endl;
    return 0;
  }
  int c12a = c[1][0] - c[0][0];
  int c12b = c[1][1] - c[0][1];
  int c12c = c[1][2] - c[0][2];
  if (!(c12a == c12b && c12b == c12c)) {
    cout << "No" << endl;
    return 0;
  }
  int c23a = c[2][0] - c[1][0];
  int c23b = c[2][1] - c[1][1];
  int c23c = c[2][2] - c[1][2];
  if (!(c23a == c23b && c23b == c23c)) {
    cout << "No" << endl;
    return 0;
  }
  cout << "Yes" << endl;
}

Measured memory_bytes: 256
#pragma GCC optimize ("O3")

#include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
using namespace std;

using QWORD = unsigned long long;
using SQWORD = long long;
using DWORD = unsigned int;
using SDWORD = int;
using WORD = unsigned short;
using SWORD = short;
using DOUBLE = double;
using FLOAT = float;

#define MIN_SDWORD (-2147483648)
#define MAX_SDWORD (2147483647)
#define ArrayLength(a)  (sizeof(a) / sizeof(a[0]))

static inline QWORD MAX(QWORD a, QWORD b) { return a > b ? a : b; }
static inline DWORD MAX(DWORD a, DWORD b) { return a > b ? a : b; }
static inline SDWORD MAX(SDWORD a, SDWORD b) { return a > b ? a : b; }
static inline QWORD MIN(QWORD a, QWORD b) { return a < b ? a : b; }
static inline DWORD MIN(DWORD a, DWORD b) { return a < b ? a : b; }
static inline SDWORD MIN(SDWORD a, SDWORD b) { return a < b ? a : b; }

#define BYTE_BITS   (8)
#define WORD_BITS   (16)
#define DWORD_BITS  (32)
#define QWORD_BITS  (64)

using M_BOOL = bool;
#define M_TRUE (true)
#define M_FALSE (false)
#define DIVISOR (1000000007)

#define MAX_FACTORY (60)
static DWORD adwFactoryNum[MAX_FACTORY];
static DWORD adwFactoryCumMul[MAX_FACTORY];
static DWORD s_dwFactoryNum = 0;

static inline void inputString(char *pcStr)
{
    char *pcCur = pcStr;
    for (;;) {
        char c = getchar();
        if (('\n' == c) || (EOF == c)) {
            break;
        }
        *pcCur = c;
        pcCur++;
    }
    *pcCur = '\0';
}

static DWORD getIdx(char c)
{
    return (DWORD)(c - 'a');
}

static inline M_BOOL registTbl(char *pcTbl, char ca, char cb)
{
    if (0 == pcTbl[getIdx(ca)]) {
        pcTbl[getIdx(ca)] = cb;
    } else {
        if (cb != pcTbl[getIdx(ca)]) {
            return M_FALSE;
        }
    }
    return M_TRUE;
}

#define MAX_STRING (200000 + 1)
#define MAX_ALPHABETS (26)
int main()
{
    char acStr1[MAX_STRING];
    char acStr2[MAX_STRING];
    char acTransFormationTable1[MAX_ALPHABETS];
    char acTransFormationTable2[MAX_ALPHABETS];
    M_BOOL bMatched = M_FALSE;
    char *pcCur1 = acStr1;
    char *pcCur2 = acStr2;

    inputString(acStr1);
    inputString(acStr2);

    memset(acTransFormationTable1, 0, sizeof(acTransFormationTable1));
    memset(acTransFormationTable2, 0, sizeof(acTransFormationTable2));

    for (;;) {
        char c1, c2;
        c1 = *pcCur1;
        c2 = *pcCur2;

        if ((*pcCur1 == '\0') || (*pcCur2 == '\0')) {
            if (*pcCur2 == *pcCur1) {
                bMatched = M_TRUE;                
            } else {
                bMatched = M_FALSE;
            }
            break;
        }

        if (!registTbl(acTransFormationTable1, c1, c2)) {
            break;
        };
        if (!registTbl(acTransFormationTable2, c2, c1)) {
            break;
        }
        pcCur1++;
        pcCur2++;
    }

    if (bMatched) {
        printf("Yes");
    } else {
        printf("No");
    }

    return 0;
}


Measured memory_bytes: 640
def solve():
    _ = int(input())
    a = list(map(int, input().split()))
    
    x = max(a)
    y = 0
    min_d = 10 ** 9
    if x % 2 == 0:
        for ai in a:
            if x == ai:
                continue
            d = abs(x // 2 - ai)
            if d < min_d:
                y = ai
                min_d = d
    else:
        for ai in a:
            d = min(abs(x // 2 - ai), abs(x // 2 + 1 - ai))
            if d < min_d:
                y = ai
                min_d = d
    print(x, y)


if __name__ == '__main__':
    solve()


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

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

  int a, b;
  cin >> a >> b;

  int west = 1;

  // x is the east tower
  for (int x = 2; x <= 999; ++x) {
    int east = west + x;

    if (west - a == east - b) {
      cout << west - a << "\n";
      return 0;
    } else west = east;
  }

  return 1;
}


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

#define endl '\n'

using namespace std;

int main(){

  cin.tie(0);     // cout と cin の同期を切る
  ios::sync_with_stdio(false);  /* cの stdioストリーム (printfとか)と*/

  int N;

  string str;
  
  while(1){
  
    cin>>N;

    if(N==0){
      break;
    }

    cin>>str;

    //場にある札
    int cnt1=0;

    //自分が持ってる札
    int ans[11]={ };

    //プレーヤー
    int pos=0;
    
    for(int i=0;i<str.length();i++){

      //男
      if(str[i]=='M'){
	ans[pos]+=1;
      }

      //坊主
      else if(str[i]=='S'){
	cnt1+=(ans[pos]+1);
	ans[pos]=0;
      }

      //姫

      else if(str[i]=='L'){
	ans[pos]+=(cnt1+1);
	cnt1=0;
      }

      pos=(pos+1)%N;
    }

    sort(ans,ans+N);
    
    for(int i=0;i<N+1;i++){
      if(i==N){
	cout<<cnt1<<endl;
      }else{
	cout<<ans[i]<<" ";
      }
    }
  }
  
  return 0;

}



Measured memory_bytes: 3224
#include <iostream>
#include <algorithm>

using namespace std;

int main()
{
	int s, t;
	bool f;
	
	while(cin>>s>>t){
		int a[101];
		fill(a, a+101, 0);
		a[s] = a[t] = 1;
		while(cin>>s>>t && s && t){
			a[s]++;
			a[t]++;
		}
		f = true;
		if(a[1]%2 == 0 || a[2]%2 == 0){
			f = false;
		}
		for(int i = 3; i <= 100 && f; i++){
			if(a[i]%2 == 1){
				f = false;
			}
		}
		
		if(f){
			cout << "OK" << endl;
		} else {
			cout << "NG" << endl;
		}
	}
	
	return 0;
}

Measured memory_bytes: 0
#include <iostream>
#include <cstring>
#include <algorithm>
#include <vector>
#include <string>
#include <math.h>
#include <stdio.h>
#include <iomanip>
#include <limits>
#include <list>
#include <queue>
#include <tuple>
#include <map>
#include <set>
#include <sstream>
using namespace std;
#define MOD (long long int)(1e9+7)
#define ll long long int
#define rep(i,n) for(int i=0; i<(int)(n); i++)
#define reps(i,n) for(int i=1; i<=(int)(n); i++)
#define REP(i,n) for(int i=n-1; i>=0; i--)
#define REPS(i,n) for(int i=n; i>0; i--)
#define FOR(i,a,b) for(int i=a; i<(int)(b); i++)
#define ALL(x) (x).begin(),(x).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define SORT(c) sort(ALL(x))
#define CLR(a) memset((a), 0 ,sizeof(a))
#define PB push_back
#define MP make_pair
#define SP << " " <<
const int INF = 1001001001;
const ll LINF = 100100100100100100;
const double EPS = 1e-10;
const double PI  = acos(-1.0);
typedef pair<int,int> PII;
typedef vector<int> VI;
typedef vector<VI> VVI;

template<typename A, size_t N, typename T>
void Fill(A (&array)[N], const T &val){
    std::fill( (T*)array, (T*)(array+N), val );
}

__attribute__((constructor))
void initial(){
	cin.tie(nullptr);
	ios::sync_with_stdio(false);
	cout << fixed << setprecision(15);
}

signed main(){
  ll n,a,b; cin>>n>>a>>b;
  if(n==1){
    if(a==b) cout << 1 << endl;
    else cout << 0 << endl;
    return 0;
  }
  if(a>b) return cout<<0<<endl,0;
  cout << (b-a)*(n-2)+1 << endl;

  return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <numeric>

#define REP(i, a, b) for (int i = int(a); i < int(b); i++)
using namespace std;
typedef long long int ll;

// clang-format off
#ifdef _DEBUG_
#define dump(...) do{ cerr << __LINE__ << ":\t" << #__VA_ARGS__ << " = "; PPPPP(__VA_ARGS__); cerr << endl; } while(false)
template<typename T> void PPPPP(T t) { cerr << t; }
template<typename T, typename... S> void PPPPP(T t, S... s) { cerr << t << ", "; PPPPP(s...); }
#else
#define dump(...)
#endif
template<typename T> vector<T> make_v(size_t a, T b) { return vector<T>(a, b); }
template<typename... Ts> auto make_v(size_t a, Ts... ts) { return vector<decltype(make_v(ts...))>(a, make_v(ts...)); }
template<typename T>
bool chmin(T &a, T b) { if (a > b) {a = b; return true; } return false;}
template<typename T>
bool chmax(T &a, T b) { if (a < b) {a = b; return true; } return false;}
// clang-format on

int main() {
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    int L;
    cin >> L;
    int d = 0;
    {
        int c = 1;
        while (c <= L) {
            d++;
            c *= 2;
        }
    }
    dump(d);
    vector<int> a, b, c;
    {
        int t = 1 << (d - 1);
        REP(i, 0, d - 1) {
            t /= 2;
            a.push_back(i + 1);
            b.push_back(i + 2);
            c.push_back(t);
            a.push_back(i + 1);
            b.push_back(i + 2);
            c.push_back(0);
        }
    }

    for (int i = d - 2; i >= 0; i--) {
        int u = L >> i;
        if (u & 1) {
            a.push_back(1);
            b.push_back(d - i);
            c.push_back((u >> 1) << (i + 1));
        }
    }
    cout << d << " " << a.size() << endl;
    REP(i, 0, a.size()) {
        cout << a[i] << " " << b[i] << " " << c[i] << endl;
    }

    return 0;
}


Measured memory_bytes: 256
#include <iostream>

using namespace std;

int main()
{
    int heal, moves, n;
    cin >> heal >> moves;
    for (int i=0 ; i<moves; i++)
    {
        cin >> n;
        heal -= n;
    }
    if (heal > 0)
        cout << "No";
    else
        cout << "Yes";
    return 0;
}

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

#include "bits/stdc++.h"
#define int long long
#define rep(i, n)           for (int i = 0; i < (int)(n); i++)
#define REP(i, a, b)        for (int i = (int)(a); i < (int)(b); i++)
#define FOR(i, a)           for (auto &i : a)
#define ALL(obj)            begin(obj), end(obj)
#define MAX(x)              *max_element(ALL(x))
#define MIN(x)              *min_element(ALL(x))
#define SUM(x)              accumulate(ALL(x), 0LL)
#define LOWER_BOUND(A, key) distance(A.begin(), lower_bound(ALL(A), key))
#define UPPER_BOUND(A, key) distance(A.begin(), upper_bound(ALL(A), key))

using namespace std;
const int MOD    = (int)(1e9 + 7);
const int INF    = (int)(1e13 + 7);
const double EPS = 1e-14;
const double PI  = acos(-1);

int CEIL(int a, int b) { return (a >= 0 ? (a + (b - 1)) / b : (a - (b - 1)) / b); } //ceil() for int
int mod(int a, int b) { return a >= 0 ? a % b : a - (b * CEIL(a, b)); }             //always return positive num
int bpm(int a, int b) {                                                             //return x^y in order(log(y))
  int res = 1;
  for (a %= MOD; b; a = a * a % MOD, b >>= 1)
    if (b & 1) res = res * a % MOD;
  return res;
}

class B {
public:
  static void solve(istream &cin, ostream &cout) {
    int H, W;
    cin >> H >> W;
    vector<string> temp(H);
    rep(i, H) cin >> temp[i];
    rep(i, H) cout << temp[i] << endl
                   << temp[i] << endl;
  }
};


signed main() {
  cin.tie(0);
  cout.tie(0);
  ios_base::sync_with_stdio(false);
  cout<<fixed<<setprecision(15);
  B solver;
  std::istream& in(std::cin);
  std::ostream& out(std::cout);
  solver.solve(in, out);
  return 0;
}


Measured memory_bytes: 3596
a=input()
ok=True
for i in range(len(a)):
    if (i+1)%2==0 and a[i]=="R":
        ok=False
        break
    if (i+1)%2==1 and a[i]=="L":
        ok=False
        break
 
if ok:
    print("Yes")
else:
    print("No")

Measured memory_bytes: 8932
#include<bits/stdc++.h>
using namespace std;
const int M=1000000007;
const int N=1000005;
int i,n;
char c[15];
int main()
{
	scanf("%s",c);
	for(i=0;c[i];i+=2)
		if(!(c[i]=='h'&&c[i+1]=='i'))
		{
			puts("No");
			return 0;
		}
	puts("Yes");
}

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

int main(){
    string s;
    cin >> s;
    bool flag=true;
    int n=s.size();
    for(int i=0; i<n; i++){
        if(s[i]=='R'){
            switch (i%2)
            {
            case 0:
                continue;
                break;
            case 1:
                flag=false;
                break;
            default:
                break;
            }
        }
        if(s[i]=='L'){
            switch (i%2)
            {
            case 1:
                continue;
                break;
            case 0:
                flag=false;
                break;
            default:
                break;
            }
        }
    }

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

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define int long long int
#define rep(i, a, b) for (int i = a; i < b; i++)
#define revrep(i, a, b) for (int i = a; i >= b; i--)
#define pb push_back
int INF = 1e14;
int mod = 1e9 + 7;

int power(int x, unsigned int y)
{
    int temp;
    if (y == 0)
        return 1;
    temp = power(x, y / 2) % mod;
    if (y % 2 == 0)
        return (temp * temp) % mod;
    else
        return x * ((temp * temp) % mod) % mod;
}

signed main()
{

    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int t;
    // cin >> t;
    t = 1;
    while (t--)
    {
        int x, y;
        cin >> x >> y;
        int ans = false;
        rep(i, 0, x + 1)
        {
            if (i * 4 + (x - i) * 2 == y)
            {
                ans = true;
                break;
            }
        }
        if (ans)
            cout << "Yes" << endl;
        else
            cout << "No" << endl;
    }

    return 0;
}


Measured memory_bytes: 3608
s = input()
t = input()
ns=len(s)
nt=len(t)
cnt=1010
for i in range(ns+1-nt):
    tmp=0
    for j in range(nt):
        if t[j]!=s[i+j]:
            tmp+=1
    cnt=min(tmp,cnt)
print(cnt)

Measured memory_bytes: 67576
#include <bits/stdc++.h>
using namespace std;
#define REP(i,n) for (int i=0;i<(n);i++)
#define REP2(i,m,n) for (int i=m;i<(n);i++)

int A[1000];
int dp1[1000001];
int dp2[1000001];

int main() {
    A[0] = 0;
    A[1] = 1;
    REP2(i, 1, 200) A[i+1] = A[i] * (i+3) / i;

    dp1[0] = 0;
    dp1[1] = 1;
    REP2(i, 2, 1000001) dp1[i] = 1 << 29;
    REP2(i, 2, 1000001) REP(j, 200) {
        if (i < A[j]) break;
        dp1[i] = min(dp1[i], dp1[i-A[j]] + 1);
    }

    dp2[0] = 0;
    dp2[1] = 1;
    REP2(i, 2, 1000001) dp2[i] = 1 << 29;
    REP2(i, 2, 1000001) REP(j, 200) {
        if (i < A[j]) break;
        if (A[j] % 2 == 0) continue;
        dp2[i] = min(dp2[i], dp2[i-A[j]] + 1);
    }

    
    while (true) {
        int N;
        cin >> N;
        if (N == 0) break;
        cout << dp1[N] << " " << dp2[N] << endl;
    }
}

Measured memory_bytes: 10892
#include <bits/stdc++.h>
#define int long long
#define ll long long
using ull = unsigned long long;
using namespace std;
const int INF = 1e10;
const int MOD = 1e9 + 7;
#define dump(x)                             \
    if (dbg) {                              \
        cerr << #x << " = " << (x) << endl; \
    }
#define overload4(_1, _2, _3, _4, name, ...) name
#define FOR1(n) for (ll i = 0; i < (n); ++i)
#define FOR2(i, n) for (ll i = 0; i < (n); ++i)
#define FOR3(i, a, b) for (ll i = (a); i < (b); ++i)
#define FOR4(i, a, b, c) for (ll i = (a); i < (b); i += (c))
#define FOR(...) overload4(__VA_ARGS__, FOR4, FOR3, FOR2, FOR1)(__VA_ARGS__)
#define FORR(i, a, b) for (int i = (a); i <= (b); ++i)
template <class T>
bool chmin(T& a, const T& b) {
    if (a > b) {
        a = b;
        return 1;
    } else
        return 0;
}
template <class T>
bool chmax(T& a, const T& b) {
    if (a < b) {
        a = b;
        return 1;
    } else
        return 0;
}
#define pb push_back
#define mp make_pair
#define lb lower_bound
#define ub upper_bound
#define all(v) (v).begin(), (v).end()
#define SZ(x) ((int)(x).size())
#define P pair<int, int>
#define V vector<int>
//#define S set<int>
#define itn int
bool dbg = false;


int N;
string S, T;

void solve() {
}

signed main() {
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    cin >> N;
    cin >> S >> T;
    FOR(N) {
        cout << S[i] << T[i];
    }
    cout << endl;
    solve();
    return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <cstring>
#include <algorithm>
#include <functional>
#include <cmath>
#include <set>
#include <queue>
#include <vector>
#include <climits>
#include <sstream>
#include <iomanip>
#include <map>
using namespace std;

int main()
{
	int A, B, C, X;
	cin >> A >> B >> C >> X;

	auto count = 0;
	for (auto i = 0; i <= A; ++i)
	{
		for (auto j = 0; j <= B; ++j)
		{
			auto remain = X - (i * 500 + j * 100);
			if (remain < 0)
			{
				continue;
			}

			if ((remain % 50 == 0) && (remain / 50 <= C))
			{
				++count;
			}
		}
	}

	cout << count << endl;

	return 0;
}


Measured memory_bytes: 256
#include <numeric>
#include <vector>
#include <iostream>
#include <string>
#include <cmath>
#include <iomanip>
#include <algorithm>
#include <numeric>
#include <queue>
using namespace std;

int main(const int args, const char* argv[])
{
    int nums;
    cin >> nums;
    auto cmp = [](const long long a, const long long b){
        return a > b;
    };
    priority_queue<long long, vector<long long>, decltype(cmp)> Queue(cmp);
    vector<long long> inputVec;
    
    for(int i = 0; i < nums; i++)
    {
        long long tmp;
        cin >> tmp;
        Queue.push(tmp);
        inputVec.push_back(tmp);
    }
    int tmpI(0);
    while(true)
    {
        if(Queue.top() == inputVec[tmpI])
        {
            cout << tmpI + 1 << endl;
            break;
        }
        tmpI++;
    }
    

    return 0;
}


Measured memory_bytes: 4744
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        int n = sc.nextInt();
        String s = sc.next();
        String t = sc.next();

        StringBuffer sb = new StringBuffer();
        for (int i = 0; i < n; i++) {
            sb.append(s.charAt(i));
            sb.append(t.charAt(i));
        }
        System.out.println(sb);
    }
}


Measured memory_bytes: 23636
while n = gets
  n = n.to_i
  count = 0
  10.times do |a|
    10.times do |b|
      10.times do |c|
        10.times do |d|
          if a + b + c + d == n
            #puts "#{a}, #{b}, #{c}, #{d}"
            count += 1
          end
        end
      end
    end
  end
  p count
end

Measured memory_bytes: 6104
#include <bits/stdc++.h>
#define rep(i, a, b) for(ll i = ll(a); i < ll(b); i++)
#define rer(i, a, b) for(ll i = ll(a) - 1; i >= ll(b); i--)
#define sz(v) (int)(v).size()
#define pb push_back
#define sc second
#define fr first
#define sor(v) sort(v.begin(),v.end())
#define rev(s) reverse(s.begin(),s.end())
#define lb(vec,a) lower_bound(vec.begin(),vec.end(),a)
#define ub(vec,a) upper_bound(vec.begin(),vec.end(),a)
#define uniq(vec) vec.erase(unique(vec.begin(),vec.end()),vec.end())
using namespace std;
typedef long long int ll;
typedef pair <int, int> P;

const ll MOD=1000000007;
int prime[10000]; //i番目の素数
bool is_prime[10000+1];  //iが素数ならtrue

//n以下の素数の数を返す
int sieve(ll n){
    ll p = 0;
    rep(i,0,n+1) is_prime[i]=true;
    is_prime[0]=is_prime[1]=false;
    rep(i,2,n+1){
        if (is_prime[i]){
            p++;
            prime[p]=i;
            for (int j=2*i; j<=n; j+=i) is_prime[j]=false;
        }
    }
    return p;
}
ll gcd (ll a, ll b){
    if (b==0) return a;
    return gcd(b, a%b);
}
set<ll> ans; //素因数
void prime_factor(ll n){
    for (ll i=2; i*i<=n; i++){
        while(n%i==0){
            ans.insert(i);
            n/=i;
        }
    }
    if (n!=1){
        ans.insert(n);
    }
}
int N;
bool div(vector<ll> a, ll p){
    rer(i,N-p+1,0){
        a[i+1]+=a[i+p];
        a[i+1]%=p;
        a[i+p]=0;
    }
    rep(i,0,p){
        a[i]%=p;
    }
    vector<ll> v(N+1,0);
    if(v==a) return true;
    else return false;
}
int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    cin>>N;
    vector<ll> A(N+1,0);
    cin>>A[N];
    ll g=A[N];
    rep(i,1,N+1){
        cin>>A[N-i];
        g=gcd(g,A[N-i]);
    }
    prime_factor(abs(g));
    int k=sieve(N);
    rep(x,1,k+1){
        ll p=prime[x];
        if(div(A,p)) ans.insert(p);
    }
    for(ll t : ans){
        cout <<t<<"\n";
    }
}

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

int main() {
  int N, M;
  cin >> N >> M;
  vector<int> A(M*2);
  for(int i = 0; i < M*2; i++){
    cin >> A.at(i);
  }
  for(int i = 0; i < N; i++){
    int x;
    x = 0;
    for(int j = 0; j < M*2; j++){
      if(i+1 == A.at(j)){
      x++;
      }
    }
    cout << x << endl;
  }
}


Measured memory_bytes: 256
#include<stdio.h>

int main(){
  int i;
  int N,M;
  scanf("%d",&N);
  
  int X[N];
  for(i=0; i<N; i++){
    scanf("%d",&X[i]);
  }
  
  scanf("%d",&M);
  
  int A[M];
  for(i=0; i<M; i++){
    scanf("%d",&A[i]);
  }
  
  for(i=0; i<M; i++){
    if(A[i]==N || X[A[i]]-X[A[i]-1]!=1){ 
      X[A[i]-1]++;
      if(X[A[i]-1]>=2019)
	X[A[i]-1]=2019;
    }
  }

  for(i=0; i<N; i++){
    printf("%d\n",X[i]);
  }
  return 0;
}



Measured memory_bytes: 2148
#include<iostream>
using namespace std;
static const int MAX = 100;

void printArray(int a[], int n)
{
	for (int i = 0; i < n; i++) {
		cout << a[i] << (i != n - 1 ? " " : "");
	}
	cout << endl;
}


int main()
{
	int n;
	int A[MAX];
	cin >> n;
	for (int i = 0; i < n; i++) {
		cin >> A[i];
	}
	printArray(A, n);
	for (int i = 1; i < n; i++) {
		int key = A[i];
		int j = i - 1;
		while (j >= 0 && A[j] > key) {
			A[j + 1] = A[j];
			j--;
		}
		A[j + 1] = key;
		printArray(A, n);
	}


    return 0;
}

Measured memory_bytes: 3092
#include <bits/stdc++.h>
using namespace std;
#define LL long long
#define VI vector<int>
#define VVI vector<vector<int>>
#define UM unordered_map
#define MP map
#define ST set
#define US unordered_set
#define V vector
#define S string
#define D deque
#define L list
#define Q queue
#define PQ priority_queue
#define DB double
#define LDB long double
#define FOR(i, n) for (int(i) = 0; (i) < (n); ++(i))
#define FFOR(i, n) for (int(i) = 0; (i) <= (n); ++(i))
#define RFOR(i, n) for (int(i) = (n)-1; (i) >= 0; --(i))
#define all(v) (v).begin(), (v).end()

const int dr[] = {0, 1, 0, -1};
const int dc[] = {1, 0, -1, 0};

int nxt()
{
    int n;
    cin >> n;
    return n;
}

LL llnxt()
{
    LL l;
    cin >> l;
    return l;
}

LDB ldbnxt()
{
    LDB n;
    cin >> n;
    return n;
}

DB dbnxt()
{
    DB n;
    cin >> n;
    return n;
}

void bfs(VVI &graph, int start)
{
    int n = graph.size();
    Q<int> q;
    V<bool> visited(n);
    q.push(start);
    visited[start] = true;
    while (not q.empty())
    {
        auto curr = q.front();
        q.pop();
        for (auto i : graph[curr])
        {
            if (not visited[i])
            {
                q.push(i);
                visited[i] = true;
            }
        }
    }
}

int main()
{
    int n, m, k;
    cin >> n >> m >> k;
    VI l(n), r(m);
    generate(all(l), nxt);
    generate(all(r), nxt);
    LL sum = 0;
    int i = 0;
    for (; i < n; ++i) {
        if (sum + l[i] > k) {
            break;
        }
        sum += l[i];
    }
    int best = i--;
    for (int j = 0; j < m; ++j) {
        sum += r[j];
        while (sum > k and i >= 0) {
            sum -= l[i];
            --i;
        }
        if (i < 0 and sum > k) break;
        best = max(best, i+j+2);
    }
    cout << best;
}

Measured memory_bytes: 4788
n = input()
i = int(n[0])

if(n[1] < n[0]):
    print(n[0]+n[0]+n[0])
elif(n[1] == n[0]):
    if(n[2] <= n[0]):
        print(n[0]+n[0]+n[0])
    else:
        print((i+1)*100+(i+1)*10+(i+1))
else:
    print((i+1)*100+(i+1)*10+(i+1))

Measured memory_bytes: 3064
#include<iostream>
#include<cstdio>
#include<cstring>
#include<climits>
#include<algorithm>
#include<cmath>
#include<queue>
using namespace std;
#define MAXN 100
char a[MAXN+5],b[MAXN+5],c[MAXN+5];
int main()
{
    scanf("%s%s%s",a+1,b+1,c+1);
    int len1=strlen(a+1),len2=strlen(b+1),len3=strlen(c+1);
    int A=0,B=0,C=0;
    int tr=1;
    while(A<=len1&&B<=len2&&C<=len3)
    {
        if(tr==1)
        tr=a[++A]-'a'+1;
        if(tr==2)
        tr=b[++B]-'a'+1;
        if(tr==3)
        tr=c[++C]-'a'+1;
    }
    if(A>len1)printf("A");
    if(B>len2)printf("B");
    if(C>len3)printf("C");
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int A,B,C;cin>>A>>B>>C;
  int K;cin>>K;
  while(B<=A){
    B*=2;
    K--;
  }
  while(C<=B){
    C*=2;
    K--;
  }
  cout<<(K<0?"No":"Yes")<<endl;
}

Measured memory_bytes: 3632
/* JOI8.c */
#include<stdio.h>

int bubble_sort(int x[],int n)
{
 int i,j,temp;
 for(i=0; i<n-1; i++){
     for(j=n-1; j>i; j--){
         if(x[j] < x[j-1]){
         temp = x[j];
         x[j] = x[j-1];
         x[j-1] = temp;
         }
     }
 }
}
int main(void)
{
 int w[10];
 int k[10];
 int i;
 int score_w;
 int score_k;

 for(i=0; i<10; i++)
 scanf("%d",&w[i]);

 for(i=0; i<10; i++)
 scanf("%d",&k[i]); 

 bubble_sort(w,10);
 bubble_sort(k,10);

 score_w = w[7]+w[8]+w[9];
 score_k = k[7]+k[8]+k[9];

 printf("%d %d\n",score_w,score_k);
 return 0;
}

Measured memory_bytes: 596
#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; (i) < (n); ++ (i))
#define loop(i,a,n) for (int i = (a); (i) < (n); ++ (i))
#define ll long long
#define ld long double
#define EPS 0.0000000001
#define INF (int)1e9
#define MOD 0
//#define int ll
using namespace std;
typedef vector<long long> vl;

signed main() {
  int n;
  cin >> n;
  cin.tie(0);
  ios::sync_with_stdio(false);
  cout << 180*(n-2) << endl;
  return 0;
}


Measured memory_bytes: 256
import java.util.*;

public class Main {
	public static void main(String[] args) throws Exception {
		Scanner s = new Scanner(System.in);
        int N = s.nextInt();
        int a = s.nextInt();
      	int b;
      	for (int i = 1; i < N; i++){
        	b = s.nextInt();
          	int c = Math.max(a, b);
            b = Math.min(a,b);
            a = c;
          	while (b > 0){
              	a = a % b;
              	int d = Math.max(a, b);
                b = Math.min(a,b);
                a = d;
            }
        }
        System.out.println(a);
        
	}
}


Measured memory_bytes: 52124
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
ll N, A, B;
ll h[100000];
bool f(int k) {
    ll e = 0;
    for (int i = 0; i < N; i++) {
        ll x = h[i];
        x -= B*k;
        if (x > 0) {
            ll r = x / (A-B);
            if (x - r * (A-B) > 0) {
                r++;
            }
            e += r;
            if (e > k) return 0;
        }
    }
    return 1;
}
int main () {
    cin >> N >> A >> B;
    for (int i = 0; i < N; i++) {
        cin >> h[i];
    }
    long long low = 0, high = 1000000000;
    while (high - low > 1) {
        long long mid = (high + low) / 2;
        if (f(mid)) {
            high = mid;
        }
        else {
            low = mid;
        }
    }
    cout << high << endl;
}

Measured memory_bytes: 1024
#include<bits/stdc++.h>
using namespace std;
#define inf INT_MAX
#define INF LLONG_MAX
#define ll long long
#define ull unsigned long long
#define M (int)(1e9+7)
#define P pair<int,int>
#define PLL pair<ll,ll>
#define FOR(i,m,n) for(int i=(int)m;i<(int)n;i++)
#define RFOR(i,m,n) for(int i=(int)m;i>=(int)n;i--)
#define rep(i,n) FOR(i,0,n)
#define rrep(i,n) RFOR(i,n,0)
#define all(a) a.begin(),a.end()
#define IN(a,n) rep(i,n){ cin>>a[i]; }
const int vx[4] = {0,1,0,-1};
const int vy[4] = {1,0,-1,0};
#define PI 3.14159265
#define F first
#define S second
#define PB push_back
#define EB emplace_back
#define int ll
#define vi vector<int>



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

  int n;
  cin>>n;
  vi a(n);
  rep(i,n){
    cin>>a[i];
  }
  reverse(all(a));

  int ans=0;
  rep(i,n){
    //cout<<a[i]<<' '<<a[i+1]<<' '<<ans<<endl;
    if(i==n-1){
      if(a[i]!=0){
        ans=-1;
        break;
      }
    }else{
      if(a[i]==1||a[i]-a[i+1]==1){
        ans++;
      }else if(a[i]<=a[i+1]){
        ans+=a[i];
      }else{
        ans=-1;
        break;
      }
    }
  }

  cout<<ans<<endl;

}

Measured memory_bytes: 1792
v = []
loop do
  n = gets.to_i
  break if n.zero?

  ss = gets.split.map(&:to_i)
  sum = ss.inject(:+)
  ave = sum.to_f / n
  d = 0

  ss.each do |s|
    d += (s - ave)**2
  end

  a = d / n
  v << Math.sqrt(a)
end

v.each do |i|
  p i
end



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

int main(){
  int n; cin>>n;
  int ans=1000000000;
  for(int i=0;i<n;i++){
    int a; cin>>a;
    int x=0;
    while(a%2==0){
      a/=2; x++;
    }if(x==0){
      cout<<0<<endl;
      return 0;
    }else{
      ans=min(ans,x);
    }
  }cout<<ans<<endl;
}

Measured memory_bytes: 256
n = int(input())
b = [int(i) for i in input().split()]
ans = []
for j in range(n):
    for i in range(len(ans),n):
        if b[n-i-1] == n-i:
            ans.append(b.pop(n-i-1))
            break
if len(b) > 0:
    print(-1)
else:
    for i in ans[::-1]:
        print(i)

Measured memory_bytes: 3060
N = int(input())
h = list(map(int, input().split()))

def minus(l,x):
    for i in range(len(l)):
        l[i] = l[i] - x
    

count = 0
count += min(h)
minus(h, min(h))

for i in range(N-1):
    if h[i] < h[i+1]:
        count += h[i+1] - h[i]
        
count += h[0]
print(count)

Measured memory_bytes: 3064
x, y = map(int, input().split())

if x >= 0:
    sgnx = 1
else:
    sgnx = -1

if y > 0:
    sgny = 1
else:
    sgny = -1

if abs(x) > abs(y):
    if sgnx == 1 and sgny == 1:
        ans = 2 + abs(x) - abs(y)
    if sgnx == -1 and sgny == -1:
        ans = abs(x) - abs(y)
    elif sgnx == -1 and sgny == 1:
        ans = 1 + abs(x) - abs(y)
    elif sgnx == 1 and sgny == -1:
        ans = 1 + abs(x) - abs(y)

elif abs(x) < abs(y):
    if sgnx == 1 and sgny == 1:
        ans = y - x
    if sgnx == -1 and sgny == -1:
        ans = 2 + abs(y) - abs(x)
    elif sgnx == -1 and sgny == 1:
        ans = 1 + abs(y) - abs(x)
    elif sgnx == 1 and sgny == -1:
        ans = 1 + abs(y) - abs(x)

else:
    if sgnx == sgny:
        ans = 0
    if sgnx != sgny:
        ans = 1

print(ans)


Measured memory_bytes: 3064
#include<cstdio>
#include<cstring>
#include<algorithm>
#include<vector>
using namespace std;
typedef long long ll;
const int MAXN = 2e5 + 5;

inline void chk_max(int &a,int b){ if(a<b) a=b;}

char s[MAXN];
int pre[MAXN],suf[MAXN];
ll dif[MAXN];
inline void update(int l,int r){ ++dif[l]; --dif[r+1];}

vector<int> ans1,ans2;
bool vis[MAXN];

int main(void)
{
	int n,d,c;
	scanf("%d%d%d%s",&n,&d,&c,s+1);
	
	for(int i=1; i<=n; ++i)
	{
		pre[i] = pre[i-1];
		if(s[i]=='x') continue;
		chk_max(pre[i],1);
		if(i-c-1 >= 1) chk_max(pre[i], pre[i-c-1]+1);
	}
	for(int i=n; i>=1; --i)
	{
		suf[i] = suf[i+1];
		if(s[i]=='x') continue;
		chk_max(suf[i],1);
		if(i+c+1 <= n) chk_max(suf[i], suf[i+c+1]+1);
	}
	
	//for(int i=1; i<=n; ++i) printf("%d %d\n",pre[i],suf[i]);
	
	for(int i=1; i<=n; ++i)
		if(pre[i-1]+suf[i+1] < d)
			ans1.push_back(i);
//			printf("%d\n",i);
	
	for(int i=1; i<=n; ++i)
	{
		if(pre[i-1]>=d || suf[i+1]>=d)
			update(i,i);
	}
	for(int i=1; i+c-1<=n; ++i)
	{
		int j = i+c-1;
		if(pre[i-1] + suf[j+1] >= d)
			update(i,j);
	}
	for(int i=1; i<=n; ++i) dif[i] += dif[i-1];
	
	for(int i=1; i<=n; ++i)
		if(s[i]=='o' && !dif[i])
			ans2.push_back(i);
//			printf("%d\n",i);
	
	if(ans1.size()==ans2.size())
	{
		for(int i=0; i<(int)ans2.size(); ++i)
			printf("%d\n",ans2[i]);
		return 0;
	}
	
	if(ans1.size() > ans2.size()) while(1);
	
	for(int i=0; i<(int)ans2.size(); ++i) vis[ans2[i]]=1;
	for(int i=0; i<(int)ans1.size(); ++i)
		if(!vis[ans1[i]]) return 114514;
	return 0;
}

Measured memory_bytes: 6516
#include <iostream>
#include <algorithm>
#include <vector>
#include <string>
#include <cmath>

using namespace std;

int main()
{
	int max_v = 0, min_v = pow(10, 9), N, a;

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

		if (a > max_v)
		{
			max_v = a;
		}

		if (a < min_v)
		{
			min_v = a;
		}
	}

	cout << abs(max_v - min_v) << endl;

	return 0;
}

Measured memory_bytes: 256
#include "bits/stdc++.h"
#define _overload3(_1,_2,_3,name,...) name
#define _rep(i,n) repi(i,0,n)
#define repi(i,a,b) for(int i=int(a),i##_len=(b);i<i##_len;++i)
#define MSVC_UNKO(x) x
#define rep(...) MSVC_UNKO(_overload3(__VA_ARGS__,repi,_rep,_rep)(__VA_ARGS__))
#define all(c) c.begin(),c.end()
#define mp make_pair
#define write(x) cout<<(x)<<"\n"
using namespace std; typedef long long ll;
typedef vector<int> vi; typedef vector<ll> vll; template<class T>using vv = vector<vector<T>>;
template<class T>vv<T> vvec(size_t n, size_t m, T v) { return vv<T>(n, vector<T>(m, v)); }
template<class T>bool chmax(T& a, const T& b) { return a < b ? a = b, 1 : 0; }
template<class T>bool chmin(T& a, const T& b) { return b < a ? a = b, 1 : 0; }
constexpr int INF = 1 << 29, MOD = int(1e9) + 7; constexpr ll LINF = 1LL << 60;
struct aaa { aaa() { cin.tie(0); ios::sync_with_stdio(0); }; }aaaa;

int main() {
    int N, X;
    cin >> N >> X;
    vi L(N);
    rep(i, N) cin >> L[i];

    int ans = 1;
    ll D = 0;
    rep(i, N) {
        D = D + L[i];
        if (D <= X) ans++;
        else {
            break;
        }
    }

    write(ans);
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
using Graph = vector<vector<int>>;
#define ALL(x) (x).begin(), (x).end()
#define REP(i ,n) for(int i = 0; i < (int)(n); i++)
#define pb push_back
typedef vector<int>vint;
typedef vector<ll>vll;
template<typename T> istream &operator>>(istream &is, vector<T> &vec){ for (auto &v : vec) is >> v; return is; }
template<typename A,typename B>inline void chmin(A &a,B b){if(a>b)a=b;}
template<typename A,typename B>inline void chmax(A &a,B b){if(a<b)a=b;}
int main()
{
    ll A,B,C,X,Y;
    cin >> A >> B >> C >> X >> Y;

    ll ans = 0;
    if(X > Y){
        if(A + B >= 2*C){
            ans += 2*C*Y;
        }else{
            ans += (A + B)*Y;
        }
        X -= Y;
        Y = 0;
        if(A >= 2*C){
            ans += 2*C*X;
        }else{
            ans += A*X;
        }
    }else{
        if(A + B >= 2*C){
            ans += 2*C*X;
        }else{
            ans += (A + B)*X;
        }
        Y -= X;
        X = 0;
        if(B >= 2*C){
            ans += 2*C*Y;
        }else{
            ans += B*Y;
        }
    }
    cout << ans << endl;
}

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

int main()
{
  int i, count = 0;
  char W[10], T[1000];

  scanf("%s", W);
  while (1) {
    scanf("%s", T);
    if (strcmp(T, "END_OF_TEXT") == 0) break;
    for (i = 0; T[i] != '\0'; i++) T[i] = tolower(T[i]);
    if (strcmp(T, W) == 0) count++;
  }
  printf("%d\n", count);

  return 0;
}



Measured memory_bytes: 2040
import copy

n = int(input())

Card1 = []

for i in range(n):
  Card1.append(input())

def partition(B, p, r):
  x1, x2 = B[r].split()
  global i
  i = p-1
  for j in range(p, r):
    c1, c2 = B[j].split()
    if int(c2) <= int(x2):
      i += 1
      y = B[i]
      z = B[j]
      B[i] = z
      B[j] = y
  a = B[i+1]
  b = B[r]
  B[i+1] = b
  B[r] = a
  return i+1

def quicksort(B, p, r):
  if p < r:
    q = partition(B, p, r)
    quicksort(B, p, q-1)
    quicksort(B, q+1, r)

def merge(A, left, mid, right):
  inf = float('inf')
  L = A[left:mid] + ["D inf"]
  R = A[mid:right] + ["D inf"]
  i = 0
  j = 0
  for k in range(left, right):
    l1 = L[i].split()
    r1 = R[j].split()
    l2 = float(l1[1])
    r2 = float(r1[1])
    if l2 <= r2:
      A[k] = L[i]
      i += 1
    else:
      A[k] = R[j]
      j += 1

def mergesort(A, left, right):
  if left+1 < right:
    mid = (left + right)//2
    mergesort(A, left, mid)
    mergesort(A, mid, right)    
    merge(A, left, mid, right)

Card2 = copy.deepcopy(Card1)

quicksort(Card1, 0, n-1)

mergesort(Card2, 0, n)

if Card1 == Card2:
  print("Stable")
else:
  print("Not stable")

for i in range(n):
  print(Card1[i])


Measured memory_bytes: 14432
#include <iostream>
#include <vector>
#include <algorithm>

using namespace std;

int main(){
	int N;
	while(cin >> N){
		vector< pair<long long, long long> > p(N);
		vector< pair<long long,int> > key(2*N);
		for(int i=0;i<N;i++){
			cin >> p[i].first >> p[i].second;
			if(p[i].first > p[i].second) swap(p[i].first, p[i].second);
			key[2*i] = make_pair(p[i].first, i);
			key[2*i+1] = make_pair(p[i].second, i);
		}
		sort(key.begin(), key.end());
		long long rm = (1LL << 40), rM = 0, bm = (1LL << 40), bM = 0;
		for(int i=0;i<N;i++){
			rm = min(rm, p[i].first);
			rM = max(rM, p[i].first);
			bm = min(bm, p[i].second);
			bM = max(bM, p[i].second);
		}
		long long res = (rM - rm) * (bM - bm);
		if(key[0].second != key.back().second){
			vector<int> use(N, 0);
			int cnt = 0;
			int low = 1, high = 1;
			use[key[1].second] = 1;
			cnt = 1;
			while(true){
				if(cnt < N){
					++high;
					if(high == key.size() -1) break;
					if(!use[key[high].second]) ++cnt;
					use[key[high].second]++;
				} else {
					use[key[low].second]--;
					if(!use[key[low].second]) --cnt;
					++low;
				}
				if(cnt == N){
					res = min(res, (key.back().first - key[0].first) * (key[high].first - key[low].first));
				}
			}
		}
		cout << res << endl;
	}
}



Measured memory_bytes: 10496
s = input()

ans = 100
for i in "qwertyuiopasdfghjklzxcvbnm":
    t = s
    cnt = 0
    while len(set(t)) != 1:
        tmp = ""
        for j in range(len(t) - 1):
            if t[j] == i or t[j + 1] == i:
                tmp += i
            else:
                tmp += t[j]
        t = tmp
        cnt += 1
    ans = min(ans, cnt)
print(ans)

Measured memory_bytes: 3064
N,C = map(int, input().split())
L = [[int(a) for a in input().split()] for _ in range(N)]

ans = [0]*C
chan = [0]*C
L.sort()
for i in range(N):
    for j in range(C):
        if ans[j] == L[i][0] and chan[j] == L[i][2]:
            ans[j] = L[i][1]
            break
        elif ans[j] < L[i][0]:
            ans[j] = L[i][1]
            chan[j] = L[i][2]
            break
    ans.sort(reverse=True)
    
num = 0
for i in range(C):
    if ans[i] > 0:
        num += 1
        
print(num)

Measured memory_bytes: 61784
n, k = map(int, input().split())
cnt = [0] * (10**5 + 1)
for _ in range(n):
    a, b = map(int, input().split())
    cnt[a] += b
for i in range(10**5 + 1):
    if k <= cnt[i]:
        ans = i
        break
    else:
        k -= cnt[i]
print(ans)


Measured memory_bytes: 5736
#include <iostream>
using namespace std;
 
int main() {
    int A, B, C, D, sum1, sum2;
    cin >> A >> B >> C >> D;
    sum1 = A * B;
    sum2 = C * D;
    if (sum1 >= sum2){
      cout << sum1 << endl;
    }
    else{
      cout << sum2 << endl;
    }
}

Measured memory_bytes: 256
#include <stdio.h>

int main(void)
{
	float g;
	
	while (scanf("%f", &g) != EOF){
		if (g <= 48.00){
			printf("light fly\n");
		}
		else if ((48.00 < g)&&(g <= 51.00)){
			printf("fly\n");
		}
		else if ((51.00 < g)&&(g <= 54.00)){
			printf("bantam\n");
		}
		else if ((54.00 < g)&&(g <= 57.00)){
			printf("feather\n");
		}
		else if ((57.00 < g)&&(g <= 60.00)){
			printf("light\n");
		}
		else if ((60.00 < g)&&(g <= 64.00)){
			printf("light welter\n");
		}
		else if ((64.00 < g)&&(g <= 69.00)){
			printf("welter\n");
		}
		else if ((69.00 < g)&&(g <= 75.00)){
			printf("light middle\n");
		}
		else if ((75.00 < g)&&(g <= 81.00)){
			printf("middle\n");
		}
		else if ((81.00 < g)&&(g <= 91.00)){
			printf("light heavy\n");
		}
		else if (91.00 < g){
			printf("heavy\n");
		}
	}
	
	return (0);
}

Measured memory_bytes: 604
#include<algorithm>
#include<complex>
#include<ctype.h>
#include<iomanip>
#include<iostream>
#include<map>
#include<math.h>
#include<numeric>
#include<queue>
#include<set>
#include<stack>
#include<stdio.h>
#include<string>
#include<string>
#include<vector>

using namespace std;
typedef long long ll;

#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define ALL(v) (v).begin(), (v).end()
#define p(s) cout<<(s)<<endl
#define p2(s, t) cout << (s) << " " << (t) << endl
#define pn(s) cout << (#s) << " " << (s) << endl
#define p_yes() p("YES")
#define p_no() p("NO")

template < typename T >
void vprint(T &V){
	for(auto v : V){
    	cout << v << " ";
	}
	cout << endl;
}

int dx[4] = {-1, 0, 1, 0};
int dy[4] = {0, 1, 0, -1};

const ll mod = 1e9 + 7;
const ll inf = 1e18;

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

    // input
    ll A, B;
    cin >> A >> B;

    ll a = A+B;
    ll b = A-B;
    ll c = A*B;

    ll d = max(max(a, b), c);
    p(d);
        
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define repr(i, n) for (int i = (n); i >= 0; --i)
#define FOR(i, m, n) for (int i = (m); i < (n); ++i)
#define FORR(i, m, n) for (int i = (m); i >= (n); --i)
#define equals(a, b) (fabs((a) - (b)) < EPS)
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
const ll mod = 1000000007;
const ll mod2 = 998244353;
const int inf = 1e9 + 10;
const ll INF = 1e18;
const ld EPS = 1e-10;
const int dx[8] = {1, 0, -1, 0, 1, -1, -1, 1};
const int dy[8] = {0, 1, 0, -1, 1, 1, -1, -1};

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

  int ans = 0;
  while (n > 0) {
    n /= k;
    ans++;
  }
  cout << ans << endl;


  
  return 0;
}

Measured memory_bytes: 256
#include <stdio.h>
#include <limits.h>

typedef struct {
	char mark;
	int number;
} card;

card L[50002] = {0};
card R[50002] = {0};

void showM(card A[], int n) {
	int i;
	for(i = 0; i < n; ++i) {
		printf("%c %d\n", A[i].mark, A[i].number);
	}
	return;
}

int partition(card A[], int p, int r) {
	int x, i, j;
	card tmp;
	x = A[r].number;
	i = p - 1;

	for (j = p; j < r; ++j) {
		if (A[j].number <= x) {
			++i;
			tmp = A[i];
			A[i] = A[j];
			A[j] = tmp;
		}
	}
	tmp = A[i+1];
	A[i+1] = A[r];
	A[r] = tmp;
	return i + 1;
}

void quicksort(card A[], int p, int r) {
	int q;
	if (p < r) {
		q = partition(A, p, r);
		quicksort(A, p, q-1);
		quicksort(A, q+1, r);
	}
}

void Merge(card A[], int left, int mid, int right) {
	int n1, n2;
	int i, j, k;
	n1 = mid - left;
	n2 = right - mid;
//	printf("A\n");
//	showM(A,right);
	for (i = 0; i < n1; ++i) {
		L[i] = A[left + i];
	}
	for (i = 0; i < n2; ++i) {
		R[i] = A[mid + i];
	}
	/* printf("L\n"); */
	/* showM(L, n1); */
	/* printf("R\n"); */
	/* showM(R, n2); */
	L[n1].number = INT_MAX;
	R[n2].number = INT_MAX;
	i = 0;
	j = 0;
	
	for (k = left; k < right; ++k) {
		if (L[i].number <= R[j].number) {
			A[k] = L[i];
			++i;
		} else {
			A[k] = R[j];
			++j;
		}
	}
	return;
}

void MergeSort(card A[], int left, int right) {
	int mid;
//	showM(A, right);
	if (left + 1 < right) {
		mid = (left + right) / 2;
		MergeSort(A, left, mid);
		MergeSort(A, mid, right);
		Merge(A, left, mid, right);
	}
	return;
}

int main(void) {
	int i, n;
	int flag = 0;
	card A[100000] = {0};
	card B[100000] = {0};
	scanf("%d", &n);
	for (i = 0; i < n; ++i) {
		scanf(" %c %d", &A[i].mark, &A[i].number);
		B[i] = A[i];
	}

	
	quicksort(A, 0, n-1);
	MergeSort(B, 0, n);
	
	for (i = 0; i < n; ++i) {
		if (A[i].mark != B[i].mark) {
			flag = 1;
			break;
		}
	}
	if (flag) {
		printf("Not stable\n");
	} else {
		printf("Stable\n");
	}
	
	for (i = 0; i < n; ++i) {
		printf("%c %d\n", A[i].mark, A[i].number);
	}
	return 0;
}



Measured memory_bytes: 4032
#include <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
#include <algorithm>
#include <queue>
#include <string>
using namespace std;
#define rep(i,a,n) for(ll i=a;i<n;i++)
#define rrep(i,a,n) for(ll i=n;i>=a;i++)
typedef long long ll;
typedef pair<ll,ll> P;
const ll INF = 1e+17;
const ll MODcdf = 998244353;
string keyence="keyence";
int main(){
    ll n,ans=0,dis=0,sum1=0,sum2=0;cin>>n;
    ll a[n],b[n],c[n];
    bool flag=true;
    rep(i,0,n){
        cin>>a[i];
        sum1+=a[i];
    }
    rep(i,0,n){
        cin>>b[i];
        sum2+=b[i];
        if(b[i]>a[i])flag=false;
    }
    if(flag){
        cout<<0<<endl;
        return 0;
    }
    rep(i,0,n)c[i]=a[i]-b[i];
    if(sum2>sum1){
        cout<<-1<<endl;
        return 0;
    }
    rep(i,0,n){
        if(b[i]>a[i]){
            dis-=b[i]-a[i];
            ans++;
        }
    }
    sort(c,c+n,greater<ll>());
    rep(i,0,n){
        dis+=c[i];
        ans++;
        if(dis>=0)break;
    }
    cout<<ans<<endl;
}

Measured memory_bytes: 2560
#include <stdio.h>
#include <string>
#include <algorithm>
#include <set>
#include <map>
#include <vector>
#include <iostream>
#include <math.h>
#include <bitset>
#include <iomanip>
#include <queue>
#include <cstring>
using namespace std;

const long long mod = pow(10, 9) + 7;

int main() {
	int N; cin >> N;
	vector<long long> A(N);
	map<long long, int> X;
	bool a = 0;
	for (int i = 0; i < N; i++) {
		long long x; cin >> x; X[x]++;
		if (X[x] > 1)a = 1;
	}
	if (a == 0)cout << "YES" << endl;
	else cout << "NO" << endl;
}





Measured memory_bytes: 14336
function Main(input) {
  const lines = input.split('\n');
  const line = lines[0].split(' ').map(i => parseInt(i));
  const D = line[0];
  const T = line[1];
  const S = line[2];
  let answer = S * T >= D;
  console.log(answer? 'Yes': 'No');
}

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


Measured memory_bytes: 29680
#include <iostream>

using namespace std;

void solve()
{
	int score[5];
	int sum = 0;
	for(int i = 0; i < 5; ++i)
	{
		cin >> score[i];
		if(score[i] >= 40)
		{
			sum += score[i];
		}
		else
		{
			sum += 40;
		}
	}
	cout << sum / 5 << endl;
}

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

Measured memory_bytes: 1164
s = input()

for i in range(len(s)-1,0,-1):
    s = s[:i]
    n = len(s)
    if n%2:
        if n > 1:
            continue
        else:
            print(1)
    else:
        if s[:n//2] == s[n//2:]:
            print(n)
            exit()


Measured memory_bytes: 2940
#include <bits/stdc++.h>
typedef long long ll;
using namespace std;
ll a7=1000000007;
ll inf=100000000000000000;

ll min(ll a,ll b){
    if(a<b)return a;
    return b;
}
ll max(ll a,ll b){
    if(a>b)return a;
    return b;
}

int main(){
    ll n,k;cin>>n>>k;
    ll a[n];
    ll c[n+1];
    for(ll i=0;i<=n;i++){
        c[i]=0;
    }
    for(ll i=0;i<n;i++){
        cin>>a[i];
        c[a[i]]++;
    }
    vector<ll> b;
    ll bb=0;
    for(ll i=0;i<=n;i++){
        if(c[i]!=0){
            b.push_back(c[i]);
            bb++;
        }
    }
    sort(b.begin(),b.end());
    ll ans=0;
    for(ll i=0;i<bb-k;i++){
        ans+=b[i];
    }
    cout<<ans<<endl;
    return 0;
}



Measured memory_bytes: 5492