akhauriyash/Code-Regression huggingface dataset:
#include <stdio.h> 
int main(){
  int t,i;

  scanf("%d",&t);
  for(i=1;i<=t;i++){
    int n,j,k,max=0,min=0,a[101];
    scanf("%d",&n);
for(j=1;j<=n;j++){
      scanf("%d",&a[j]);
    }
    for(j=1;j<n;j++){
      if(a[j+1]-a[j]>max)max=a[j+1]-a[j];
      if(a[j]-a[j+1]>min)min=a[j]-a[j+1];
    }
    printf("%d %d\n",max,min);
  }
  return 0;
}

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

using namespace std;

const int MAXN = 1e5 + 5;
const int MOD = 1e9 + 7;

int h, n, w, x, y, x2, y2;
long long fak[2 * MAXN], block[MAXN], from[MAXN];
pair<int,int> tocke[MAXN];

inline bool cmp(const pair<int,int>&a, const pair<int,int>&b)
{
	if(a.first != b.first)
		return a.first < b.first;
	else
		return a.second < b.second;
}

inline long long mul(long long a, long long b)
{
	return (a * b) % MOD;
}
inline long long add(long long a, long long b)
{
	long long ret = a + b;
	if(ret >= MOD)
		return ret - MOD;
	else if(ret >= 0)
		return ret;
	else
		return ret + MOD;
}

long long qp(long long a, long long pot)
{
	if(pot == 1)
		return a % MOD;
	if(pot % 2 == 0)
		return qp(mul(a, a), pot / 2) % MOD;
	return mul(qp(a, pot - 1), a);
}
long long choose(long long a, long long b)
{
	return mul(fak[a], qp(mul(fak[b], fak[a - b]), MOD - 2));
}

inline void calc()
{
	fak[0] = 1;
	fak[1] = 1;
	for(int i = 2; i < 2 * MAXN; i++)
		fak[i] = mul(fak[i - 1], i);
}

inline void rtl()
{
	for(int i = n - 1; i >= 0; i--)
	{
		x = tocke[i].first, y = tocke[i].second;
		block[i] = choose(x + y, y);
		from[i] = choose(h - x + w - y, w - y);
		for(int k = n - 1; k > i; k--)
		{
			x2 = tocke[k].first, y2 = tocke[k].second;
			if(x2 >= x && y2 >= y)
			{
				from[i] = add(from[i], -mul(from[k], choose(x2 - x + y2- y, x2 - x)));
			}
		}
	}
}

int main()
{
	calc();
	cin >> h >> w >> n;
	h--;
	w--;
	for(int i = 0; i < n; i++)
	{
		cin >> tocke[i].first >> tocke[i].second;
		tocke[i].first -= 1;
		tocke[i].second -= 1;
	}
	sort(tocke, tocke + n, cmp);
	rtl();
	long long blocked = 0;
	for(int i = 0; i < n; i++)
		blocked = add(blocked, mul(block[i], from[i]));
	cout << add(choose(h + w, w), -blocked);
	return 0;
}

Measured memory_bytes: 1920
k, n = map(int,input().split())
list = [int(x) for x in input().split()]
root = []
for i in range(len(list)-1):
    root.append(list[i+1]-list[i])

root.append(k-list[-1]+list[0])

sum = sum(root)
ans = []

for j in range(len(root)):
    ans.append(sum-root[j])


ans.sort()
print(ans[0])

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

#define ll long long
#define int long long
#define ff first
#define ss second
#define pb push_back
#define mp make_pair
#define pii pair<int, int>
#define vi vector<int>
#define pqb priority_queue<int>
#define pqs priority_queue<int, vi, greater<int>>
#define setbits(x) __builtin_popcountll(x)
#define zrobits(x) __builtin_ctzll(x)
#define mod 1000000007
#define inf (int)(1e18)
#define ps(x, y) fixed << setprecision(y) << x
#define w(x)  \
    int x;    \
    cin >> x; \
    while (x--)
#define rep(i, begin, end) for (__typeof(end) i = (begin) - ((begin) > (end)); i != (end) - ((begin) > (end)); i += 1 - 2 * ((begin) > (end)))
#define all(p) p.begin(), p.end()
#define ub(a, b) upper_bound(all(a), b)
#define lb(a, b) lower_bound(all(a), b)
#define sz(x) (int)x.size()
#define PI 3.14159265
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());

void run()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
}
void solution()
{
    int n, x, t;
    cin >> n >> x >> t;
    int ans = (n + x - 1) / x;
    ans *= t;
    cout << ans << endl;
    return;
}
int32_t main()
{
    run();
    solution();
    return 0;
}

Measured memory_bytes: 3612
#include <bits/stdc++.h>
#define ALL(A) (A).begin(),(A).end()
#define ll long long
#define rep(i,n) for(int i=0;i<(n);i++)

const ll mod = 1e9+7;
const ll INF = 2*1e18;
const int inf = 1e9+7;

using namespace std;

int main(void){
	int N;
	cin >> N;
	string s;
	cin >> s;
	if(N%2==0){
		for(int i=0;i<N/2;i++){
			if(s[i] == s[i+ N/2])continue;
			else {
				cout << "No" << endl;
				return 0;
			}
		}
	}else{
		cout << "No" << endl;
		return 0;
	}
	cout << "Yes" << endl;
}

Measured memory_bytes: 256
#include <algorithm>
#include <bitset>
#include <cassert>
#include <cfloat>
#include <climits>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <fstream>
#include <functional>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <memory>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <utility>
#include <vector>

// c++11
#include <array>
#include <tuple>
#include <unordered_map>
#include <unordered_set>

#define mp make_pair
#define mt make_tuple
#define rep(i, n) for (int i = 0; i < (n); i++)

using namespace std;

using ll = long long;
using ull = unsigned long long;
using pii = pair<int, int>;
template <class T>
using max_priority_queue = priority_queue<T>;
template <class T>
using min_priority_queue = priority_queue<T, std::vector<T>, std::greater<T>>;

const int INF = 1 << 29;
const ll LL_INF = 1LL << 60;
const double EPS = 1e-9;
const ll MOD = 1000000007;

const int dx[] = {1, 0, -1, 0}, dy[] = {0, -1, 0, 1};
int N;
vector<int> A;
const int MAX_N = 3010;
ll dp[MAX_N][MAX_N][2];

ll memo(int head, int tail, int turn)
{
    if (head > tail)
    {
        return 0;
    }
    ll &res = dp[head][tail][turn];
    if (res != -LL_INF)
    {
        return res;
    }

    if (turn == 0)
    {
        res = -LL_INF;
        res = max(res, memo(head + 1, tail, !turn) + A[head]);
        res = max(res, memo(head, tail - 1, !turn) + A[tail]);
    }
    else
    {
        res = LL_INF;
        res = min(res, memo(head + 1, tail, !turn) - A[head]);
        res = min(res, memo(head, tail - 1, !turn) - A[tail]);
    }

    return res;
}

