akhauriyash/Code-Regression huggingface dataset:
//start of jonathanirvings' template v3.0.3 (BETA)

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

typedef long long LL;
typedef pair<int,int> pii;
typedef pair<LL,LL> pll;
typedef pair<string,string> pss;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<pii> vii;
typedef vector<LL> vl;
typedef vector<vl> vvl;

double EPS = 1e-9;
int INF = 1000000005;
long long INFF = 1000000000000000005LL;
double PI = acos(-1);
int dirx[8] = {-1,0,0,1,-1,-1,1,1};
int diry[8] = {0,1,-1,0,-1,1,-1,1};

#ifdef TESTING
  #define DEBUG fprintf(stderr,"====TESTING====\n")
  #define VALUE(x) cerr << "The value of " << #x << " is " << x << endl
  #define debug(...) fprintf(stderr, __VA_ARGS__)
#else
  #define DEBUG 
  #define VALUE(x)
  #define debug(...)
#endif

#define FOR(a,b,c) for (int (a)=(b);(a)<(c);++(a))
#define FORN(a,b,c) for (int (a)=(b);(a)<=(c);++(a))
#define FORD(a,b,c) for (int (a)=(b);(a)>=(c);--(a))
#define FORSQ(a,b,c) for (int (a)=(b);(a)*(a)<=(c);++(a))
#define FORC(a,b,c) for (char (a)=(b);(a)<=(c);++(a))
#define FOREACH(a,b) for (auto &(a) : (b))
#define REP(i,n) FOR(i,0,n)
#define REPN(i,n) FORN(i,1,n)
#define MAX(a,b) a = max(a,b)
#define MIN(a,b) a = min(a,b)
#define SQR(x) ((LL)(x) * (x))
#define RESET(a,b) memset(a,b,sizeof(a))
#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define ALL(v) v.begin(),v.end()
#define ALLA(arr,sz) arr,arr+sz
#define SIZE(v) (int)v.size()
#define SORT(v) sort(ALL(v))
#define REVERSE(v) reverse(ALL(v))
#define SORTA(arr,sz) sort(ALLA(arr,sz))
#define REVERSEA(arr,sz) reverse(ALLA(arr,sz))
#define PERMUTE next_permutation
#define TC(t) while(t--)

inline string IntToString(LL a){
  char x[100];
  sprintf(x,"%lld",a); string s = x;
  return s;
}

inline LL StringToInt(string a){
  char x[100]; LL res;
  strcpy(x,a.c_str()); sscanf(x,"%lld",&res);
  return res;
}

inline string GetString(void){
  char x[1000005];
  scanf("%s",x); string s = x;
  return s;
}

inline string uppercase(string s){
  int n = SIZE(s); 
  REP(i,n) if (s[i] >= 'a' && s[i] <= 'z') s[i] = s[i] - 'a' + 'A';
  return s;
}

inline string lowercase(string s){
  int n = SIZE(s); 
  REP(i,n) if (s[i] >= 'A' && s[i] <= 'Z') s[i] = s[i] - 'A' + 'a';
  return s;
}

inline void OPEN (string s) {
  #ifndef TESTING
  freopen ((s + ".in").c_str (), "r", stdin);
  freopen ((s + ".out").c_str (), "w", stdout);
  #endif
}

//end of jonathanirvings' template v3.0.3 (BETA)

int n;
int data[100005];
bool naik = 1;
bool turun = 1;
int risan = 1;

int main()
{
  scanf("%d",&n);
  REP(i,n) scanf("%d",&data[i]);
  FOR(i,1,n)
  {
    // VALUE(i);
    // VALUE(risan);
    naik &= (data[i] >= data[i-1]);
    turun &= (data[i] <= data[i-1]);
    if (data[i] > data[i-1] && !naik)
    {
      ++risan;
      // ++i;
      naik = turun = 1;
    } else if (data[i] < data[i-1] && !turun)
    {
      ++risan;
      // ++i;
      naik = turun = 1;
    }
  }
  printf("%d\n",risan);
  return 0;
}










Measured memory_bytes: 640
#include<stdio.h>
int main()
{
	int a, b, c;
	int max, min;
	scanf("%d %d %d", &a, &b, &c);
	if(a>b && a>c)
	{
		max=a;
	}
	else if(b>a && b>c)
	{
		max=b;
	}
	else
	{
		max=c;
	}
	if(a<b && a<c)
	{
		min=a;
	}
	else if(b<a && b<c)
	{
		min=b;
	}
	else 
	{
		min=c;
	}
	printf("%d %d %d\n", min,(a+b+c)-max-min, max);
	return 0;
}


Measured memory_bytes: 2084
#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 n, q;
multiset<ll> st;
map<ll, ll> m;
map<ll, V<ll>> v;
main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  cin >> n >> q;
  FOR(_, 0, n){
    ll s, t, x;
    cin >> s >> t >> x;
    v[s-x].pb(-x);
    v[t-x].pb( x);
  }
  st.insert(LINF);
  each(itr, v){
    sort(all(itr->se));
    for(ll a:(itr->se)){
      if(a < 0){
        st.insert(-a);
      }else{
        st.erase(st.find(a));
      }
    }
    m[itr->fi] = *(st.begin());
  }
  m[-LINF] = LINF;
  FOR(_, 0, q){
    ll d;
    cin >> d;
    d = (--m.upper_bound(d))->se;
    cout << (d==LINF ? -1 : d) << endl;
  }
}

Measured memory_bytes: 79360
#include<stdio.h>

int main(){
  char s[15];
  int m;
  int i,j;
  int ans=0;
  int c;

  scanf("%s",s);
  for(m=0;s[m]!='\0';m++);

  for(i=0;i<m;i++){
    if(s[i]=='A'||s[i]=='C'||s[i]=='G'||s[i]=='T'){
      c=1;
      j=i+1;
      for(j=i+1;s[j]=='A'||s[j]=='C'||s[j]=='G'||s[j]=='T';j++){
    	c++;
    	}
      if(c>ans){
        ans=c;
      }

    }else{

    }

  }

  printf("%d",ans);

  return 0;
}


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

int main(){

    int n;cin>>n;
    vector<ll> v(n);
    for(int i=0;i<n;i++){
    	cin>>v[i];
    }
    sort(v.rbegin(), v.rend());
    ll ans = v[0];
    double j = 1;
    for(int i=2;i<n;i++){
    	ans += v[(int)j];
    	j += 0.5;
    }
    cout<<ans;

    return 0;
}