void init() 
{
    for (int i = 0; i < MAX_N; i++)
    {
        for (int j = 0; j < MAX_N; j++)
        {
            dp[i][j][0] = -LL_INF;
            dp[i][j][1] = -LL_INF;
        }
    }
}
int main()
{
    init();
    cin >> N;
    A.resize(N);
    for (int i = 0; i < N; i++)
    {
        cin >> A[i];
    }
    cout << memo(0, N - 1, 0) << endl;

    return 0;
}


Measured memory_bytes: 141952
def check(s):
    t=True
    if s[0]!="A" :
        t=False
        #print("reached")
    a=s[2:len(s)-1]
    #print(a)
    count=0
    for i in range(len(a)):
        if a[i]=="C":
            count+=1
    if count!=1:
        t=False
    alph="BDEFGHIJKLMNOPQRSTUVWXYZ"
    for i in range(24):
        if alph[i] in s:
            t=False
            break
    if t:
        print("AC")
    else:
        print("WA")
s=input()
check(s)  

Measured memory_bytes: 3064
#include <iostream>
#include <cstring>
#include <cstdlib>
using namespace std;
typedef struct Node{
    struct Node *prev;
    struct Node *next;
    int key;
} *node;
node root;
void Init()
{
    root = (node)malloc(sizeof(*root));
    root->prev=root;
    root->next=root;
    root->key=0;
}
void insert(int x)
{
    node in = (node)malloc(sizeof(*root));
    in->key = x;
    in->next = root->next;
    in->prev = root;
    root->next->prev = in;
    root->next = in;
}
node search(int x)
{
    node i = root->next;
    while(i!=root)
    {
        if(i->key==x)
            break;
        i=i->next;
    }
    return i;
}
void delete_node(node del)
{
    del->prev->next = del->next;
    del->next->prev = del->prev;
    free(del);
}
void delete_key(int x)
{
    node i = search(x);
    if(i!=root)
        delete_node(i);
}
int main()
{
    int n,x;
    char s[12];
    node i;
    cin>>n;
    Init();
    while(n--)
    {
        cin>>s;
        if(strcmp(s,"insert")==0)
        {
            cin>>x;
            insert(x);
        }
        else if(strcmp(s,"delete")==0)
        {
            cin>>x;
            delete_key(x);
        }
        else if(strcmp(s,"deleteFirst")==0)
        {
            delete_node(root->next);
        }
        else
        {
            delete_node(root->prev);
        }
    }
    i = root->next;
    while(i!=root)
    {
        cout<<i->key;
        if(i!=root->prev)
            cout<<' ';
        i = i->next;
    }
    cout<<endl;
    return 0;
}

Measured memory_bytes: 34340
#include <bits/stdc++.h>
#define _GLIBCXX_DEBUG
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep2(i, s, n) for (int i = (s); i < (int)(n); i++)
using ll = long long;
using pii = pair<int,int>;
using vi = vector<int>;
using vs = vector<string>;
using vll = vector<long long>;
using vpii = vector<pair<int,int>>;
using vivi = vector<vector<int>>;
const int dx[4] = {1,0,-1,0};
const int dy[4] = {0,1,0,-1};



int main(void) {
  ll n,m;
  cin >> n >> m;
  priority_queue<ll> a;
  rep(i,n) {
    ll p;
    cin >> p;
    //cout << p << endl;
    a.push(p);
  }
  
  
  
  if(n==1){
    int aaa = a.top()/pow(2,m);
    cout << aaa << endl;
    return 0;
  }
  
  ll cnt = 0;
  while(cnt<m){
    ll s = a.top();
    a.pop();
    ll t = a.top();
    
    while(s>=t){
      if(s==0) break;
      s/=2;
      cnt++;
      if(cnt>=m) break;
    }
    a.push(s);
  }
  ll sum = 0;
  while(!a.empty()){
    sum += a.top();
    //cout << a.top() << endl;
    a.pop();
    
  }
  cout << sum << endl;
  
      
    
  
  
    
  
}


Measured memory_bytes: 1400
#include<stdio.h>
int main(){
    int t;
    int a,b,c;
    scanf("%d",&t);
    a=t/3600;
    b=(t-a*3600)/60;
    c=t-a*3600-60*b;
    printf("%d:%d:%d\n",a,b,c);
    return 0;
}

Measured memory_bytes: 1820
#include <iostream>
#include <string>
#include <vector>
#include <map>
#include <memory>

using namespace std;

void swap(int &a, int &b)
{
    int tmp = a;
    a = b;
    b = tmp;
}

int main()
{
    int X,Y,Z;

    cin >> X >> Y >> Z;

    swap( X, Y );
    swap( X, Z );
    
    cout << X << " " << Y << " " << Z << endl;
    return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <map>
#include <queue>
#include <deque>
#include <list>
#include <set>
#include <functional>
#include <cmath>
#define REP(i,n) for(lint i{}, i##_len=(n); i<i##_len; ++i)
#define DBLOOP(i, h, j, w) for(lint i{}; i < (lint)(h); ++i)for(lint j{}; j < (lint)(w); ++j)
#define DBLOOP2(i, j, n) for(lint i{}; i < (lint)(n - 1); ++i)for(lint j{i + 1}; j < (lint)(n); ++j)
#define SZ(x) ((lint)(x).size())
using lint = long long; lint N, M, H, W;
using Graph = std::vector<std::vector<lint>>;
using namespace std;
const long long INF{ 1LL << 60 };
const long long inf{ 1LL << 24 };
const long double PI{ 3.1415926535897932 };
const long long NUM97{ 1000000007 };
template<class T> inline bool chmax(T& x, T y) { if (x < y) { x = y; return 1; } return 0; }
template<class T> inline bool chmin(T& x, T y) { if (x > y) { x = y; return 1; } return 0; }
std::vector<std::string> field;
std::vector<std::vector<bool>> seen(H, std::vector<bool>(W));
const std::vector<int> dx{ 1, 0, -1, 0 };
const std::vector<int> dy{ 0, 1, 0, -1 };
bool compare_by_a(pair<lint, lint> a, pair<lint, lint> b) {
	if (a.first != b.first) { return a.first < b.first; }
	else { return a.second < b.second; }
}
bool compare_by_a_bigger(pair<lint, lint> a, pair<lint, lint> b) {
	if (a.first != b.first) { return a.first < b.first; }
	else { return a.second < b.second; }
}
bool compare_by_b(pair<lint, lint> a, pair<lint, lint> b) {
	if (a.second != b.second) { return a.second < b.second; }
	else { return a.first < b.first; }
}
bool compare_by_b_bigger(pair<lint, lint> a, pair<lint, lint> b) {
	if (a.second != b.second) { return a.second > b.second; }
	else { return a.first > b.first; }
}

int main() {
	lint N{}, M{}, total{}, save{}, R{}; std::cin >> N >> M;
	std::vector<lint> A(N); for (auto& r : A) { std::cin >> r; total += r; }
	std::vector<std::pair<lint, lint>> B(M);
	for (auto& r : B) { std::cin >> r.second >> r.first; R += r.second; }
	std::sort(A.begin(), A.end());
	std::sort(B.begin(), B.end());
	lint j = 0; lint count{}, total_count{};
	for (int i = 0; i < N; ++i) {
		++total_count;
		if (count == B[M - 1 - j].second) { count = 0; ++j; }
		save = total;
		total = total - A[i] + B[M - 1 - j].first;
		A[i] = B[M - 1 - j].first;
		if (total < save) { std::cout << save << std::endl; return 0; }
		if (total_count == R) { break; }
		++count;
	}
	std::cout << total << std::endl;

	return 0;
}

Measured memory_bytes: 5656
import           Data.Maybe
import qualified Data.ByteString.Char8         as C8

getInts :: IO [Int]
getInts = fmap (map (fst . fromJust . C8.readInt) . C8.words) C8.getLine

main :: IO ()
main = do
    _  <- getLine
    as <- getInts
    print $ foldl1 gcd as


Measured memory_bytes: 2940
#include "bits/stdc++.h"
using namespace std;
typedef long long li;

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

    string s, t;
    cin >> s >> t;
    const li n = s.size();

    li ans = 0;
    for (int i = 0; i < n; ++i) {
        if (s[i] != t[i]) {
            ans++;
        }
    }
    cout << ans << endl;

    return 0;
}