Measured memory_bytes: 4844
#include <bits/stdc++.h>
#define ll long long
#define cwk freopen("D:\\c++\\in.txt","r",stdin),freopen("D:\\c++\\out.txt","w",stdout)
using namespace std;
const int N=1e6+10;
const int mod=998244353;
int n,s,a[N];
ll dp[N];
int main()
{
	//cwk;
	scanf("%d%d",&n,&s);
	for(int i=1;i<=n;i++) {
		scanf("%d",&a[i]);
	}
	ll ans=0;
	for(int i=1;i<=n;i++) {
		dp[0]++;
		for(int j=s;j>=a[i];j--) {
			dp[j]=(dp[j]+dp[j-a[i]])%mod;
		}
		ans=(ans+dp[s])%mod;
	}
	printf("%lld\n",ans);

	return 0;
}

Measured memory_bytes: 2304
def resolve():
    H, W, K = map(int, input().split())
    G = [list(input()) for _ in range(H)]

    ans = [[0] * W for _ in range(H)]
    cnt, first = 1, -1
    for i in range(H):
        tmp = 0
        if "#" in G[i]:
            if first == -1:
                first = i
            for j in range(W):
                if G[i][j] == "#":
                    tmp += 1
                    if tmp > 1:
                        cnt += 1
                ans[i][j] = cnt
            cnt += 1
        else:
            if i > 0:
                ans[i] = ans[i - 1][:]

    for q in range(first):
        ans[q] = ans[first][:]

    for i in range(H):
        print(*ans[i])


if __name__ == "__main__":
    resolve()


Measured memory_bytes: 13324
#include<bits/stdc++.h>
#define mod 1000000007
#define ll long long int
#define ar array
#define mp make_pair
using namespace std;

int main()
{
	ios::sync_with_stdio(false);
	cin.tie(NULL);
	char ch,c;
	cin>>c>>ch;
	if(c=='H')
		cout<<ch<<endl;
	else
	{
		if(ch=='D')
			cout<<'H'<<endl;
		else
			cout<<'D'<<endl;
	}
	return 0;
}

Measured memory_bytes: 256
#include <iostream>
//#include <cstdio>
//#include <cstdlib>
//#include <cmath>
//#include <cstring>
//#include <vector>
//#include <set>
//#include <map>
//#include <stack>
//#include <queue>
//#include <string>
//#include <algorithm>
//#include <bitset>
using namespace std;

#define loop(n)          for(int i = 0; i < (n); i++)
#define lp(x, s, e)      for(int x = (s); x < (e); x++)

int arr[1000000];

void init() {
    cin.tie(0);
    cin.sync_with_stdio(0);
}




int main()
{
    init();
    int n;
    cin >> n;
    if (n % 1000 == 0)
        cout << 0;
    else
    cout << 1000 - (n % 1000);
}

Measured memory_bytes: 3636
#include <stdio.h>
#include <stdlib.h>

int main(void) {

	int i,j,n,d;

	scanf("%d", &n);

	for(i =1;i<10;i++){
		for(j=1;j<10;j++){
			d=i*j;
			if(d == n){
				printf("Yes");
				return EXIT_SUCCESS;
			}
		}
	}

	printf("No");

	return EXIT_SUCCESS;
}

Measured memory_bytes: 128
#include <bits/stdc++.h>
#include <ext/pb_ds/detail/standard_policies.hpp>
using namespace __gnu_pbds;
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
#define endl "\n"
const int MAX= 100005 ;
const long long mod = 1.0e9+7;
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    ll a,b;
    cin>>a>>b;
    if(a>=13)
        cout<<b<<endl;
    else if(a<13 && a>5)
        cout<<b/2<<endl;
    else
        cout<<"0"<<endl;
    return 0;
}

Measured memory_bytes: 256
import sys
input = sys.stdin.readline


def main():
    N = int(input())

    if N % 2 == 0:
        ans = 0
        for i in range(1, 30):
            ans += N // (2 * (5 ** i))

        print(ans)
    else:
        print(0)




if __name__ == '__main__':
    main()



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

using namespace std;

int main() {
	int R;
	cin >> R;
	if(R < 1200){
		cout << "ABC";
	} else if(R < 2800){
		cout << "ARC";
	} else {
		cout << "AGC";
	}
}


Measured memory_bytes: 256
import sys
sys.setrecursionlimit(2147483647)
INF=float("inf")
MOD=10**9+7
input=lambda :sys.stdin.buffer.readline().rstrip()
def resolve():
    n,w=map(int,input().split())
    W=[0]*n
    V=[0]*n
    for i in range(n):
        W[i],V[i]=map(int,input().split())
    dp=[[0]*(w+1) for _ in range(n+1)]
    for i in range(n):
        for k in range(w+1):
            if(k+W[i]<=w):
                dp[i+1][k+W[i]]=max(dp[i][k]+V[i],dp[i+1][k+W[i]])
            dp[i+1][k]=max(dp[i+1][k],dp[i][k])
    print(dp[n][w])
resolve()

Measured memory_bytes: 118896
#include<ctime>
#include<iostream>
#include<algorithm>
#include<cstdio>
#include<cstdlib>
#include<cmath> 
#include<cstring> 
#include<cassert>
#include<string>
#include<sstream>
#include<fstream>
#include<deque>
#include<queue>
#include<vector>
#include<map>
#include<list>
#include<stack>
#include<set>
#include<bitset>
#include<iomanip>
#include<utility>
#include<functional>
#include<cctype>
#include<cerrno>
#include<cfloat>
#include<ciso646>
#include<climits>
#include<clocale>
#include<complex>
#include<csetjmp>
#include<csignal>
#include<cstdarg>
#include<cstddef>
#include<cwchar>
#include<cwctype>
#include<exception>
#include<locale>
#include<numeric>
#include<new>
#include<stdexcept>
#include<limits>
using namespace std;

#define ll long long
#define INF 1e9
#define rep(i,n) for(int (i)=0;(i)<n;i++)
#define REP(i,n) for(int (i)=1;(i)<=n;i++)
#define mk(a,b) make_pair(a,b)
#define fi first
#define se second
#define pii pair<int,int>
#define sz(s) s.size()
#define all(s) (s.begin(),s.end())
inline void Fail(){
	printf("0");
	exit(0);
}

const int maxn=100005;
int n,a,b;
ll ans;
int x[maxn];

int main(){
	scanf("%d%d%d",&n,&a,&b);
	rep(i,n)scanf("%d",&x[i]);
	rep(i,n-1){
		if(1LL*(x[i+1]-x[i])*a<b)ans+=1LL*(x[i+1]-x[i])*a;
		else ans+=b;
	}
	printf("%lld",ans);
	return 0;
}

Measured memory_bytes: 640
#include "bits/stdc++.h"
using namespace std;
using ll = long long;
#define rep(i, begin, n) for (int i = begin; i < n; i++)
#define repe(i, begin, n) for (int i = begin; i <= n; i++)
#define repr(i, begin, n) for (int i = begin; i > begin - n; i--)
#define repre(i, begin, end) for (int i = begin; i >= end; i--)

template <class T>
inline bool chmax(T& a, T b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}

template <class T>
inline bool chmin(T& a, T b) {
  if (a > b) {
    a = b;
    return 1;
  }
  return 0;
}

const int inf = 1000000007;
const int MOD = 1000000007;
const long long INF = 1000000000000000007;

// -------------------------------------------------------
int a, b, c, d;

int main() {
  cin >> a >> b >> c >> d;

  cout << min(a, b) + min(c, d);
}

Measured memory_bytes: 256
class Lining:

    def line(self, N, A):

        if N == 1:
            print 1
            return

        if N == 2:
            print 2
            return

      
        if N % 2:

            m = [0 for i in range((N/2)+1)]
            for a in A:
                idx = a/2
                m[idx] += 1

            if m[0] != 1:
                print 0
                return

            ans = 1
            for i in range(1, (N/2)+1):
                ans *= 2

                if m[i] != 2:
                    print 0
                    return

            print ans % (pow(10, 9) + 7)

        else:

            m = [0 for i in range(N/2)]
            for a in A:
                idx = a/2
                m[idx] += 1

            ans = 1
            for i in range(N/2):
                ans *= 2

                if m[i] != 2:
                    print 0
                    return

            print ans % (pow(10, 9) + 7)

if __name__ == "__main__":

    N = input()
    A = [int(i) for i in raw_input().split()]

    abc = Lining()
    abc.line(N, A)


Measured memory_bytes: 11584
#include<bits/stdc++.h>
#define REP(i,n) for(int i=0,i##_len=(n);i<i##_len;++i)
#define rep(i,a,b) for(int i=int(a);i<int(b);++i)
using namespace std;

int main(){
    int c[3][3];
    REP(i,3) REP(j,3) cin>>c[i][j];
    bool ok=true;
    int a[3],b[3];
    a[0]=0;
    REP(j,3) b[j]=c[0][j]-a[0];
    REP(j,3) a[j]=c[j][j]-b[j];
    REP(i,3) REP(j,3){
        if(c[i][j]!=a[i]+b[j]) ok=false;
    }
    if(ok) cout<<"Yes"<<endl;
    else cout<<"No"<<endl;
}

Measured memory_bytes: 256
M, D = map(int, input().split())
count = 0
for m in range(1, M + 1):
    for d in range(22, D + 1):
        d10, d1 = map(int, list(str(d)))
        if d1 * d10 == m and d1 >= 2 and d10 >= 2:
            count += 1
print(count)

Measured memory_bytes: 3064
#include <iostream>
#include <vector>
#include <algorithm>
#include <queue>
#include <set>
#include <map>
#include <string>
#include <cmath>
#include <climits>
#include <iomanip>

using namespace std;

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

typedef long long LL;
typedef vector<int> VI;

int main() {
  int N, K;
  cin >> N >> K;
  vector<double> sum(N);
  for (int i = 0; i < N; i++) {
    double d;
    cin >> d;
    double ave = (1.0+d)/2.0;
    if (i == 0) {
      sum[0] = ave;
    } else {
      sum[i] = sum[i-1] + ave;
    }
  }
  double maxv = 0;
  for (int i = 0; i+K-1 < N; i++) {
    if (i == 0) {
      maxv = max({maxv, sum[i+K-1]});
    } else {
      maxv = max({maxv, sum[i+K-1]-sum[i-1]});
    }
  }
  cout << setprecision(10) << maxv << endl;
  return 0;
}


Measured memory_bytes: 1792
#include <iostream>
#include <vector>
#include <stack>
#include <queue>
#include <map>
#include <bitset>
#include <algorithm>
#include <cstdio>
#include <cstdlib>
#include <cmath>

using namespace std;

int main(){
	int n = 0;
	cin >> n;
	while(n--){
		map<char, vector<int> > table;
		table['R'] = vector<int>(10, 0);
		table['G'] = vector<int>(10, 0);
		table['B'] = vector<int>(10, 0);
		vector<int> number(9, 0);
		char clist[] = {'R', 'G', 'B'};
		for(int i = 0; i < 9; i++){
			cin >> number[i];
		}
		for(int i = 0; i < 9; i++){
			char color = ' ';
			cin >> color;
			table[color][number[i]]++;
		}

		bool win = true;
		for(int i = 0; i < 3; i++){
			for(int j = 1; j <= 9; j++){
				if(table[clist[i]][j] >= 3) table[clist[i]][j] -= 3; 
			}
			for(int j = 1; j <= 7; j++){
				if(table[clist[i]][j] == 0) continue;
				while(table[clist[i]][j] > 0){
					table[clist[i]][j]--;
					table[clist[i]][j+1]--;
					table[clist[i]][j+2]--;
				}
			}
			for(int j = 1; j <= 9; j++){
				if(table[clist[i]][j] != 0) win = false;
			}
		}

		cout << (win ? 1 : 0) << endl;
	}
	return 0;
}

Measured memory_bytes: 1220
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.StringTokenizer;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author anand.oza
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        CMultipleGift solver = new CMultipleGift();
        solver.solve(1, in, out);
        out.close();
    }

    static class CMultipleGift {
        public void solve(int testNumber, InputReader in, PrintWriter out) {
            long x = in.nextLong(), y = in.nextLong();
            long z = y / x;

            int answer = 1 + Long.bitCount(Long.highestOneBit(z) - 1);
            out.println(answer);
        }

    }

    static class InputReader {
        public BufferedReader reader;
        public StringTokenizer tokenizer;

        public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream), 32768);
            tokenizer = null;
        }

        public String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }

        public long nextLong() {
            return Long.parseLong(next());
        }

    }
}



Measured memory_bytes: 21460
import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        // Your code here!
        Scanner sc = new Scanner(System.in);
        String code = sc.next();
        String[] code_array = code.split("");
        String before = "";
        int flag = 0;
        
        for(int i = 0; i < code.length(); i++){
            
            if(i == 0){
                before = code_array[i];
                continue;
            }
            if(code_array[i].equals(before)){
                flag = 1;
            }
            before = code_array[i];
        }
        
        if(flag == 0){
            System.out.println("Good");
        }else{
            System.out.println("Bad");
        }
        
    }
}


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

public class Main {

    public static void main(final String[] args) throws Exception {
        final Scanner sc = new Scanner(System.in);
        long A;
        A = sc.nextLong();
        long B;
        B = sc.nextLong();

        final Solver solver = new Solver();
        solver.solve(A, B);
    }
}