Measured memory_bytes: 3736
N = int(input())

N1 = N - int(N/10)*10
        
yomi = 'hon'

if N1 == 3:
    yomi = 'bon'
elif N1 == 0 or N1 == 1 or N1 == 6 or N1 == 8:
    yomi = 'pon'

print(yomi)

Measured memory_bytes: 9168
#include<algorithm>
#include<cmath>
#include<iostream>
#include<vector>
#include<string>
using namespace std;
typedef long long ll;

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

int main(){
    int X, x;
    cin  >> X;
    int count_500, count_5;
    count_500 = X / 500;
    count_5   = (X % 500) / 5;

    cout << (count_500 * 1000) + (count_5 * 5) << endl;

    return 0;
}


Measured memory_bytes: 3160
#include <bits/stdc++.h>
#define REACH cout << __LINE__ << endl
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define REP(i,b) FOR(i,0,b)
#define PB push_back
#define ALL(c) c.begin(),c.end()
#define MP make_pair
using namespace std;
typedef long long LL;
typedef long double ld;
typedef int ut;
typedef vector<ut> VI;
typedef pair<ut,ut> pr;
typedef pair<ut,pr> ppr;
typedef vector<pr> Vpr;
typedef pair<int,vector<int> > pqt;
typedef vector<pqt> Vpqt;
typedef priority_queue<pqt,Vpqt,greater<pqt> > PQ;
map<vector<int>,int> dists;
typedef pair<int,vector<int> > pvi;
const int SIZE=20;
clock_t clocks[SIZE];
double clockst(int x){
	clocks[x] = -clock();
}
double clocked(int x){
	clocks[x] += clock();
}	
double timer(int x){
	return clocks[x];
}
void reverse(vector<int> &nums,int a,int b){
	while(a<b){
		swap(nums[a++],nums[b--]);
	}
}
/*int score(vector<int> &nums){
	int ables[2]={};
	REP(i,nums.size()){
		ables[abs(i+1-nums[i])&1]|=1;
	}
	return ables[0]+ables[1];
}*/
/*int score(vector<int> &nums){
	
	int ans=0;
	REP(i,nums.size()-1){
		if(i+1-nums[i]>0 && i+2-nums[i+1]<0) ans++;
	}
	
	return ans;
	
}*/
int score(vector<int> &nums){
//	return 0;
	int ans=0,two=0;
	REP(i,nums.size()-1){
		if(abs(nums[i+1]-nums[i])>=2) two++;
	}
	FOR(i,0,nums.size()){
		if((((i!=nums.size()-1)?nums[i+1]:(int)nums.size())-nums[i])*(nums[i]-(i?nums[i-1]:0))<0) ans++;
//		cout << (((i!=nums.size()-1)?nums[i+1]:(int)nums.size())-nums[i]) << " " <<  (nums[i]-(i?nums[i-1]:0)) << endl;
	}
//	cout << ans << endl;
	return (max(two,ans)+1)/2;	
}

int times=0;
int solve(vector<int> nums){
	clockst(2);
	
	PQ qu;

	vector<int> ans;
	REP(i,nums.size()){
		ans.PB(i+1);
	}
	qu.push(pvi(score(nums),nums));
	
	while(!qu.empty()){
		vector<int> now=qu.top().second;
		int dist=qu.top().first-score(now);
		qu.pop();
		if(dist!=dists[now]) continue;
		times++;
		if(times==160000) return nums.size()-1; 
		if(now==ans) return dists[ans];
//		REP(i,now.size()) cout << now[i] << " ";
//		cout <<dist << " "<< score(now) <<  endl;
		REP(i,nums.size()){
			REP(j,i){
				reverse(now,j,i);
				if(!dists.count(now) || dists[now]>dist+1){
					if(dist+1+score(now)<nums.size()-1) qu.push(pvi(dist+1+score(now),vector<int>(now)));
					if(dist+1+score(now)<nums.size()) dists[now]=dist+1;
					
				}
				reverse(now,j,i);
			}
		}
	}
	
	return nums.size()-1;
}	
int main() {
	vector<int> vi;
	int n,x;
	
	cin >> n;
	REP(i,n){
		cin >> x;
		vi.PB(x);
	}
	cout << solve(vi) << endl;
	clocked(2);
	//cout << times << endl;
	//cout << dists.size() << endl;
	//cout << timer(2) << endl;
	//cout << timer(1) << endl;

	// your code goes here
	return 0;
}

Measured memory_bytes: 174320
/*  -*- coding: utf-8 -*-
 *
 * d.cc: D: Practical Skill Test
 */

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

/* constant */

const int MAX_H = 300;
const int MAX_W = 300;
const int MAX_HW = MAX_H * MAX_W;

/* typedef */

/* global variables */

int ais[MAX_HW], ajs[MAX_HW];
int dsums[MAX_HW];

/* subroutines */

/* main */

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

  for (int i = 0; i < h; i++)
    for (int j = 0; j < w; j++) {
      int aij;
      scanf("%d", &aij);
      aij--;
      ais[aij] = i, ajs[aij] = j;
    }

  int hw = h * w;
  for (int i = 0, j = d; j < hw; i++, j++)
    dsums[j] = dsums[i] + abs(ais[j] - ais[i]) + abs(ajs[j] - ajs[i]);
  
  int q;
  scanf("%d", &q);

  while (q--) {
    int l, r;
    scanf("%d%d", &l, &r);
    l--, r--;
    printf("%d\n", dsums[r] - dsums[l]);
  }
  return 0;
}


Measured memory_bytes: 2176
#include<bits/stdc++.h>
#define ll long long
#define all(v) v.begin(),v.end()
#define rall(v) v.begin(),v.end()
#define sz(x) (int)sz.size()
#define PB push_back
#define PI 3.1415926535897932384626433832795
#define what(x) cout<<#x<<" is "<<x<<endl;
using namespace std;

#ifdef LOCAL//ONLINE_JUDGE
#include "D:\c_c++\template.h"
#else
#define debug(...) 42
#endif

ll powmod(ll a,ll b,ll mod) {
    ll res=1;a%=mod;
    //assert(b>=0);
    for(;b;b>>=1){
        if(b&1)res=res*a%mod;a=a*a%mod;
    }
    return res;
}

void solve(){
	ll x;
	cin>>x;
	cout<<(!x)<<'\n';
	debug("bhai bhai");
}


int main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
//    #ifdef LOCAL
//    freopen("input.txt", "r", stdin);
//    freopen("output.txt", "w", stdout);
//    #endif
    int tc=1;
    // cin>>tc;
    while(tc--)solve();
}


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

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

    bool f = n % 2;
    deque<int> deq;
    for(int i = 0; i < n; i++, f = !f){
        cin >> a;
        if(f) deq.push_front(a);
        else deq.push_back(a);
    }

    for(int x : deq) cout << x << " ";
    cout << endl;

    return 0;
}


Measured memory_bytes: 2944
#include<cstring>
#include<cstdio>
#include<iostream>
#include<algorithm>
#include<vector>
#include<cmath>
#include<map>
#include<queue>
#include<bitset>
#include<cstdlib>
#include<set>
#include<unordered_map>
#define l(x) (x<<1)
#define r(x) ((x<<1)|1)
#define low(x) (x&(-x))
#define IL inline
#define reg register
#define LL long long
#define N 500010
#define MOD 998244353
#define MO 1000000007
#define INF 0x3f3f3f3f
using namespace std;

int T,n,i,j,k,x,y,z;
int a[N],b[N];
char c[N];

struct Data{
	int x,y;
}d[N];

IL int Abs(int x){return (x<0)?-x:x;}
IL void Swap(int &a,int &b){a^=b^=a^=b;}
IL int Min(int a,int b){return (a<b)?a:b;}
IL int Max(int a,int b){return (a>b)?a:b;}
IL bool cmp(const Data a,const Data b){return a.x<b.x;}

IL LL Mi(LL x,LL y){
	LL p=x,t=1,Res=1;
	for (;t<=y;(t&y)?Res=(Res*p)%MOD:0,p=(p*p)%MOD,t<<=1);
	return Res;
}

IL int read(){
	int p=0,f=1;	char	c=getchar();
	while (c<48||c>57)	{if (c=='-')	f=-1;	c=getchar();}
	while (c>=48&&c<=57)	p=(p<<1)+(p<<3)+c-48,c=getchar();
	return p*f;
}

int main(){
	#ifdef __Marvolo
	freopen("zht.in","r",stdin);
	freopen("zht.out","w",stdout);
	#endif
	n=read();
	if (n>=30)	puts("Yes");
	else puts("No");
	return 0;
}

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

signed main() {
  int n, k;
  cin >> n >> k;
  vector<int> a(n);
  for (int i = 0; i < n; ++i) cin >> a[i];
  int bs = 42;
  vector<int> bc(bs);
  for (int i = 0; i < n; ++i) {
    for (int b = 0; b < bs; ++b) {
      bc[b] += (a[i] >> b) & 1;
    }
  }
  int lmt = 0;
  int fre = 0;
  for (int b = 0; b < bs; ++b) {
    if ((k >> b) & 1) {
      lmt = max((bc[b] << b) + fre, ((n - bc[b]) << b) + lmt);
    } else {
      lmt += bc[b] << b;
    }
    fre += max(bc[b], n - bc[b]) << b;
  }
  cout << lmt << endl;
}

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

using namespace std;

int main()
{
    int n;
    scanf("%d",&n);
    int b[n-1];
    for(int i=0;i<n-1;i++) scanf("%d",&b[i]);
    int res=(b[0]+b[n-2]);
    for(int i=1;i<n-1;i++) res+=min(b[i-1],b[i]);
    printf("%d\n",res);
    return 0;
}


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

using namespace std;

int main() {
    vector<int> a(5);
    
    for (int i = 0; i < 5; i++) {
        cin >> a[i];
    }
    
    int k;
    cin >> k;
    
    bool ok = true;
    
    for (int i = 0; i < 5; i++) {
        for (int j = i + 1; j < 5; j++) {
             if (a[j] - a[i] > k) {
                 ok = false;
             }
        }
    }
    
    cout << (ok ? "Yay!" : ":(") << endl;
}

Measured memory_bytes: 888
#include<bits/stdc++.h>
#define fi first
#define se second
using namespace std;

const int maxn = 3030 , maxt = 6060;
typedef pair<int,int> ii;

int n,t;
int dp[maxt];
ii A[maxn];