class Solver {
    public void solve(long A, long B) {
        if (A <= 0 || A >= 10 || B <= 0 || B >= 10) {
            System.out.println(-1);
            return;
        }
        System.out.println(A * B);
    }
}



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

using namespace std;

int main(void)
{
	int l,n; cin>>n>>l;
	vector<string>data;
	string s;
	for(int i = 0; i < n; i++){
		cin>>s;
		data.push_back(s);
	}
	std::sort(data.begin(),data.end());
	
	for(int i = 0; i < n; i++){
		cout<<data[i];
	}
	cout<<endl;
	
	return 0;
}



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

using ll = long long;
using P = pair<int, int>;
using PP = pair<int, P>;
#define rep1(i,n) for (int i=1; i<=(n); i++)
#define rep0(i,n) for (int i=0; i<(n); i++)
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
#ifdef _DEBUG
string _format(string args) { string r = "", t; istringstream s(args); while (getline(s, t, ',')) r += t+":%ld "; return r + "\n"; }
#define debug(...) do { printf(_format(#__VA_ARGS__).c_str(), __VA_ARGS__); } while(0)
#define fast_ios() do {} while(0);
#else //_DEBUG
#define debug(...) do {} while(0)
#define fast_ios() do { std::ios::sync_with_stdio(false); std::cin.tie(nullptr); } while(0)
#endif //_DEBUG

int n;
int s[200000];

int popcount(int x) {
    int popcnt = 0;
    while (x != 0) {
        if (x&1) popcnt++;
        x >>= 1;
    }
    return popcnt;
}

int popcount_mod_s(int popcnt) {
    int a = 0;
    for (int j=0; j<n; j++) {
        a = ((a<<1) + s[j]) % popcnt;
    }
    return a;
}

int pow_2_mod_inc[200000];
int pow_2_mod_dec[200000];

int main() {
    fast_ios();

    cin >> n;
    string ss;
    cin >> ss;

    int popcnt_x = 0;
    for (int i=0; i<n; i++) {
        s[i] = ss[i] - '0';
        popcnt_x += s[i];
    }
    int pp = popcnt_x + 1;
    int pn = popcnt_x - 1;

    int x=0, y=0;
    rep0(j,n) {
        x = ((x<<1) + s[j]) % pp;
        if (pn) y = ((y<<1) + s[j]) % pn;
        debug(popcnt_x,x,y);
    }
    int inc=1, dec=1;
    rep0(j,n) {
        pow_2_mod_dec[j] = dec;
        pow_2_mod_inc[j] = inc;
        inc = (inc<<1) % pp;
        if (pn) dec = (dec<<1) % pn;
        debug(inc, dec);
    }

    rep0(i,n) {
        int popcnt = popcnt_x + (s[i] == 1 ? -1 : 1);
        int cnt = 0;
        if (popcnt > 0) {
            int a = ((s[i] == 1) ? (y - pow_2_mod_dec[n-1-i] + popcnt) : (x + pow_2_mod_inc[n-1-i])) % popcnt;
            cnt = 1;
            debug(a, popcnt, cnt);
            while (popcnt > 0 && a > 0) {
                popcnt = popcount(a);
                debug(a, popcnt, cnt);
                a %= popcnt;
                cnt++;
            }
        }
        cout << cnt << endl;
    }
}


Measured memory_bytes: 6060
#include<stdio.h>
#define N 105
#define INF 100000000
#define WHITE 0
#define GRAY 1
#define BLACK 2

int n,M[N][N]={};

int prim(void){
    int u,min,i,v;
    int d[N],p[N],color[N];
    for(i=0;i<n;i++){
        d[i]=INF;
        p[i]=-1;
        color[i]=WHITE;
    }
    
    d[0]=0;
    while(1){
        min=INF;
        u=-1;
        for(i=0;i<n;i++){
            if(min>d[i] && color[i]!=BLACK){
                u=i;
                min=d[i];
            }
        }
        if(u==-1)break;
        color[u]=BLACK;
        for(v=0;v<n;v++){
            if(color[v]!=BLACK && M[u][v]!=INF){
                if(d[v]>M[u][v]){
                    d[v]=M[u][v];
                    p[v]=u;
                    color[v]=GRAY;
                }
            }
        }
    }
    int sum=0;
    for(i=0;i<n;i++){
        if(p[i]!=-1)sum+=M[i][p[i]];
    }
    return sum;
}
int main(){
    int i,j,e;
    scanf("%d",&n);
    for(i=0;i<n;i++){
        for(j=0;j<n;j++){
            scanf("%d",&e);
            if(e==-1)M[i][j]=INF;
            else M[i][j]=e;
        }
    }
    printf("%d\n",prim());
    return 0;
}



Measured memory_bytes: 2040
#include <algorithm>
#include <cmath>
#include <iostream>
#include <vector>

using namespace std;

int main() {
  int64_t N, M;
  cin >> N >> M;
  int64_t res = 1;
  for (int64_t m = 1; m <= sqrt(M); ++m) {
    if (M % m) continue;
    int64_t m2 = M / m;
    if (m >= N) res = max(res, m2);
    if (m2 >= N) res = max(res, m);
  }
  cout << res << endl;
  
  return 0;
}


Measured memory_bytes: 3660
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const int N=3005,mod=998244353;
int n,s,a[N];
ll dp[N];
int main()
{
    scanf("%d%d",&n,&s);
    ll ans=0;
    for(int i=1;i<=n;i++)
    {
        int x;
        scanf("%d",&x);
        for(int j=s;j>=x;j--)
            if(j>x) (dp[j]+=dp[j-x])%=mod;
        else if(j==x) (dp[j]+=i)%=mod;
        (ans+=dp[s])%=mod;
    }
    printf("%lld\n",ans);
}


Measured memory_bytes: 256
PROGRAM A
      IMPLICIT NONE
      INTEGER :: input(3),ans
      INTEGER :: index
      
      
      read'(I1,I1,I1)', input(1),input(2),input(3)
      
      ans = 0
      DO index = 1,3
        IF(input(index)==1)THEN
        ans = ans + 1
        END IF
      END DO
      
      print'(I0)',ans
      
      END PROGRAM

Measured memory_bytes: 256
#include <algorithm>
#include <iostream>
#include <iomanip>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <unordered_map>

using namespace std;

using ll = long long;
using ld = long double;

#define REP(i, s, e) for (ll i = s; i < e; ++i)

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

    int N; cin >> N;
    vector<ll> H(N);
    REP(i, 0, N) cin >> H[i];

    int result = 0;
    int c = 0;
    REP(i, 0, N - 1)
    {
        if (H[i + 1] - H[i] <= 0)
        {
            ++c;
        }
        else
        {
            result = max(result, c);
            c = 0;
        }
    }

    result = max(result, c);

    cout << result << endl;
}


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


int main() {
  int a, N, K;
  cin >> N >> K;
  a=1;
  for(int i=0;i<N;i++)
  {
    a = min(a*2, a+K);
  }
  cout << a << endl;
  return 0;
}

Measured memory_bytes: 256
import java.util.Scanner;

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

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

    long[] csum = new long[N + 1];
    csum[1] = A[0];
    for (int i = 3; i <= N; i += 2) {
      csum[i] = csum[i - 2];
      csum[i] += A[i - 1];
    }
    long[] dp1 = new long[N + 1];
    long[] dp2 = new long[N + 1];
    for (int i = 2; i <= N; i++) {
      if (i % 2 == 0) {
        dp2[i] = Math.max(dp2[i - 2] + A[i - 1], csum[i - 1]);
      } else {
        dp1[i] = Math.max(dp1[i - 2] + A[i - 1], dp2[i - 1]);
      }
    }
    System.out.println(N % 2 == 1 ? dp1[N] : dp2[N]);
  }
}


Measured memory_bytes: 52640
N = int(input())
X = list(map(int, input().split()))

sorted_X = sorted(X)
m1, m2 = sorted_X[N//2-1: N//2+1]

if m1 == m2:
  for i in range(N):
    print(m1)
else:
  for i in range(N):
    if X[i] <= m1:
      print(m2)
    else:
      print(m1)

Measured memory_bytes: 25220
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(ll i=0; i<n; i++)
typedef long long ll;
ll mod = 1000000007;

/*
全ての高さが0になるまで、以下を繰り返す。
・数列hについて、h[i]が1以上であるような区間の数をcountとする
・h[i]--し、全値が0になるまでこれを繰り返す

122121 countは0
-> 011010
-> 
*/


void solve(){
    int n;
    cin >> n;
    int h[n+10];
    rep(i,n){
        cin >> h[i];
    }
    int count = 0;
    int ans = 0;
    int check = 1;
    
    while(check>0){
        check = 0;
        // 0 1 0 0 1 2 0 ...のような数列の正の部分の数
        if(h[0]!=0) count = 1;
        else count = 0;
        for(int i=1; i<n; i++){
            if(h[i-1]==0&&h[i]>0){
                count++;
            }
        }
        ans += count;
        //count = 0;
        rep(i,n){
            if(h[i]>=1) h[i] = h[i]-1;
        }
        rep(i,n){
            check += h[i];
        }
    }

    cout << ans << endl;
}

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

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

int main() {
  int N,K;
  cin >> N >> K;
  int l[N];
  for(int i=0;i<N;++i) cin >> l[i];
  
  sort(l,l+N,greater<int>());
  
  int snake=0;
  for(int i=0;i<K;++i) snake+=l[i];
  
  cout << snake << endl;
  
}

Measured memory_bytes: 256
#include <stdio.h>
#include <math.h>
#define N 1000000


int n, s[N], x=0;

void merge(int, int, int);
void mergeSort(int, int);
int main()
{

int i;

scanf("%d",&n);

for(i=0; i<n; i++)

scanf("%d",&s[i]);

mergeSort(0,n);

for(i=0;i<n;i++){
   printf("%d", s[i]);

    if(i!=n-1) printf(" ");
  }

  printf("\n%d\n", x);

  return 0;
}

void merge(int left, int mid, int right)
{
  int n1, n2, i, j, k, L[N], R[N];
  n1 = mid - left;
  n2 = right - mid;
  for(i=0; i<=n1-1; i++)
    L[i] = s[left + i];
  for(i=0; i<=n2-1; i++)
    R[i] = s[mid + i];
    L[n1] = INFINITY;
    R[n2] = INFINITY;
  i = 0;
  j = 0;
  for(k=left; k<=right-1; k++)
    if(L[i] <= R[j]){
     s[k] = L[i];
      i = i + 1;
      x++;
    } else {
      s[k] = R[j];
      j = j + 1;
      x++;
    }
}
void mergeSort(int left, int right)
{
  int mid;
  if(left+1 < right){
    mid = (left + right)/2;
    mergeSort(left, mid);
    mergeSort(mid, right);
    merge(left, mid, right);
   }
}

Measured memory_bytes: 5764
using System;
using System.Collections.Generic;
using System.Linq;
using static System.Console;
using static System.Math;

namespace AtCodeeeer
{
    class AtCOOOOOOOOOOOder
    {
        //いつもの
        readonly static long mod = 1000000000 + 7;
        static void Main(string[] args)
        {
            int[] nm = ReadLine().Split(' ').Select(int.Parse).ToArray();
            int n = nm[0];
            int m = nm[1];

            if (Abs(n-m) > 1)
            {
                WriteLine(0);
                return;
            }

            long ansN = 1;
            for (int i = 2; i <= n; i++)
            {
                ansN *= i;
                if (ansN > mod) ansN %= mod;
            }
            long ansM = 1;
            for (int i = 2; i <= m; i++)
            {
                ansM *= i;
                if (ansM > mod) ansM %= mod;
            }

            //本編
            if (Abs(n-m) == 0)
            {
                WriteLine((2 * ansN * ansM)%mod);
            }else
                WriteLine((ansN * ansM)%mod);


        }

    }
}

Measured memory_bytes: 13396
#include <iostream>
#include <string>
#include <algorithm>
#include <cmath>
#include <vector>
#include <set>
#include <map>
#include <numeric>

using namespace std;

using ll = long long;

#define REP(i,n) for(ll i=0;i<(ll)(n);i++)
#define REPD(i,n) for(ll i=n-1;i>=0;i--)
#define FOR(i,a,b) for(ll i=a;i<=(ll)(b);i++)
#define FORD(i,a,b) for(ll i=a;i>=(ll)(b);i--)

#define input(...) __VA_ARGS__; in(__VA_ARGS__)

#if __has_include("debugger.cpp")
  #include "debugger.cpp"
#else
void print() {
  std::cout << std::endl;
}

template <class Head, class... Tail>
void print(Head&& head, Tail&&... tail) {
  cout << head;
  if (sizeof...(tail) > 0) cout << " ";
  print(std::forward<Tail>(tail)...);
}
# endif

void in() { }

template <class Head, class... Tail>
void in(Head&& head, Tail&&... tail) {
  cin >> head;
  in(std::forward<Tail>(tail)...);
}

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

  vector<ll> table(n + 1, 0);
  table[0] = -(1ll << 60);
  REP(i, n) {
    ll index = distance(table.begin(), upper_bound(table.begin(), table.end(), -(a[i] + 1)) - 1);
    table[index + 1] = -(a[i] + 1);
  }
  table.push_back(0);
  REP(i, table.size()) {
    if (table[i] == 0) {
      print(i - 1);
      break;
    }
  }
}