int main(){
	
	scanf("%d%d",&n,&t);
	
	for(int i = 0; i < n; i++)
		scanf("%d%d",&A[i].fi,&A[i].se);
	
	sort(A, A+n);
	
	for(int i = 0; i < n; i++){
		for(int k = t-1; k >= 0; k--){
			//printf("-- %d %d %d %d %d\n",k,a,b,dp[k+a],dp[k]+b);
			dp[k+A[i].fi] = max(dp[k+A[i].fi], dp[k] + A[i].se);
		}
	}
	
	int ans = 0;
	
	for(int i = 0; i < maxt; i++)
		ans = max(ans, dp[i]);
	
	printf("%d\n",ans);
	
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define P pair<ll,ll>
#define FOR(I,A,B) for(ll I = ll(A); I < ll(B); ++I)
#define FORR(I,A,B) for(ll I = ll((B)-1); I >= ll(A); --I)
#define TO(x,t,f) ((x)?(t):(f))
#define SORT(x) (sort(x.begin(),x.end())) // 0 2 2 3 4 5 8 9
#define POSL(x,v) (lower_bound(x.begin(),x.end(),v)-x.begin()) //xi>=v  x is sorted
#define POSU(x,v) (upper_bound(x.begin(),x.end(),v)-x.begin()) //xi>v  x is sorted
#define NUM(x,v) (POSU(x,v)-POSL(x,v))  //x is sorted
#define REV(x) (reverse(x.begin(),x.end())) //reverse
ll gcd(ll a,ll b){if(a%b==0)return b;return gcd(b,a%b);}
ll lcm(ll a,ll b){ll c=gcd(a,b);return ((a/c)*(b/c)*c);}
#define NEXTP(x) next_permutation(x.begin(),x.end())
const ll INF=1e18+7;
const ll MOD=1e9+7;
#define out(a) cout<<fixed<<setprecision((a))
 

int main(){ 
	ll N;
	cin >> N;
	ll H[N];
	FOR(i,0,N)cin >> H[i];
	bool ok = true;

	H[0]--;
	FOR(i,1,N){
		if(H[i-1]<H[i]){
			H[i]--;
		}
		if(H[i-1]>H[i])ok=false;
	}
	if(ok){
		cout << "Yes" << endl;
	}else{
		cout << "No" << endl;
	}
}


Measured memory_bytes: 1024
from collections import deque
class SWAG():
    __slots__='unit','f','fold_r','fold_l','data_r','data_l'
    def __init__(self,unit,f,data):
        self.unit=unit
        self.f=f
        self.construct(data)
    def construct(self,data):
        self.fold_r=deque([self.unit])
        self.fold_l=deque([self.unit])
        self.data_r=deque()
        self.data_l=deque()
        sep=0--len(data)//2
        for t in data[sep:]:
            self.append(t)
        for t in data[sep-1::-1]:
            self.appendleft(t)
    def append(self,x):
        self.fold_r.append(self.f(self.fold_r[-1],x))
        self.data_r.append(x)
    def appendleft(self,x):
        self.fold_l.append(self.f(self.fold_l[-1],x))
        self.data_l.append(x)
    def pop(self):
        if not self.data_r:
            self.construct(tuple(self.data_l)[::-1])
        if not self.data_r:
            return self.popleft()
        self.fold_r.pop()
        return self.data_r.pop()
    def popleft(self):
        if not self.data_l:
            self.construct(tuple(self.data_r))
        if not self.data_l:
            return False
        self.fold_l.pop()
        return self.data_l.pop()
    def fold_all(self):
        return self.f(self.fold_r[-1],self.fold_l[-1])
def main():
    from fractions import gcd
    n,*a=map(int,open(0).read().split())
    l,r=SWAG(0,gcd,[]),SWAG(0,gcd,a[1:])
    m=r.fold_all()
    for i in range(n-1):
        l.append(a[i])
        r.popleft()
        m=max(m,gcd(l.fold_all(),r.fold_all()))
    print(m)
main()

Measured memory_bytes: 16136
#include<bits/stdc++.h>
#include<cstdio>
#define ll long long int

using namespace std;

int main(){
    ll n;
    vector<ll> am;
    vector<ll> by;
    ll i,j;
    ll mons_sum=0;

    cin >> n;
    for(i=0;i<n+1;i++){
        ll a1;
        cin >> a1;
        mons_sum+=a1;
        am.emplace_back(a1);
    }
    for(i=0;i<n;i++){
        ll b1;
        cin >> b1;
        by.emplace_back(b1);
    }

    ll mons_alives=0;
    for(i=0;i<n;i++){
        //敵[i,i+1] VS 勇者[i]
        if(am[i]>=by[i]){//敵の方が強いとき、同等のとき
            am[i]=am[i]-by[i];
            by[i]=0;
        }else{//勇者が強いとき
            by[i]=by[i]-am[i];
            am[i]=0;
            if(am[i+1]<=by[i]){//勇者がめっちゃ余裕あるとき
                by[i]=by[i]-am[i+1];
                am[i+1]=0;
            }else{//勇者がちょっと余裕あるとき
                am[i+1]=am[i+1]-by[i];
                by[i]=0;
            }
        }
        mons_alives+=am[i];
    }
    mons_alives+=am[i];

    //printf("[%lld,%lld]\n",mons_sum,mons_alives);

    cout << mons_sum-mons_alives << endl;
}

Measured memory_bytes: 2548
package main

import (
	"fmt"
)

func main() {
	var input string
	fmt.Scan(&input)

	var even int // 最初が１
	var odd int  // 最初が0

	for i, s := range input {
		if i%2 == 0 {
			if s == []rune("0")[0] {
				even += 1
			} else {
				odd += 1
			}
		} else {
			if s == []rune("0")[0] {
				odd += 1
			} else {
				even += 1
			}
		}
	}

	if even > odd {
		fmt.Println(odd)
	} else {
		fmt.Println(even)
	}
}


Measured memory_bytes: 1280
#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <chrono>
#define rep(i,n) for(int i = 0; i < n; i++)
#define ll long long
#define INF 100000000
#define uint unsigned int
#define MOD 1e9+7
using namespace std;


int main() {
	int N;
	cin >> N;
	char s;
	int red = 0;
	rep(i, N) {
		cin >> s;
		if (s == 'R') {
			red++;
		}
		else {
			red--;
		}
	}

	if (red > 0) {
		cout << "Yes" << endl;
	}
	else {
		cout << "No" << endl;
	}
}

Measured memory_bytes: 256
#include<stdio.h>

int main(){
	char s[4];
	scanf("%s",s);
	if(s[0]==s[1]&&s[1]==s[2]&&s[0]==s[2]){				
		printf("No\n");
	}
	else{
		printf("Yes\n");
	}
	return 0;
}


Measured memory_bytes: 1608
from collections import defaultdict

N, M = map(int, input().split())
H = [0] + list(map(int, input().split()))

# graph = {}
# for i in range(1, N + 1):
#     graph[i] = [0]
# for _ in range(M):
#     A, B = map(int, input().split())
#     graph[A].append(B)
#     graph[B].append(A)

graph = {}
for i in range(1, N + 1):
    graph[i] = {0}
for _ in range(M):
    A, B = map(int, input().split())
    graph[A].add(B)
    graph[B].add(A)

# [print(k, v) for k, v in graph.items()]
# print(graph[4])
cnt = 0
for i in range(1, N + 1):
    if H[i] > max(H[j] for j in graph[i]):
        cnt += 1
print(cnt)

# for _ in graph:

# # adjacent matrix
# adj_mat = [
#     [0, 1, 1, 0],
#     [0, 0, 1, 1],
#     [0, 0, 0, 1],
#     [0, 0, 0, 0]
# ] 

Measured memory_bytes: 59824
import java.util.*;
public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt();
		int [] in = new int [a];
        for(int i=0;i<a;i++){
                             in[i] = sc.nextInt();
                            }
        int b = 1000000;
		int c = 0;
        for(int i=1;i<=100;i++){
          for(int j=0;j<a;j++){c+=(in[j]-i)*(in[j]-i);
                               if(j==a-1){b=Math.min(b,c);
                                          c=0;                                                
                                         }                              
                              }                            
        }       
		System.out.println(b);
	}
}


Measured memory_bytes: 21844
#[allow(unused_imports)]
use itertools::Itertools;
use proconio::input;
#[allow(unused_imports)]
use proconio::marker::*;

fn main() {
    input! {
        n: usize,
        s: Chars,
        q: usize,
        k: [usize; q],
    }

    for k in k {
        let (mut d, mut m, mut dm, mut c) = (0, 0, 0, 0i64);
        for i in 0..n {
            match s[i] {
                'D' => d += 1,
                'M' => {
                    m += 1;
                    dm += d
                }
                'C' => c += dm,
                _ => {}
            }
            if let Some(j) = i.checked_sub(k - 1) {
                match s[j] {
                    'D' => {
                        dm -= m;
                        d -= 1;
                    }
                    'M' => m -= 1,
                    _ => {}
                }
            }
        }

        println!("{}", c);
    }
}


Measured memory_bytes: 6940
#include "bits/stdc++.h"
using namespace std;
typedef long long ll;
typedef pair<ll, ll> P;
#define rep(i, n) for(ll (i) = 0; (i) < (n); (i)++)
#define rep1(i, n) for(ll (i) = 1; (i) <= (n); (i)++)
#define rrep(i, n) for(ll (i) = (n) - 1; (i) >= 0; (i)--)
#define rrep1(i, n) for(ll (i) = (n); (i) >= 1; (i)--)
const ll INF = 1145141919;
const ll MOD = 1000000007;
template<class T> void chmax(T &a, const T &b){if(a < b){a = b;}}
template<class T> void chmin(T &a, const T &b){if(a > b){a = b;}}

vector<ll>path[101010];
ll path_flg[101010];
vector<ll>lang[101010];
ll lang_flg[101010];

int main(){

    ll N, M;
    cin >> N >> M;
    rep1(i, N){
        ll k;
        cin >> k;
        rep(j, k){
            ll l;
            cin >> l;
            path[i].push_back(l);
            lang[l].push_back(i);
        }
    }
    queue<ll>pq, lq;
    pq.push(1);
    path_flg[1] = 1;
    for(ll flg = 1; flg; ){
        flg = 0;
        while(!pq.empty()){
            flg = 1;
            ll idx = pq.front();
            pq.pop();
            rep(i, path[idx].size()){
                ll to = path[idx][i];
                if(lang_flg[to] == 0){
                    lang_flg[to] = 1;
                    lq.push(to);
                }
            }
        }
        while(!lq.empty()){
            flg = 1;
            ll idx = lq.front();
            lq.pop();
            rep(i, lang[idx].size()){
                ll to = lang[idx][i];
                if(path_flg[to] == 0){
                    path_flg[to] = 1;
                    pq.push(to);
                }
            }
        }
    }
    ll cnt = 0;
    rep1(i, N)cnt += path_flg[i];
    if(cnt == N)cout << "YES" << endl;
    else cout << "NO" << endl;

    return 0;
}

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

int main() {
  int N;
  cin >> N;
  vector<int> a(N);
  for(int i= 0;i<N;i++){
    cin >> a[i];
  }
  sort(a.begin(),a.end());
  a.push_back(1000000);
  
  vector<int> ans;
  if(N>=2){
  for(int i =0;i<N;i++){
     int c = 0;
    if(i>=1 && a[i]==a[i-1]){
      continue;
    }
    for(int j = i;j<N+1;j++){
      if(a[j] <= a[i] +2){
        c++;
      }
      else if(a[j] > a[i] +2){
        ans.push_back(c);
        break;
       }
      }
     }
   sort(ans.begin(),ans.end());
   cout << ans[ans.size()-1] << endl;
  }
  if(N == 1) cout << 1 << endl;
}


Measured memory_bytes: 1144
from operator import itemgetter
n = int(input())
l = []
for _ in range(n):
  s,p = map(str,input().split())
  p = int(p)
  l.append([s,p])
#print(l)
l1 = sorted(l,key=itemgetter(1),reverse=True)
#print(l1)
l2 = sorted(l1,key=itemgetter(0))
#print(l2)
for i in l2:
  print(l.index(i)+1)

Measured memory_bytes: 3064
import math
s = int(input())


x1 = 0
y1 = 0

INF = 10**9

q = int(math.sqrt(s))

if q*q<s:
    q=q+1
x2 = q
y3 = q

x3 = 1
y2 = x2*y3-s

print(x1,y1,x2,y2,x3,y3)



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

a = list(map(int,input().split()))

c = {}
for i in range(n):
    if a[i] + i + 1 not in c.keys():
        c[a[i]+i+1] = 1
    else:
        c[a[i]+i+1] += 1

#print(c)

ans = 0
for i in range(n):
    if i + 1 - a[i] not in c.keys():
        pass
    else:
        ans += c[i + 1 - a[i]]

print(ans)
        

Measured memory_bytes: 40232
#include<bits/stdc++.h>
#define rep1(i,n,a) for(int i=0;i<n;i+=a)
#define rep2(i,n,a) for(int i=a;i<n;i++)
#define rep3(n)     for(int i=0;i<n;i++)
#define inarr(arr,n) rep1(i,n,1)cin>>arr[i]
#define ll long long int
#define pb push_back
#define all(v) v.begin(),v.end()
#define trav(a,x) for(auto x:a)
#define endl "\n"
#define eb emplace_back
#define fr first
#define sc second
#define gcd(a,b) __gcd(a,b)
#define pres(a,x) a.find(x)!=a.end()
#define sz(a) (int)a.size()
#define pii pair<int,int>
#define psi pair<string,int>
#define pss pair<string,string>
#define pll pair<ll,ll>
#define vec vector<int>
#define IOS ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
#define ret return 0
#define pi 3.1415926536
#define hell 1000000007
#define narak 998244353
const int inf1=1e9;
const ll inf2=1e18;
using namespace std;
int dirs[4][2] ={{1,0},{-1,0},{0,1},{0,-1}};
// syntax for min priority_queue of pairs
// priority_queue<pair<ll,ll>,vector<pair<ll,int>>,greater<pair<ll,int>>> q;
int solve(){
  int n;cin>>n;
  int arr[n];inarr(arr,n);
  int mi=arr[0];
  int cnt=1;
  for(int i=1;i<n;i++){
      if(mi>=arr[i])cnt++;
      mi=min(arr[i],mi);
  }
cout<<cnt<<endl;
  ret;
}
int main(){
    IOS;
    //freopen("input.txt", "r", stdin);
    //freopen("output.txt", "w", stdout);
    int t=1;//cin>>t;
    while(t--){
        solve();
    }
    ret;
}
 


Measured memory_bytes: 1024
n=int(raw_input())
a=map(int,raw_input().split())
def f():
    s=[(0,-1)]
    x=[0]*(n+1)
    for i,j in enumerate(a):
        while s[-1][0]>j:s.pop()
        x[j]=i-s[-1][1]
        s.append((j,i))
    return x
l=f()
a.reverse()
r=f()
print sum([i*l[i]*r[i] for i in a])


Measured memory_bytes: 49272
// スタックサイズ: 100MB

#include <iostream>
#include <fstream>
#include <vector>
#include <map>
#include <unordered_map>
#include <string>
#include <cmath>
#include <cstdio>
#include <algorithm>
#include <functional>
#include <numeric>
#include <iomanip>
#include <queue>
#include <list>
#include <set>
using namespace std;

typedef int64_t ll;
typedef vector<ll> vll;
typedef pair<ll, ll> pll;
const ll INF = 1000000000000000000;
#define fori(i, a, b) for (ll i = (a); i < (b); ++i)
#define ford(i, a, b) for (ll i = (b - 1); (a) <= i; --i)
#define rep(i, n) fori(i, 0, n)
#define all(v) (v).begin(), (v).end()
#define fst first
#define snd second
ll pw(ll x, ll y) { ll r = 1;  rep(i, y) { r *= x; }; return r; }




int main() {
	
	ll m;
	cin >> m;
	cout << 48 - m << endl;
}

Measured memory_bytes: 256
#include <iostream>
#include <cmath>
#include <algorithm>
#include <vector>
using namespace std;
int main() {
    int N; cin >> N;
    vector<string> S(N, "");
    int MX = 0;
    for (int i = 0; i < N; ++i) {
        cin >> S[i];
    }
    sort(S.begin(), S.end());
    string str = ""; int cnt = 0;
    vector<pair<string, int>> ans;
    for (int i = 0; i < N; ++i) {

        if (str != S[i]) {
            if (str != "") ans.push_back(make_pair(str, cnt));
            MX = max(MX, cnt);
            str = S[i];
            cnt = 1;
        }
        else cnt++;
    }
    ans.push_back(make_pair(str, cnt));
    MX = max(MX, cnt);
    for (int k = 0; k < ans.size(); ++k) {
        if (ans[k].second == MX)
            cout << ans[k].first << endl;
    }
}