Measured memory_bytes: 5636
#include <iostream>
#include <string>
#include <vector>
#include <cstdio>
#include <algorithm>
#include <array>
#include <cmath>

using namespace std;

using ll = long long int;

// GCDを計算します
template <typename NumType>
NumType calcGCD(NumType a, NumType b) {
    if (a < b) {
        NumType tmp = a;
        a = b;
        b = tmp; 
    }

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

    return b;
}

// 約数を数えます
template <typename NumType>
NumType cntDivisor(const NumType & num) {
    NumType cnt = 0;
    for(NumType i = 1; i * i <= num; ++i) {
        if(num % i == 0) {
            cnt++;
            if(i * i != num) cnt++;
        }
    }

    return cnt;
}

// [beg, end)の範囲を，添え字indexでループするfor文に置換します
#define FOR_RANGE(index, beg, end)     for (ll index = beg; index < N; ++index)

#define DEBUG(x)     std::cout << #x << " : " << x << "\n"

int min(int a, int b) {
    return (a < b) ? a : b;
}

int max(int a, int b) {
    return (a > b) ? a : b;
}

int main() {
    int n;
    int p[20];

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

    int cnt = 0;

    for (int i = 0; i < n - 2; i++) {
        int _min = min(min(p[i], p[i+1]), p[i+2]);
        int _max = max(max(p[i], p[i+1]), p[i+2]);
        if (_min != p[i+1] && _max != p[i+1]) cnt++;
    }

    cout << cnt;

    return 0;
}



Measured memory_bytes: 256
#include <iostream>
#include <cmath>
#include <algorithm>
#include <vector>
#include <set>
#include <unordered_set>
#include <queue>
#include <deque>
#include <string>
#include <sstream>
#include <iomanip>
#include <map>
#include <unordered_map>
#include <stack>
#include <cstdio>
#include <climits>
#include <tuple>
#include <ctime>
#define FOR(i,a,n) for (int i = a; i < n; i++)
#define IFOR(i,n,a) for (int i = n; i >= a; i--)
#define mp make_pair
#define full(a) a.begin(), a.end()
#define SZ(x) ((int)(x).size())
#define VI vector<int>
#define PII pair<int, int>
#define trav(a,x) for (auto& a : x)
typedef unsigned long long ull;
typedef long long ll;
typedef long double ld;
using namespace std;
const int mod = 998244353;



int main()
{
    ios::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
    int a, b, c, k; cin >> a >> b >> c >> k;
    while (k)
    {
        if (b <= a)
        {
            b <<= 1;
            k--;
            continue;
        }
        if (c <= b)
        {
            c <<= 1;
            k--;
            continue;
        }
        k--;
    }
    if (a < b && b < c)
    {
        cout << "Yes";
    }
    else
    {
        cout << "No";
    }
    return 0;
}


Measured memory_bytes: 3612
import java.util.*;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int A1 = sc.nextInt();
		int A2 = sc.nextInt();
		int A3 = sc.nextInt();
		sc.close();

		System.out.println(A1 + A2 + A3 < 22 ? "win" : "bust");
	}
}

Measured memory_bytes: 23636
#include <iostream>
#include <iomanip>
#include <algorithm>
#include <cmath>
#include <cstring>
#include <vector>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <deque>
#include <numeric>
#define debug(x)  cerr << #x << " = " << x << endl
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair <ll, ll> pll;
typedef pair <int, int> pii;

const int maxN = 1e5 + 5;
const ll INF = 1e18;
const ll MOD = 1e9 + 7;

ll gcd(ll a, ll b) {return !b ? a : gcd(b, a % b);}
ll sq(ll x) {return (x * x) % MOD;}
ll modP(ll a, ll b) {return (!b ? 1 : (sq(modP(a, b / 2)) * (b % 2 ? a : 1)) % MOD);}

map <int, int> cnt[2];
int a[maxN], mx[4];

int main(){
	ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
	int n; cin >> n;
	for (int i = 0; i < n; i++) cin >> a[i];
	for (int i = 0; i < n; i += 2) cnt[0][a[i]]++;
	for (int i = 1; i < n; i += 2) cnt[1][a[i]]++;
	for (int i = 0; i < maxN; i++){
		if (cnt[0][i] >= cnt[0][mx[0]]){
			mx[0] = i;
		}
	}
	for (int i = 0; i < maxN; i++){
		if (cnt[1][i] >= cnt[1][mx[1]]){
			mx[1] = i;
		}
	}
	for (int i = 0; i < maxN; i++){
		if (i != mx[0] && cnt[0][i] >= cnt[0][mx[2]]){
			mx[2] = i;
		}
	}
	for (int i = 0; i < maxN; i++){
		if (i != mx[1] && cnt[1][i] >= cnt[1][mx[3]]){
			mx[3] = i;
		}
	}
	if (mx[0] != mx[1]){
		cout << n - (cnt[0][mx[0]] + cnt[1][mx[1]]) << endl;
	}
	else{
		cout << n - max(cnt[0][mx[0]] + cnt[1][mx[3]], cnt[1][mx[1]] + cnt[0][mx[2]]) << endl;
	}
	return 0;
}
 



Measured memory_bytes: 9984
#include <iostream>

using namespace std;
#define ll long long
int main() 
{
 
	ll int n,W;
	cin>>n>>W;
	ll int w[n+1] ,v[n+1];
	w[0]=0;
	v[0]=0;
	ll int maxi[n+1][W+1];
	for(ll int i=0;i<=W;i++)
      	maxi[0][i]=0;
	for(ll int i=0;i<=n;i++)
	   maxi[i][0]=0;
	for(int i=1;i<=n;i++)
	{
	    cin>>w[i]>>v[i];
	}
	  
	for(ll int j=1;j<=n;j++)
	{
	   // max[i]=INT_MAX;
	    for(ll int i=1;i<=W;i++)
	    {
	        maxi[j][i]=maxi[j-1][i];
	        if(i>=w[j])
	        {
	            maxi[j][i]=max(maxi[j][i],v[j]+maxi[j-1][i-w[j]]);
	       }
	   }
	}
	cout<<maxi[n][W];
}


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

typedef long long ll;

// static const int MAX = 1e6;
// static const int NIL = -1;
// static const ll INF = 1<<21;
// static const ll MOD = 1e9 + 7;

// bool compPair(const pair<int, int>& arg1, const pair<int, int>& arg2) {
//     return arg1.first > arg2.first;
// }

int main(void) {
    int n, m;
    cin >> n >> m;

    vector<int> a(n);
    int sum=0;
    for(int i=0;i<n;i++) {
        cin >> a.at(i);
        sum += a.at(i);
    }

    sort(a.begin(), a.end(), greater<int>());

    if(4*m*a.at(m-1)>=sum) cout << "Yes" << endl;
    else cout << "No" << endl;
    
    return 0;
}


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

int compare_int_x(const void *a, const void *b);
int compare_int_y(const void *a, const void *b);

typedef struct {
	int x;
    int y;
} POINT;

int main(void){
	int N;
    POINT point[500000];
    int min_distance = 0, distance;
    int i;
	
	scanf("%d", &N);
    for(i = 0; i < N; i++){
        scanf("%d %d", &point[i].x, &point[i].y);
    }

    qsort(point, N, sizeof(POINT), compare_int_x);
	for(i = 0; i < N - 1; i++){
        distance = (point[i].x - point[i + 1].x) * (point[i].x - point[i + 1].x) + (point[i].y - point[i + 1].y) * (point[i].y - point[i + 1].y);
        if(min_distance > distance || i == 0){
             min_distance = distance;
        }
	}

    qsort(point, N, sizeof(POINT), compare_int_y);
	for(i = 0; i < N - 1; i++){
        distance = (point[i].x - point[i + 1].x) * (point[i].x - point[i + 1].x) + (point[i].y - point[i + 1].y) * (point[i].y - point[i + 1].y);
        if(min_distance > distance){
             min_distance = distance;
        }
	}

    printf("%d\n", min_distance);

	return 0;
}

int compare_int_x(const void *a, const void *b){
    return ((POINT*)a)->x - ((POINT*)b)->x;
}

int compare_int_y(const void *a, const void *b){
    return ((POINT*)a)->y - ((POINT*)b)->y;
}


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

using namespace std;

typedef long long ll;
typedef pair<ll, ll> pll;


const ll LongINF=1e13+7;
const int INF=1e9+7;
const int dx[]={0,1,0,-1};
const int dy[]={1,0,-1,0};

template<class T> inline bool chmin(T& a, T b) {if (a > b) {a = b;return true;}return false;}
template<class T> inline bool chmax(T& a, T b) {if (a < b) {a = b;return true;}return false;}
template <class T, class Y>T GCD(T a, Y b){if(a<b){int c=a;a=b;b=c;}if (a % b == 0){return b;}return GCD(b, a % b);}
void clear(queue<pair<int, int>> &q){queue<pair<int, int>> empty;swap(q, empty);} //queueの中身の型は適時変更を忘れない

#define REP(i,a,b) for(int i=(a);i<(b);i++)
#define rep(i,n) REP(i,0,n)
#define pb push_back
#define rv reverse
#define ALL(a) (a).begin(),(a).end()


int main(){
    int N,M;
    cin>>N>>M;
    vector<int> s;
    map<int,int>e;
    rep(i,M){
        int a,b;
        cin>>a>>b;
        if(a==1)s.pb(b);
        else if(b==N)e[a]=1;
    }
    for(auto x:s){
        if(e[x]){
                cout<<"POSSIBLE"<<endl;
                return 0;
        }
    }
    cout<<"IMPOSSIBLE"<<endl;
    return 0;

    return 0;
}

//a=97,z=122

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

string str[4] = {"dream", "dreamer", "erase", "eraser"};

int main() {
    string S;
    cin >> S;

    reverse(S.begin(), S.end());
    for (int i = 0; i < 4; ++i) reverse(str[i].begin(), str[i].end());

    bool flg1 = true;
    for (int i = 0; i < S.size();) {
        bool flg2 = false;
        for (int j = 0; j < 4; ++j) {
            string d = str[j];
            if (S.substr(i, d.size()) == d) { 
                flg2 = true;
                i += d.size(); 
            }
        }
        if (!flg2) {
            flg1 = false;
            break;
        }
    }

    if (flg1) cout << "YES" << endl;
    else cout << "NO" << endl;
}


Measured memory_bytes: 512
#include <stdio.h>


int main()
{
	int r, c, i, j, data[150][150], sum1 = 0, sum2 = 0;
	scanf("%d%d", &r, &c);
	for (i = 0; i < r; i++) {
		for (j = 0; j < c; j++) {
			scanf("%d", &data[i][j]);
			sum1 += data[i][j];
		}
		data[i][c] = sum1;
		sum1 = 0;
	}
	for (j = 0; j <= c; j++) {
		for (i = 0; i < r; i++) {
			sum2 += data[i][j];
		}
		data[r][j] = sum2;
		sum2 = 0;
	}
	for (i = 0; i <= r; i++) {
		for (j = 0; j < c; j++) {
			printf("%d ", data[i][j]);
		}
		printf("%d\n", data[i][c]);
	}

    return 0;
}

Measured memory_bytes: 664
#include <iostream>
#include <stdio.h>
#include <vector>
#include <algorithm>
#include <cmath>
#include <string>
#include <map>

using namespace std;
typedef long long ll;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)

ll gcd(ll x,ll y){
    if(x<y) swap(x,y);
    //xの方が常に大きい
    ll r;
    while(y>0){
        r=x%y;
        x=y;
        y=r;
    }
    return x;
}

int main() {
  int A[1010101];
  int num[1010101] = {};
  int N,i,j,x;
  cin >> N;
  int g=0;
  rep(i, N) {
    cin >> A[i];
    g = gcd(g, A[i]);
    num[A[i]]++;
  }

  for(i=2;i<=1000000;i++) {
		x=0;
		for(j=i;j<=1000000;j+=i) x+=num[j];
		if(x>=2) break;
	}

	if(i==1000001) {
		cout<<"pairwise coprime"<<endl;
		return 0;
	}

	if(g==1) {
		cout<<"setwise coprime"<<endl;
	}
	else {
		cout<<"not coprime"<<endl;
	}
  return 0;
}


Measured memory_bytes: 11440
A, B = map(int, input().split())
import math
a1 = math.ceil(A/0.08)
a2 = math.floor((A+1)/0.08)
b1 = math.ceil(B/0.1)
b2 = math.floor((B+1)/0.1)
aa = list(range(a1, a2+1))
bb = list(range(b1, b2+1))
ab = set(aa)&set(bb)
ab = list(ab)
ab.sort()
if len(ab)>1:
  print(ab[0])
else:
  print(-1)