Measured memory_bytes: 18420
#include <iostream>
#include <iomanip>

using namespace std;
int main (){
  int a, b;
  string op;
  while (true){
    cin >> a >> op >> b;
    if (op == "?"){
      return 0;
    }else{
      if (op == "+"){
        cout << a + b << endl;
      }else if (op == "-"){
        cout << a - b << endl;
      }else if(op == "*"){
        cout << a * b << endl;
      }else{
        cout << a / b << endl;
      }
    }
  }
}


Measured memory_bytes: 3104
#include <bits/stdc++.h>
using namespace std;
#define FOR(i,a,b) for(int i=(a),i##formax=(b);i<i##formax;i++)
#define FORR(i,a,b) for(int i=(a),i##formax=(b);i>=i##formax;i--)
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define pcnt __builtin_popcount
#define sz(x) (int)(x).size()
#define maxs(x,y) x=max(x,y)
#define mins(x,y) x=min(x,y)
#define show(x) cout<<#x<<" = "<<x<<endl;
#define all(a) (a.begin()),(a.end())
#define each(it,c) for(__typeof((c).begin()) it=(c).begin();it!=(c).end();it++)
#define perm(c) sort(all(c));for(bool c##p=1;c##p;c##p=next_permutation(all(c)))
#define bitComb(a,n,k) for(int a##x,a##y,a=(1<<k)-1;a<(1<<n);a##x=a&-a,a##y=a+a##x,a=(((a&~a##y)/a##x)>>1)|a##y)
#define uniq(v) sort(all(v));v.erase(unique(all(v)), v.end())
#define bit(n) (1LL<<(n))
#define randInt(l,r) (uniform_int_distribution<ll>(l,r)(rnd))
#define randDouble(l,r) (uniform_real_distribution<double>(l,r)(rnd))
#define dout(d) printf("%.12f\n",d)

typedef long long ll;
typedef __int128_t lll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
template<class T>using V=vector<T>;
template<class T>using VV=V<V<T>>;
template<class T,class Y>ostream& operator<<(ostream& o,const pair<T,Y>& p){return o<<"("<<p.fi<<", "<<p.se<<")";}
template<typename A,size_t N,typename T>void Fill(A (&array)[N],const T&v){fill((T*)array,(T*)(array+N),v);}
lll gcd(lll a,lll b,lll &x,lll &y){if(!b){x=1;y=0;return a;}lll d=gcd(b,a%b,y,x);y-=a/b*x;return d;}
ll gcd(ll a,ll b){lll x=0,y=0;return gcd(a,b,x,y);}
ll modInv(ll a,ll m){lll x,y;gcd(a,m,x,y);return (x%m+m)%m;}
ll modPow(lll a,lll n,ll m){if(!a)return a;lll p=1;for(;n>0;n>>=1,a=a*a%m)if(n&1)p=p*a%m;return(ll)p;}
bool isPrime(ll n){if(n<2||n%2==0)return n==2;lll t=n-1,d=t/(t&-t);for(lll a:{2,325,9375,28178,450775,9780504,1795265022})if(a%n){for(t=d,a=modPow(a,t,n);t!=n-1&&a!=1&&a!=n-1;a=a*a%n,t=t*2%n);if(a!=n-1&&t%2==0)return 0;}return 1;}
const int IINF = 1e9+6;
const ll LINF = 1e18;
const int MOD = 1e9+7;
const double PI = acos(-1);
const double EPS = 1e-10;
static random_device rd;
static mt19937 rnd(rd());

const int N = 1e5;
int x, mx, n;
string s;
main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  cin >> n >> s;
  FOR(i, 0, n){
    x += (s[i]=='I' ? 1 : -1);
    maxs(mx, x);
  }
  cout << mx << endl;
}

Measured memory_bytes: 256
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <cstring>
#include <algorithm>
#include <iostream>
#include <string>
using namespace std;

int main()
{
	int n;
	char a[2][3];
	while(scanf("%d", &n) != EOF)
	{
		for(int i = 1; i <= 2; i++)
	    {			
		    for(int j = 1; j <= 3; j++)
		    {
			    scanf(" %c", &a[i][j]);
		    }
	    }
	    if(a[1][1] == a[2][3] && a[1][2] == a[2][2] && a[1][3] == a[2][1])
		    printf("YES\n");
	    else
		    printf("NO\n");
	}
	return 0;
}



Measured memory_bytes: 256
def main(n):
	r = 0
	f = n[0]
	if(f =="0"):
		# zero mode
		for i in range(1, len(n)):
			if(i % 2 == 0): # 偶
				# 1
				if(n[i]=="1"):
					r+=1
			else: # basic
				# 0
				if(n[i]=="0"):
					r+=1
	else:
		# one mode
		for i in range(1, len(n)):
			if(i % 2 == 0): # 偶
				# 1
				if(n[i]=="0"):
					r+=1
			else: # basic
				# 0
				if(n[i]=="1"):
					r+=1
	# sum(result)
	return r

print(main(input()))
#assert(1 == main("000"))
#assert(3 == main("10010010"))
#assert(0 == main("0"))

Measured memory_bytes: 3188
// スタックサイズ: 100MB

#include <iostream>
#include <fstream>
#include <vector>
#include <map>
#include <unordered_map>
#include <string>
#include <cmath>
#include <cstdio>
#include <algorithm>
#include <functional>
#include <numeric>
#include <iomanip>
#include <queue>
#include <list>
#include <set>
using namespace std;

typedef int64_t ll;
typedef vector<ll> vll;
typedef pair<ll, ll> pll;
const ll INF = 1000000000000000000;
#define fori(i, a, b) for (ll i = (a); i < (b); ++i)
#define ford(i, a, b) for (ll i = (b - 1); (a) <= i; --i)
#define rep(i, n) fori(i, 0, n)
#define all(v) (v).begin(), (v).end()
#define fst first
#define snd second
ll pw(ll x, ll y) { ll r = 1;  rep(i, y) { r *= x; }; return r; }




int main() {
	
	ll a, b;
	cin >> a >> b;
	cout << (a * b % 2 == 0 ? "Even" : "Odd") << endl;
}

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

map<ll,ll> pfact(ll n) {
  map<ll,ll> ret;
  while(n%2==0) {ret[2]++;n/=2;}
  for(ll i=3;i*i<=n;i+=2) while(n%i == 0) {ret[i]++;n /= i;}
  if(n!=1) ret[n]=1;
  return ret;
}

int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  ll n,ans=1;cin>>n;
  map<ll,ll> m=pfact(n-1);
  ll val=1;
  for(auto p:m) val*=(p.second+1);
  ans+=val-1;
  ll n_=n;
  for(ll div=2;div*div<=n;++div) {
    n_=n;
    if(n_%div!=0) continue;
    while(n_%div==0) n_/=div;
    if(n_%div==1) ans++;
  }
  print(ans);
  return 0;
}

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