Measured memory_bytes: 3064
#include "bits/stdc++.h"
using namespace std;
#define rep(i,n)for(int i=0;i<(int)(n);i++)
//#define PI 3.141592653589793
//vector < vector<int>>a(0, vector<int>(0));二次元配列宣言


int main()
{
	
	int x;
	cin >> x;
	if (x >= 30)
	{
		cout << "Yes" << endl;
	}
	else
	{
		cout << "No" << endl;
	}
}


	
	

	
	
/**/
/*#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <math.h>

#define PI 3.141592653589793

int main(void) {
	return 0;
}
*/

Measured memory_bytes: 3620
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        let mut next = || { iter.next().unwrap() };
        input_inner!{next, $($r)*}
    };
    ($($r:tt)*) => {
        let stdin = std::io::stdin();
        let mut bytes = std::io::Read::bytes(std::io::BufReader::new(stdin.lock()));
        let mut next = move || -> String {
            bytes
                .by_ref()
                .map(|r| r.unwrap() as char)
                .skip_while(|c| c.is_whitespace())
                .take_while(|c| !c.is_whitespace())
                .collect()
        };
        input_inner!{next, $($r)*}
    };
}

macro_rules! input_inner {
    ($next:expr) => {};
    ($next:expr, ) => {};

    ($next:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($next, $t);
        input_inner!{$next $($r)*}
    };

    ($next:expr, mut $var:ident : $t:tt $($r:tt)*) => {
        let mut $var = read_value!($next, $t);
        input_inner!{$next $($r)*}
    };
}

macro_rules! read_value {
    ($next:expr, ( $($t:tt),* )) => {
        ( $(read_value!($next, $t)),* )
    };

    ($next:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($next, $t)).collect::<Vec<_>>()
    };

    ($next:expr, [ $t:tt ]) => {
        {
            let len = read_value!($next, usize);
            (0..len).map(|_| read_value!($next, $t)).collect::<Vec<_>>()
        }
    };

    ($next:expr, chars) => {
        read_value!($next, String).chars().collect::<Vec<char>>()
    };

    ($next:expr, usize1) => {
        read_value!($next, usize) - 1
    };

    ($next:expr, $t:ty) => {
        $next().parse::<$t>().expect("Parse error")
    };
}

#[allow(unused_imports)]
use std::cmp::{min, max};

fn main() {
    input!{
        n: usize,
        k: usize
    }
    println!("{}", min(n % k, k - n % k));
}


Measured memory_bytes: 4352
#include<bits/stdc++.h>
using namespace std;
int main(){
	string s;
	cin>>s;
	for(int i=0;i<s.size()-1;i++){
		if(s[i]=='A'&&s[i+1]=='C'){
			cout<<"Yes"<<endl;
			return 0;
		}
	}
	cout<<"No"<<endl;
}


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

int n;
const int N = 1e5+7;
int A[N];

LL solve() {
    stack<int> S;
    LL sum = 0, ans = 0;
    for( int i = 1; i <= n; ++i ) {
        while( !S.empty() && A[S.top()] < A[i] ) {
            int r = S.top(); S.pop();
            int l;
            if( S.empty() ) {
                l = 1;
            } else {
                l = S.top() + 1;
            }
            sum -= 1LL * ( r-l+1 ) * A[r];
        }
        int l;
        if( S.empty() ) {
            l = 1;
        } else {
            l = S.top() + 1;
        }
        sum += 1LL * ( i-l+1 ) * A[i];
        ans += sum;
        S.push( i );
    }
    return ans;
}

int main() {
    int x, y;
    cin>>x>>y;
    cout<<x+y/2<<endl;
}


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

// エイリアス
using  ll = long signed long;
using ull = long unsigned long;
using  ld = long double;
using   P = pair<int, int>;
using llP = pair<ll, ll>;
using DoP = pair<double, double>;

// 汎用マクロ
#define ALL(a) (a).begin(), (a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define rep(i, n) for (int i = 0; i < n; ++i)
#define FOREACH(i,q) for (auto &i : q)
#define UNIQUE(v) do { sort((v).begin(), (v).end()); (v).erase(unique((v).begin(), (v).end()), (v).end()); } while (false)
#define SZ(x) ((int)(x).size())
template <class T>inline bool chmin(T &a, const T b) {if (a > b) { a = b; return true;} return false;}
template <class T>inline bool chmax(T &a, const T b) {if (a < b) { a = b; return true;} return false;}
template <class T>inline void line_out(const vector<T> vec) {int n = SZ(vec); rep(i, n) { cout << vec[i]; if(i < n-1) cout << " ";}cout << endl;}
const int di[] = {0, 1, 0, -1, 1, 1, -1, -1};
const int dj[] = {1, 0, -1, 0, 1, -1, 1, -1};
const int INF = 1 << 28;
const ll INF64 = 1ll << 60;
const int mod = 1000000007;
//const int mod = 998244353;
struct mint
{
  ll x; // typedef long long ll;
  mint(ll x = 0) : x((x % mod + mod) % mod) {}
  mint operator-() const { return mint(-x); }
  mint &operator+=(const mint a)
  {
    if ((x += a.x) >= mod)
      x -= mod;
    return *this;
  }
  mint &operator-=(const mint a)
  {
    if ((x += mod - a.x) >= mod)
      x -= mod;
    return *this;
  }
  mint &operator*=(const mint a)
  {
    (x *= a.x) %= mod;
    return *this;
  }
  mint operator+(const mint a) const
  {
    mint res(*this);
    return res += a;
  }
  mint operator-(const mint a) const
  {
    mint res(*this);
    return res -= a;
  }
  mint &operator++()
  {
    if ((x += 1) >= mod)
      x -= mod;
    return *this;
  }
  mint &operator--()
  {
    if ((x += mod - 1) >= mod)
      x -= mod;
    return *this;
  }
  mint operator*(const mint a) const
  {
    mint res(*this);
    return res *= a;
  }
  mint pow(ll t) const
  {
    if (!t)
      return 1;
    mint a = pow(t >> 1);
    a *= a;
    if (t & 1)
      a *= *this;
    return a;
  }

  // for prime mod
  mint inv() const
  {
    return pow(mod - 2);
  }
  mint &operator/=(const mint a)
  {
    return (*this) *= a.inv();
  }
  mint operator/(const mint a) const
  {
    mint res(*this);
    return res /= a;
  }
};


int main()
{
  int r, g, b, n;
  cin >> r >> g >> b >> n;
  int ans = 0;
  for(int i = 0; i*r <= n; ++i) {
    for(int j = 0; i*r+j*g <= n; ++j) {
      if((n-i*r-j*g)%b==0) ++ans;
    }
  }
  cout << ans << endl;
}


Measured memory_bytes: 3576