int main() {
  string s;
  cin>>s;
  int n=s.size();
  int ans=0;
  for(int i=0;i<n;i++){
    int kari=0;
    for(int j=i;j<n;j++){
      if(s[j]=='A' || s[j]=='C' || s[j]=='G' || s[j]=='T') kari++;
      else break;
    }
    ans=max(ans,kari);
  }
  cout<<ans<<endl;
      
}


Measured memory_bytes: 256
import sys

input = sys.stdin.readline


class AtCoder:
    def main(self):
        N, K, Q = map(int, input().split())
        A = [int(input()) for _ in range(Q)]

        dic = {}
        for a in A:
            dic[a] = dic.get(a, 0) + 1

        for i in range(N):
            if K - Q + dic.get(i + 1, 0) > 0:
                print('Yes')
            else:
                print('No')


# Run main
if __name__ == '__main__':
    AtCoder().main()


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

using namespace std;

typedef long long ll;

#define faster ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0)

#define endl "\n"

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

	ll x = 7 % k,ans = 1;

	while(true){
		if(x == 0) break;
		if(ans > 1000000) break;
		x = (x * 10) + 7;
		x %= k;
		ans++;
	}

	if(x == 0) cout << ans << endl;
	else cout << -1 << endl;
	
	return 0;
}

Measured memory_bytes: 3632
package main

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

var sc = bufio.NewScanner(os.Stdin)

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

func iScan() int {
	n, _ := strconv.Atoi(Scan())
	return n
}

func fScan() float64 {
	n, _ := strconv.ParseFloat(Scan(), 64)
	return n
}
func stringToInt(s string) int {
	n, _ := strconv.Atoi(s)
	return n
}
func SScan(n int) []string {
	a := make([]string, n)
	for i := 0; i < n; i++ {
		a[i] = Scan()
	}
	return a
}
func iSScan(n int) []int {
	a := make([]int, n)
	for i := 0; i < n; i++ {
		a[i] = iScan()
	}
	return a
}
func abs(x int) int {
	if x < 0 {
		x = -x
	}
	return x
}
func larger(a, b int) int {
	if a < b {
		return b
	} else {
		return a
	}
}
func smaller(a, b int) int {
	if a > b {
		return b
	} else {
		return a
	}
}
func max(a []int) int {
	x := a[0]
	for i := 0; i < len(a); i++ {
		if x < a[i] {
			x = a[i]
		}
	}
	return x
}
func min(a []int) int {
	x := a[0]
	for i := 0; i < len(a); i++ {
		if x > a[i] {
			x = a[i]
		}
	}
	return x
}
func sum(a []int) int {
	x := 0
	for _, v := range a {
		x += v
	}
	return x
}

var mod int = 1000000007

func main() {
	buf := make([]byte, 0)
	sc.Buffer(buf, mod)
	sc.Split(bufio.ScanWords)
	n := iScan()
	ans := 1
	for i := 1; i*i <= n; i++ {
		ans = i * i
	}
	fmt.Println(ans)
}


Measured memory_bytes: 1772
#include<iostream>
#include<algorithm>
#include<vector>
#include<string>
#include<utility>
#include<map>
#include<set>
#include <sstream>
#include<queue>
#include<stack>
#include<functional>
#include<math.h>
#include <iomanip>
#include <regex>
#include <initializer_list>
#define DBL_MIN 0.000000000000001
#define A_P(n,a,d) (n/2)*(2*a + (n-1)*d)
using namespace std;



int main(void){
  long a,b,c,d;
  cin >> a >> b >> c >> d;
  cout << max(max(a*c,a*d),max(b*c,b*d)) << endl;
  return 0;
}

Measured memory_bytes: 3652
#include <bits/stdc++.h>
#define ll long long
#define ar array
#define AC ios_base::sync_with_stdio(0); cin.tie(NULL);
using namespace std;
const int M = 1e9+7;
const int N = 2*1e5;

ll n, ans;

int main(){
    AC
    cin>>n;
    ll ans = 0;
    for(int i=1; i<=n; i++){
        int k = n/i;
        ans+=(ll)(i+k*i)*k/2;
    }
    cout<<ans<<endl;
}

Measured memory_bytes: 3652
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {

    static final int MOD = 1000000007;

    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String[] input = br.readLine().split(" ");

        int H = Integer.parseInt(input[0]);
        int W = Integer.parseInt(input[1]);

        String[] grid = new String[H];

        for(int i=0; i<H; i++) {
            grid[i] = br.readLine();
        }

        System.out.println(getWays(grid, H, W));
    }

    private static int getWays(String[] grid, int H, int W) {
        int[][] ways = new int[H][W];

        for(int i=0; i<W; i++) {
            if(grid[0].charAt(i) == '#') {
                break;
            }

            ways[0][i] = 1;
        }

        for(int i=0; i<H; i++) {
            if(grid[i].charAt(0) == '#') {
                break;
            }

            ways[i][0] = 1;
        }

        for(int i=1; i<H; i++) {
            for(int j=1; j<W; j++) {
                if(grid[i].charAt(j) != '#') {
                    ways[i][j] = (ways[i - 1][j] + ways[i][j - 1]) % MOD;
                }
            }
        }

        return ways[H-1][W-1];
    }
}


Measured memory_bytes: 41416
#include <iostream>
#include <cstdio>
#include <string>
#include <cmath>
#include <algorithm>
#include <cctype>
using namespace std;

int main() {
    string s;
    cin >> s;
    if (s[1] > s[0] || s[1] == s[0] && s[2] > s[0]) {
        s[0]++;
        s[2]=s[1] = s[0];        
    }
    else {
        s[2] = s[1] = s[0];
    }
    cout << s << endl;
}
    

Measured memory_bytes: 256
#pragma region include
#include <iostream>
#include <iomanip>
#include <stdio.h>

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

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

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

#include <fstream>
#include <random>
//#include <time.h>
//#include <intrin.h>
#include <ctime>
#pragma endregion //#include
/////////
#define REP(i, x, n) for(int i = x; i < n; ++i)
#define rep(i,n) REP(i,0,n)
#define ALL(X) X.begin(), X.end()
/////////
#pragma region typedef
typedef long long LL;
typedef long double LD;
typedef unsigned long long ULL;
typedef std::pair<LL,LL> PLL;//
typedef std::pair<int,int> PII;//
#pragma endregion //typedef
////定数
const int INF = (int)1e9;
const LL MOD = (LL)1e9+7;
const LL LINF = (LL)4e18+20;
const LD PI = acos(-1.0);
const double EPS = 1e-9;
/////////
using namespace::std;

void solve(){
	string str;
	cin >> str;
	cout << "ABC" << str << endl;
}
#pragma region main
signed main(void){
	std::cin.tie(0);
	std::ios::sync_with_stdio(false);
	std::cout << std::fixed;//小数を10進数表示
	cout << setprecision(16);//小数点以下の桁数を指定//coutとcerrで別	

	solve();
}
#pragma endregion //main()

Measured memory_bytes: 380