akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
#define REP(i,n) for (int i=0;i<(n);i++)
#define FOR(i,s,e) for (int i=s;i<(e);i++)
#define All(v) (v).begin(),(v).end()
#define mp(a,b) make_pair(a,b)
#define pb(a) push_back(a)
using namespace std;
typedef long long llint;
typedef pair<int, int> P;
const int MOD = (int)1e9 + 7;
const int INF = 999999999;

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    int ans = 0;
    REP(i, 3){
        char x;
        cin >> x;
        if(x == '1') ans++;
    }
    cout << ans << "\n";
    return 0;
}

Measured memory_bytes: 256
pub fn read<T: std::str::FromStr>() -> T {
    let mut s = String::new();
    std::io::stdin().read_line(&mut s).ok();
    s.trim().parse().ok().unwrap()
}

pub fn read_vec<T: std::str::FromStr>() -> Vec<T> {
    read::<String>()
        .split_whitespace()
        .map(|e| e.parse().ok().unwrap())
        .collect()
}

pub fn read_vec2<T: std::str::FromStr>(n: usize) -> Vec<Vec<T>> {
    (0..n).map(|_| read_vec()).collect()
}

pub fn read_col<T: std::str::FromStr>(n: usize) -> Vec<T> {
    (0..n).map(|_| read()).collect()
}

const R: u64 = 1000000007;

fn pow(n: u64, r: u64) -> u64 {
    let mut ret = 1;
    if r > 0 {
        ret = pow(n, r / 2);
        ret = ret * ret % R;
        if r % 2 == 1 {
            ret = ret * n % R;
        }
    }
    ret
}

fn main() {
    let nab: Vec<u64> = read_vec();
    let n = nab[0];
    let a = nab[1];
    let b = nab[2];

    let mut ans = pow(2, n) - 1;

    let mut t1 = 1;
    for i in n - a + 1..n + 1 {
        t1 = (t1 * i) % R;
    }
    for i in 1..a + 1 {
        t1 = (t1 * pow(i, R - 2)) % R;
    }

    let mut t2 = 1;
    for i in n - b + 1..n + 1 {
        t2 = (t2 * i) % R;
    }
    for i in 1..b + 1 {
        t2 = (t2 * pow(i, R - 2)) % R;
    }

    ans = (ans + 2 * R - t1 - t2) % R;

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


Measured memory_bytes: 4352
#define _GLIBCXX_DEBUG //エラーを出すためのおまじない
#include <bits/stdc++.h>
//#include <cstdlib>  // abs() for integer
#include <cmath>    // abs() for float, and fabs()
#include <math.h>
using namespace std;
#define coYES cout << "YES" << endl
#define coNO cout << "NO" << endl
#define coYes cout << "Yes" << endl
#define coNo cout << "No" << endl
#define coyes cout << "yes" << endl
#define cono cout << "no" << endl
#define rep(i, n) for (int i = 0; i < (int)(n); i++)

int main() {
  string s;
  cin >> s;
  vector<string> words(4);
  words.at(0) = "dream";
  words.at(1) = "dreamer";
  words.at(2) = "erase";
  words.at(3) = "eraser";
  reverse(s.begin(), s.end());
  rep(i, 4) {
    reverse(words.at(i).begin(), words.at(i).end());
  }
  int size = s.size();
  string cal;
  int count = 0;
  for (int i = 0; i < size; i++) {
    cal += s.at(i);
    rep(j, 4) {
      if ((string)cal == words.at(j)) {
        cal = "";
      }
    }
    //cout << cal << endl;
  }
  if (cal == "") {
    coYES;
  }
  else {
    coNO;
  }
}


Measured memory_bytes: 3824
import java.util.*

fun main(args: Array<String>) {
  val sc = Scanner(System.`in`)
  val n = sc.nextInt()
  val a = (1..n).map { sc.nextInt() }


  var max = a[0]
  var ans = 0L
  for (i in 1 until n) {
    val ai = a[i]
    if (ai < max) {
      ans += max - ai
    }
    if (ai > max) {
      max = ai
    }
  }

  println(ans)

}


Measured memory_bytes: 66880
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for(long long i = 0;i < n;i++)
#define repr(i, n) for(int i = n;i >= 0;i--)
#define For(i, s, e) for(int i = s;i <= e;i++)
#define Sort(v, n) sort(v, v+n);
#define VSort(v) sort(v.begin(), v.end());
#define ll long long
#define pb(a) push_back(a)
#define INF 999999999
#define cY cout<<"Yes";
#define cN cout<<"No";
#define cA(a) cout<<a;
const ll MOD = 1000000007;

int main() {
    string s;cin>>s;
    if(s.size()<26) {
        int a[26];
        rep(i,26) {
            a[i] = 0;
        }
        rep(i,s.size()) {
            a[s[i]-'a']++;
        }
        rep(i,26) {
            if(a[i] == 0) {
                cout << s;
                printf("%c",'a' + i);
                return 0;
            }
        }
    } else if (s == "zyxwvutsrqponmlkjihgfedcba"){
        cout << -1;
    } else {
        int left;
        for(int i = 24;i>=0;i--) {
            if(s[i] <s[i+1]) {
                left = i+1;
                i = -1;
            }
        }
        int a[26];
        rep(i,26) {
            a[i] = 0;
        }
        for(int i = left;i<26;i++) {
            if(s[left-1]<s[i])a[s[i]-'a']++;
        }
        rep(i,left-1) {
            cout << s[i];
        }
        rep(i,26) {
            if(a[i] != 0) {
                printf("%c",'a'+i);
                return 0;
            }
        }
    }
}


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

typedef long long ll;

int a, b, c;
int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cin >> a >> b >> c;
    a -= b;
    cout << max(0, c - a) << endl;

    return 0;
}



Measured memory_bytes: 3644
package main

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

var stdInScanner = bufio.NewScanner(os.Stdin)

func nextString() string {
	stdInScanner.Scan()
	return stdInScanner.Text()
}

func main() {
	stdInScanner.Split(bufio.ScanWords)

	S := nextString()

	for i := 0; i < len(S)/4; i++ {
		if S[i] != S[len(S)/2-i-1] {
			fmt.Println("No")
			return
		}
	}
	for i := len(S)/2 - 1; i < len(S); i++ {
		if S[i] != S[len(S)-i-1] {
			fmt.Println("No")
			return
		}
	}
	fmt.Println("Yes")
}


Measured memory_bytes: 640
n = int(input())
a = list(map(int, input().split()))
A = sorted(a, reverse = True)

ali = []
bob = []
for i in range(n):
    if i % 2 == 0:
        ali.append(A[i])
    else:
        bob.append(A[i])
        
print(sum(ali) - sum(bob))

Measured memory_bytes: 61964
#include<bits/stdc++.h>
#define io ios_base::sync_with_stdio(false),cin.tie(0),cout.tie(0)
#define PI atan(1)*4
typedef long long int ll;
using namespace std;
int main(){
	io;
	int a,b,c,d;
	cin >> a >> b >> c >> d; 
	while(a > 0 && c > 0){
		c -= b;
		if(c <= 0){
			break;
		}
		a -= d;
		if(a <= 0)
			break;
		//cout << a << " " << c << endl;
	}
	if(c <= 0){
		cout << "Yes";
	}
	else
		cout << "No";
	return 0;
} 

Measured memory_bytes: 3616
#include <bits/stdc++.h>
 
#ifndef LOCAL_
#define fprintf if( false ) fprintf
#endif // LOCAL_
#define dumpi(x1) fprintf(stderr, "#%s.%d (%s) = (%d)\n", __func__, __LINE__, #x1, x1);
#define dumpii(x1, x2) fprintf(stderr, "#%s.%d (%s, %s) = (%d, %d)\n", __func__, __LINE__, #x1, #x2, x1, x2);
#define dumpiii(x1, x2, x3) fprintf(stderr, "#%s.%d (%s, %s, %s) = (%d, %d, %d)\n", __func__, __LINE__, #x1, #x2, #x3, x1, x2, x3);
#define dumpl(x1) fprintf(stderr, "#%s.%d (%s) = (%ld)\n", __func__, __LINE__, #x1, x1);
#define dumpll(x1, x2) fprintf(stderr, "#%s.%d (%s, %s) = (%ld, %ld)\n", __func__, __LINE__, #x1, #x2, x1, x2);
#define dumpd(x1) fprintf(stderr, "#%s.%d (%s) = (%lf)\n", __func__, __LINE__, #x1, x1);
#define dumpdd(x1, x2) fprintf(stderr, "#%s.%d (%s, %s) = (%lf, %lf)\n", __func__, __LINE__, #x1, #x2, x1, x2);
#define loop for(;;)
 
struct S002 {
  int n;
  S002& operator > (long& x) {
    n = x;
    return *this;
  }
  S002& operator > (long&& x) {
    n = x;
    return *this;
  }
  S002& operator >= (long& x) {
    if( scanf("%ld", &x) <= 0 ) exit(0);
    return *this;
  }
  S002& operator >= (double& x) {
    if( scanf("%lf", &x) <= 0 ) exit(0);
    return *this;
  }
  S002& operator >= (std::string& s) {
    if( not (std::cin >> s) ) exit(0);
    return *this;
  }
  template<typename a>
  S002& operator >= (std::vector<a>& v) {
    v.resize(n);
    for(long i = 0; i < n; ++i) {
      *this >= v[i];
    }
    return *this;
  }
  template<typename a, std::size_t s>
  S002& operator >= (std::array<a, s>& x) {
    for(long i = 0; i < (long)s; ++i) {
      *this >= x[i];
    }
    return *this;
  }
};

struct Solver {
  std::vector<long> xs;
  Solver() {
    S002 r;
    r >3>= xs;
  }
  void solve() {
    std::sort(xs.begin(), xs.end());
    puts(xs[0] + xs[1] == xs[2] ? "Yes" : "No");
  }
};
 
int main() {
  for(;;) std::unique_ptr<Solver>(new Solver())->solve();
  return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define LL long long
using namespace std;
LL f[3005][3005];
const int mod = 998244353;
int main(){
    ios::sync_with_stdio(false);
    int a, b, c, d; cin>>a>>b>>c>>d;
    f[a][b] = 1;
    for(int i = a; i <= c; i++){
        for(int j = b; j <= d; j++){
            if(i == a && j == b) continue;
            f[i][j] = f[i][j - 1] * i % mod + f[i - 1][j] * j % mod - f[i - 1][j - 1] * (i - 1) % mod * (j - 1) %mod + mod;
            f[i][j] %= mod;
        }
    }
    cout<<f[c][d];
    return 0;
}

Measured memory_bytes: 74088
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define REP(i,n) for(ll i = 0; i<(ll)(n); i++)
#define REPS(i,n) for (ll i = 1; i<=(ll)(n); i++)
#define REPD(i,n) for(ll i=(ll)(n)-1;i>=0;i--)
#define FOR(i,a,b) for(ll i=(a);i<=(b);i++)
#define FORD(i,a,b) for(ll i=(a);i>=(b);i--)
#define pb push_back
#define MOD 1000000007
#define MOD2 998244353
#define PI 3.141592653
#define INF 100000000000000

int main(){
    ll n, m, a, b; cin >> n >> m;
    vector<vector<ll>> conn(n);
    vector<ll> ansl(n,-1);
    vector<ll> ansr(n,-1);
    REP(i,m){
        cin >> a >> b;
        conn[a-1].pb(b-1);
        conn[b-1].pb(a-1);
    }
    priority_queue<vector<ll>, vector<vector<ll>>, greater<vector<ll>>> q;
    ansl[0]=0;
    ansr[0]=0;
    q.push({0,0});
    while(q.size()>0){
        ll nowl = q.top().at(0);
        ll nowat = q.top().at(1);
        ll len = conn[nowat].size();
        REP(i,len){
            if (ansl[conn[nowat][i]]==-1){
                ansl[conn[nowat][i]]=nowl+1;
                ansr[conn[nowat][i]]=nowat;
                q.push({nowl+1,conn[nowat][i]});
            }
        }
        q.pop();
    }
    bool jud = true;
    REP(i,n) if (ansr[i]==-1) {
        jud = false;
    }
    if (jud){
        cout << "Yes" << endl;
        FOR(i,1,n-1) cout << ansr[i]+1 << endl;
    }
    else{
        cout << "No" << endl;
    }
    
}

Measured memory_bytes: 18028
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
using namespace std;
using ll = long long;
using P = pair<int, int>;

int main()
{
  string s, t;
  cin >> s >> t;
  sort(s.begin(), s.end());
  sort(t.begin(), t.end());
  reverse(t.begin(), t.end());
  if (s < t)
  {
    cout << "Yes" << endl;
  }
  else
    cout << "No" << endl;
  return 0;
}

Measured memory_bytes: 3620
using System;

public class Program
{
    static void Main(string[] args)
    {
        var input = Console.ReadLine();
        var values = input.Split(' ');
        int[] numbers = new int[values.Length];

        int n = 0;
        foreach (var value in values)
        {
            numbers[n] = int.Parse(value);
            n++;
        }

        int W = numbers[0], H = numbers[1], x = numbers[2], y = numbers[3], r = numbers[4];

        if(x>=r && x<=W-r && y>=r && y<=H-r)
        {
            Console.WriteLine("Yes");
        }else{
            Console.WriteLine("No");
        }
    }
}

Measured memory_bytes: 5312
#include <bits/stdc++.h>
#define REP(i,k,n) for(int(i)=(k);(i)<(n);++(i))
#define ALL(x) (x).begin(),(x).end()
#define chmin(x,v) x = min(x, v)
#define chmax(x,v) x = max(x, v)
using namespace std;
typedef long long ll;

int X,Y,Z,K;
vector<ll> A,B,C;

int main()
{
  cin >> X >> Y >> Z >> K;
  A.resize(X);
  B.resize(Y);
  C.resize(Z);
  REP(i,0,X) cin >> A[i];
  REP(i,0,Y) cin >> B[i];
  REP(i,0,Z) cin >> C[i];

  sort(ALL(A), greater<>());
  sort(ALL(B), greater<>());
  sort(ALL(C), greater<>());

  int L = ceil(cbrt(K)) * 3; // cube root
  vector<ll> S;  // sum
  REP(i,0,min(L,X)) REP(j,0,min(L,Y)) REP(k,0,min(L,Z)) {
    S.push_back(A[i] + B[j] + C[k]);
  }
  // どれか1つだけ小さいのを許す
  REP(i,min(L,X),X) REP(j,0,min(L,Y)) REP(k,0,min(L,Z)) {
    S.push_back(A[i] + B[j] + C[k]);
  }
  REP(i,0,min(L,X)) REP(j,min(L,Y),Y) REP(k,0,min(L,Z)) {
    S.push_back(A[i] + B[j] + C[k]);
  }
  REP(i,0,min(L,X)) REP(j,0,min(L,Y)) REP(k,min(L,Z),Z) {
    S.push_back(A[i] + B[j] + C[k]);
  }
  sort(ALL(S), greater<>());

  REP(i,0,K) cout << S[i] << endl;

  return 0;
}


Measured memory_bytes: 67940
#include<bits/stdc++.h>
using namespace std;
int main(){
int N; cin >> N;
  vector<int> A;
  for(int i = 0; i < N; i++){ int a; cin >> a; A.push_back(a);}

  vector<int> ans;
  while(!A.empty() ){
    vector<int> vec;
    for(int j = 0; j < (int) A.size(); j++){
      if(A[j] == j+1){ vec.push_back(j); }}
    if(vec.empty()){ break;}
      int itr = vec.back();
      ans.push_back(A[itr]);
      A.erase( A.begin() + itr);
  }
  reverse(ans.begin(),ans.end());
 
  if( !A.empty()){ cout << -1 << endl;}
  else{ for(int i = 0; i < (int) ans.size(); i++){ cout << ans[i] << endl;}}
  cout << endl; return 0;}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
 
int main() {
  string s;
  cin >> s;
 
  for (int tmp = 0; tmp < (1 << 3); tmp++) {
    bitset<3> bs(tmp);
 
    int sum = s.at(0) - '0';
    string formula = to_string(sum);
    for (int i = 0; i < (int)s.size() - 1; i++) {
      int n = s.at(i + 1) - '0';
      string sign;
 
      // 加算
      if (bs.test(i) == 1) {
        sum += n;
        sign = "+";
      // 減算
      } else {
        sum -= n;
        sign = "-";
      }
      formula += sign + to_string(n);
    }
 
    if (sum == 7) {
      cout << formula << "=7" << endl;
      return 0;
    }
  }
 
  return 0;
}

Measured memory_bytes: 3668
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<ll> vll;
typedef pair<ll, ll> pll;
typedef vector<pll> vpll;
typedef string str;
static const long long INF = 1LL<<59;
static const long long MOD = (ll)1e9+7;

#define endl "\n"
#define fast_io ios_base::sync_with_stdio(false);cin.tie(NULL)
#define REP(i, n) for(ll i=0;i<n;i++)
#define SZ(v) (ll)((v).size())
#define WHOLE(v) (v).begin(), (v).end()
#define ASC(v) sort((v).begin(), (v).end())
#define DESC(v) sort((v).rbegin(), (v).rend())
#define INV(v) reverse((v).begin(), (v).end())
#define FOLDL(src, dst, lambda) partial_sum((src).begin(), (src).end(), (dst).begin(), lambda)
#define FOLDR(src, dst, lambda) INV(src);partial_sum((src).begin(), (src).end(), (dst).begin(), lambda);INV(dst)
#define CUMSUML(src, dst) FOLDL(src, dst, [](auto a, auto b) {return a+b;})
#define CUMSUMR(src, dst) FOLDR(src, dst, [](auto a, auto b) {return a+b;})
#define ACCUM(v, d0, lambda) accumulate((v).begin(), (v).end(), d0, lambda)
#define SUM(v, d0) ACCUM(v, d0, [](auto a, auto b) {return a+b;})
#define ERASE(v, i) v.erase(v.begin() + i)
#define UNIQ(v) ASC(v);v.erase(unique(v.begin(), v.end()), v.end())

template <typename T>void debug(T t) {cerr << t << endl;}
template <typename T, typename ...Args>void debug(T t, Args ...args) {cerr << t << " ";debug(args...);}
template <typename T>void out(T t) {cout << t << endl;}
template <typename T, typename ...Args>void out(T t, Args ...args) {cout << t << " ";out(args...);}

void solve() {
    ll A, P;
    cin >> A >> P;
    ll p = 3 * A + P;
    out(p/2);
}

int main() {
    fast_io;
    cout << setprecision(20) << fixed;
    solve();
    return 0;
}

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

const int N=2e5+10;

ll n,a[N],ans;


int main(){
	cin>>n;
	for(ll i=0;i<n;i++)
		scanf("%lld",&a[i]);
	sort(a,a+n,greater<ll>());
	ans=a[0]; 
	for(ll i=2;i<=n-1;i++){
		ans+=a[i/2];
	}
	cout<<ans<<endl;
	return 0;
}

Measured memory_bytes: 5248
/*
*/

#pragma GCC optimize("O3")
#define _CRT_SECURE_NO_WARNINGS
#include <fstream>
#include <iostream>
#include <string>
#include <complex>
#include <math.h>
#include <set>
#include <vector>
#include <map>
#include <queue>
#include <stdio.h>
#include <stack>
#include <algorithm>
#include <list>
#include <ctime>

#include <memory.h>
#include <assert.h>

#define y0 sdkfaslhagaklsldk

#define y1 aasdfasdfasdf
#define yn askfhwqriuperikldjk
#define j1 assdgsdgasghsf
#define tm sdfjahlfasfh
#define lr asgasgash
#define norm asdfasdgasdgsd
#define have adsgagshdshfhds
#define ends asdgahhfdsfshdshfd

#define eps 1e-11
#define M_PI 3.141592653589793
#define bsize 512

#define ldouble long double
using namespace std;

#define bs 1000000007
const int N = 200031;

int cnt,ans,ar[N];
int n;

int main(){
	//freopen("tree.in","r",stdin);
	//freopen("tree.out","w",stdout);
	//freopen("input.txt", "r", stdin);
	//freopen("out.txt", "w", stdout);
	ios_base::sync_with_stdio(0);
	cin.tie(0);

	cin>>n;
	for (int i=1;i<=n;i++)
	{
		cin>>ar[i];
		if (ar[i]==i)
		{
			cnt++;
		}
		else
		{
			if (cnt)
				ans+=cnt/2+cnt%2;
			cnt=0;
		}
	}

	ans+=cnt/2+cnt%2;

	cout<<ans<<endl;

	cin.get(); cin.get();
	return 0;
}


Measured memory_bytes: 640
x,y,z,w,X,Y,Z,W;main(n){for(;scanf("%d",&n)*n;)for(;n--;printf("%d %d %d %d\n",x*X-y*Y-z*Z-w*W,x*Y+y*X+z*W-w*Z,x*Z-y*W+z*X+w*Y,x*W+y*Z-z*Y+w*X))scanf("%d%d%d%d%d%d%d%d",&x,&y,&z,&w,&X,&Y,&Z,&W);}

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

int main() {
  string s; cin >> s;
  int ans = 0;
  for (int start_pos = 0; start_pos < s.size(); ++start_pos) {
    for (int s_len = 1; s_len <= s.size() - start_pos; ++s_len) {
      string cutted_str = s.substr(start_pos, s_len);
      bool acgt_flg = true;
      
      for (int str_i = 0; str_i < cutted_str.size(); ++str_i) {
        if (cutted_str[str_i] != 'A' && cutted_str[str_i] != 'C' && cutted_str[str_i] != 'G' && cutted_str[str_i] != 'T') {
          acgt_flg = false;
          break;
        }
      }
      
      if (acgt_flg) ans = max(ans, (int) cutted_str.size());
    }
  }
  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <typeinfo>
#include <cxxabi.h>
#ifdef LOCAL
  #include "dbgtoki.hpp"
  #define DUMP(i) DEB dump((string)TOSTRING(i), demangle(typeid(i).name()), __LINE__ , i)  
#else
  #define DUMP(i)  
#endif

#define GETTYPE(i) 
#define TOSTRING(x) #x
#define REP(i,n) for(int i=0;i<(n);i++)
#define FOR(i,a,b) for(int i=(a):i<(b);i++)
#define SSTR( x ) static_cast< std::ostringstream & >( \
        ( std::ostringstream() << std::dec << x ) ).str()
#define ALL(s) (s).begin(), (s).end()
#define UNIQUE(v) v.erase( unique(v.begin(), v.end()) , v.end());
using namespace std;
typedef long long unsigned int llu;
typedef long long ll;

int main (){
  cin.tie(0);
  ios::sync_with_stdio(false);
  int x;
  while(cin >> x){
    string ans;
    switch((x + 5) % 7){
    case 0:
      ans  = "sat";
      break;
    case 1:
      ans = "sun";
      break;
    case 2:
      ans = "mon";
      break;
    case 3:
      ans = "tue";
      break;
    case 4:
      ans = "wed";
      break;
    case 5:
      ans = "thu";
      break;
    case 6:
      ans = "fri";
      break;
    }
    cout << ans << endl;
  }
  return 0;
}



Measured memory_bytes: 3240
#include <bits/stdc++.h>
using namespace std;
#define mod 1000000007
#define pb push_back
#define pob pop_back
#define mp make_pair
#define ff first
#define ss second
#define pi 3.14159265
#define fast ios::sync_with_stdio(0);cin.tie(0);cout.tie(0)
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef pair <ll, ll> pll;
const ll M=1e9+7;
ll inf=1e18;
int main()
{
    ll n,m,k;
    cin>>n>>m>>k;
    ll a[n+1],b[m+1];
    for(int i=1;i<=n;i++)
        cin>>a[i];
    for(int j=1;j<=m;j++)
        cin>>b[j];
    a[0]=0;
    b[0]=0;
    for(int i=2;i<=n;i++)
        a[i]+=a[i-1];
    for(int i=2;i<=m;i++)
        b[i]+=b[i-1];
    ll fans=INT_MIN;
    for(int i=0;i<=n;i++){
        ll x=k-a[i];
        if(x>=0){
        ll l=0,r=m,mid,ans;
        while(l<=r){
            mid=(l+r)/2;
            if(b[mid]<=x){
                ans=mid;
                l=mid+1;
            }
            else{
                r=mid-1;
            }
        }
        fans=max(fans,i+ans);
        }
    }
    cout<<fans;
}


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

int main()
{
    int n, m;
    scanf("%d %d", &n, &m);

    int a, b;
    a = n * (n - 1) / 2;
    b = m * (m - 1) / 2;

    printf("%d\n", (a + b));

    return 0;
}

Measured memory_bytes: 128
import collections

# input
N = int(input())

# process
def prime_factorize(n):
    a = []
    while n % 2 == 0:
        a.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        a.append(n)
    return a

C = collections.Counter(prime_factorize(N))

ans = 0
for c in C.values():
    t = c
    for i in range(1, c+1):
        t -= i
        if t >= 0:
            ans += 1
        else:
            break

# output
print(ans)


Measured memory_bytes: 9468
#include "bits/stdc++.h"
using namespace std;

int main(){
    int a,b;scanf("%d%d",&a,&b);
    double ret=0;
    for(int i=1;i<=a;i++){
        double tmp=1.0/a;
        int now=i;
        while(now<b){
            now*=2;
            tmp/=2;
        }
        ret+=tmp;
    }
    printf("%.12f\n",ret);
}

Measured memory_bytes: 256
N = int(input())
A = [int(c)-1 for c in input()]
x = 0
b = 1 if any(a==1 for a in A) else 2
for k,a in enumerate(A):
    p = int(((N-1)&k)==k)
    if p and a^b==0:
        x ^= b
print(x)

Measured memory_bytes: 14700
#include<iostream>
#include<cstdio>
#include<cstring>
#include<map>
#include<cstdlib>
#include<stack>
#include<queue>
#include<algorithm>
#include<set>
#include<vector>
#include<cmath>
#include<string>
#include<bitset>
#define lmid l,mid,rt<<1
#define rmid mid+1,r,rt<<1|1
#define ll long long
using namespace std;
int s[100005], t[100005], r[100005];
long long t1[100005], r1[100005];
int main() {
     int n;;
     scanf("%d", &n);
     for (int i = 0; i < n; i++)
          scanf("%d", &s[i]);
     for (int i = 0; i < n; i++)
          scanf("%d", &t[i]);
     for (int i = 0; i < n; i++)
          scanf("%d", &r[i]);
     sort(s, s + n), sort(t, t + n), sort(r, r + n);
     int j = 0;
     for (int i = 0; i < n; i++) {
          while (j < n && s[j] < t[i])j++;
          t1[i] = j;
     }
     j = 0;
     for (int i = 0; i < n; i++) {
          while (j < n && t[j] < r[i])r1[i] += t1[j], j++;
          if (i != 0)r1[i] += r1[i - 1];
     }
     long long sum = 0;
     for (int i = 0; i < n; i++)
          sum += r1[i];
     printf("%lld\n", sum);
     return 0;
}


Measured memory_bytes: 2944
use std::io::stdin;
use std::io::Error;
use std::io::ErrorKind;
use std::io::Read;

#[derive(Debug)]
struct Input {
    a: u8,
    b: u8,
    t: u8,
}

fn handle_input(input_str: String) -> Result<Input, Error> {
    let mut iter = input_str.split_whitespace();
    let input = match (iter.next(), iter.next(), iter.next()) {
        (Some(a_str), Some(b_str), Some(t_str)) => {
            let (a, b, t): (u8, u8, u8) = match (a_str.parse(), b_str.parse(), t_str.parse()) {
                (Ok(a), Ok(b), Ok(t)) => (a, b, t),
                _ => return Err(Error::new(ErrorKind::InvalidInput, "")),
            };
            Input { a: a, b: b, t: t }
        }
        _ => return Err(Error::new(ErrorKind::InvalidInput, "")),
    };
    Ok(input)
}

fn handle_output(input: Input) -> Result<String, Error> {
    Ok(format!("{}", (input.t / input.a) as u16 * input.b as u16))
}

fn main() {
    let mut input_str = String::new();
    let stdin = stdin();
    stdin.lock().read_to_string(&mut input_str).unwrap();
    let input = handle_input(input_str).unwrap();
    let output = handle_output(input).unwrap();
    println!("{}", output);
}

Measured memory_bytes: 4352
#include<iostream>

int main(){
    
    int d;
    
    int a,b,c;
    
    std::cin>>d;
    
    a=d/1000;
    
    d-=a*1000;
    
    b=d/100;
    
    d-=b*100;
    
    c=d/10;
    
    d-=c*10;
    
    if(a+b+c+d==7)
        std::cout<<a<<"+"<<b<<"+"<<c<<"+"<<d<<"=7"<<std::endl;
    else
        if(a+b+c-d==7)
            std::cout<<a<<"+"<<b<<"+"<<c<<"-"<<d<<"=7"<<std::endl;
    else
        if(a+b-c+d==7)
            std::cout<<a<<"+"<<b<<"-"<<c<<"+"<<d<<"=7"<<std::endl;
    else
        if(a-b+c+d==7)
            std::cout<<a<<"-"<<b<<"+"<<c<<"+"<<d<<"=7"<<std::endl;
    else
        if(a+b-c-d==7)
            std::cout<<a<<"+"<<b<<"-"<<c<<"-"<<d<<"=7"<<std::endl;
    else
        if(a-b+c-d==7)
            std::cout<<a<<"-"<<b<<"+"<<c<<"-"<<d<<"=7"<<std::endl;
    else
        if(a-b-c+d==7)
            std::cout<<a<<"-"<<b<<"-"<<c<<"+"<<d<<"=7"<<std::endl;
    else
        if(a-b-c-d==7)
            std::cout<<a<<"-"<<b<<"-"<<c<<"-"<<d<<"=7"<<std::endl;
    
    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <fstream>
#include <vector>
#include <cstring>
#include <queue>
#include <algorithm> // sort
#include <math.h>
#include <map>
#include <set>

#define DEBUG 0

#define REP(i, n) for (long long i = 0; i < (n); i++) 
typedef long long ll;
static const ll MOD = 1000000007;
static const ll INF = 1000000000000000000LL;
                    //999999997000000003
                    //1000000000000000000

using namespace std;

const ll A = 1000005;

ll euclidean_gcd(ll a, ll b) {
  if(a < b) return euclidean_gcd(b, a);
  ll r;
  while ((r=a%b)) {
    a = b;
    b = r;
  }
  return b; //あまりが0ならそれが、最大公約数
}

int solve(){
    ll N;
    cin >> N;
    vector <ll> a(N,0);
    string pc = "pairwise coprime";
    string sc = "setwise coprime";
    string nc = "not coprime";

    vector <ll> c(A,0);
    REP(i,N)
    {
        cin >> a[i];
        c[a[i]]++; 
    }

    bool pairwise = true;
    for(int i = 2; i < A; i++)
    {
        int cnt = 0;
        //iの倍数が複数あったらアウト
        for(int j = i; j < A; j+=i)
        {
            cnt += c[j];
        }
        if(cnt > 1)
        {
            pairwise = false;
        }
    }
    if(pairwise)
    {
        cout << pc << endl;
        return 0;
    }

    int g = a[0];
    for(int i = 1; i < N; ++i)
    {
        g = euclidean_gcd(g,a[i]);
    }
    if(g == 1)
    {
        cout << sc << endl;
        return 0;
    }

    cout << nc << endl;

    return 0;
}

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


Measured memory_bytes: 18808
// luogu-judger-enable-o2
#include<bits/stdc++.h>
using namespace std;
int main(){
    int n,t,x,y;
    cin>>n;
    for(int i=0;i<n;i++){
        cin>>t>>x>>y;
        if(!(x+y<=t&&(t-x-y)%2==0)){
            cout<<"No"<<endl;
            return 0;
        }
    }
    cout<<"Yes"<<endl;
    return 0;
}

Measured memory_bytes: 256
S = input()
atcg_length = 0 
tmp_length = 0 
for i in range(len(S)): 
    if S[i] == 'A' or S[i] == 'T' or S[i] == 'C' or  S[i] == 'G':
        tmp_length += 1
        atcg_length = max(atcg_length, tmp_length)
    else:
        tmp_length = 0
print(atcg_length)


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

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

    int N;
    cin >> N;

    map<string, int> votes;
    rep(i, N) {
        string input;
        cin >> input;
        if (votes.find(input) != votes.end()) {
            votes[input]++;
        } else {
            votes[input] = 1;
        }
    }

    int max_count = 0;
    for (auto vote : votes) {
        max_count = max(max_count, vote.second);
    }

    vector<string> names;
    for (auto vote : votes) {
        if (vote.second == max_count) {
            names.push_back(vote.first);
        }
    }

    sort(names.begin(), names.end());

    for (auto name : names) {
        cout << name << endl;
    }
}

Measured memory_bytes: 25584
#include <iostream>
#include <map>
#include <vector>
#include <cmath>
#include <string>
#include <cstring>
#include <algorithm>
#include <climits>
#include <stack>
#include <queue>
#include <set>
#include <cctype>
#include <bitset>
#include <type_traits>
#include <list>
#include <bits/stdc++.h>
using namespace std;

#define REP(i, n) for (long long i = 0; i < (n); ++i)
#define rep(i, a, b) for (long long i = a; i < (b); ++i)
#define YES(j) cout << (j ? "YES" : "NO") << endl;
#define Yes(j) std::cout << (j ? "Yes" : "No") << endl;

typedef long long ll;
const ll MOD = 1'000'000'007;


void solve(long long S, long long W){
    // if S <= W unsafe
    if( S <= W)
    {
        cout << "unsafe" << endl;
    }
    else
    {
        cout << "safe" << endl;
    }
    
}

// Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
int main(){
    long long S;
    scanf("%lld",&S);
    long long W;
    scanf("%lld",&W);
    solve(S, W);
    return 0;
}


Measured memory_bytes: 3672
#include <iostream>
#include <string>
#include <algorithm>
#include <cmath>
#include <deque>
#include <queue>
#include <stack>
#include <vector>
#include <utility>
#include <iomanip>
#include <bitset>
#include <set>
#include <map>
#include <stdio.h>
#include <numeric>
#include <cstring>

#define rep(i,n) for (int i = 0; i < (n); i++)
#define rep1(i,n) for (int i = 1; i < (n); i++)
#define FOR(i,a,b) for (int i=(a); i < (b); i++)
#define MOD 1000000007 //10^9+7
using namespace std;
using ll = long long;
using PII = pair<int, int>;
using PLL = pair<ll, ll>;
const int INF = numeric_limits<int>::max();
const ll INFL = numeric_limits<ll>::max();


// 負の数にも対応した % 演算
long long mod(long long val, long long m) {
    long long res = val % m;
    if (res < 0) res += m;
    return res;
}

//greatest common divisor
long long gcd(ll a, ll b) 
{
    if (a % b == 0) {
        return b;
    } else {
        return gcd(b, a % b);
    }
}

//least common multiple
long long lcm(ll a, ll b)
{
    return a / gcd(a, b) * b ;
}

ll factorial(ll n) {
    ll res = 1;
    for (ll i = 1; i <= n; i++) {
        res *= i;
    }
    return res;
}

bool is_prime(ll n) {
    for (ll i = 2; i * i <= n; i++) {
        if (n % i == 0) return false;
    }
    return n != 1;
}

int main()
{
    int w, h, n; cin >> w >> h >> n;
    int a[h][w];
    memset(a, 0, sizeof(a));
    rep(i,n) {
        int x, y, aa; cin >> x >> y >> aa;
        x--; y--;
        if (aa == 1) {
            rep(i,h) {
                rep(j,x+1) {
                    a[i][j] = 1;
                }
            }
        } else if (aa == 2) {
            rep(i,h) {
                for (int j = x+1; j < w; j++) {
                    a[i][j] = 1;
                }
            }
        } else if (aa == 3) {
            rep(i,y+1) {
                rep(j,w) {
                    a[i][j] = 1;
                }
            }
        } else {
            for (int i = y+1; i < h; i++) {
                rep(j,w) {
                    a[i][j] = 1;
                }
            }
        }
    }

    int ans = 0;
    rep(i,h) {
        rep(j,w) {
            if (!a[i][j])
                ans++;
        }
    }
    cout << ans << endl;

    return 0;
}


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

using namespace std;
#define REPP(i,a,b,c) for(int i=a; i<=b; i+=c)
#define REP(i,a,b) REPP(i,a,b,1)
#define REVV(i,a,b,c) for(int i=a; i>=b; i-=c)
#define REV(i,a,b) REVV(i,a,b,1)
#define FOR(i,a) REP(i,0,(int)a-1)
#define FORD(i,a) REV(i,(int)a-1,0)
#define PB push_back
#define POB pop_back
#define MP make_pair
#define FI first
#define SE second
typedef long long ll;
typedef unsigned long long ull;
typedef pair < int , int > pii;
typedef vector < int > vi;
typedef vector < pii > vii;
typedef vector < ll > vl;

const double EPS = 1e-9;
const double PI = acos(-1);
const int INF = 1e9;
const ll MOD = 1e9 + 7;

ll addMod(ll a, ll b){
	return (a+b) % MOD;
}

ll mulMod(ll a, ll b){
	return (a*b) % MOD;
}

ll fast(ll a, ll b){
	if(b == 0) return 1;
	ll tmp = fast(a,b/2);
	tmp = mulMod(tmp, tmp);
	if(b & 1) tmp = mulMod(tmp, a);
	return tmp;
}

/////////////////////////////////////////////////////////

const int N = 1e5;

int n;
string str[N+5];


ll solve(){
	ll ret = 0, sz = 0;
	int bef = 0;
	FOR(i,n){
		if(str[i] != str[bef]){
			ret += sz * (sz - 1) / 2;
			bef = i;
			sz = 0;
		}
		sz++;
	}
	ret += sz * (sz - 1) / 2;
	return ret;
}

int main(){
	ios_base :: sync_with_stdio(0); cin.tie(0); cout.tie(0);
	cin >> n;
	FOR(i,n){
		cin >> str[i];
		sort(str[i].begin(), str[i].end());
	}
	sort(str,str+n);
	cout << solve() << endl;
	return 0;
}

Measured memory_bytes: 5760
#pragma GCC optimize("Ofast")

//インクルード
#include<algorithm>//sort,二分探索,など
#include<bitset>//固定長bit集合
#include<cmath>//pow,logなど
#include<complex>//複素数
#include<deque>//両端アクセスのキュー
#include<functional>//sortのgreater
#include<iomanip>//setprecision(浮動小数点の出力の誤差)
#include<iostream>//入出力
#include<map>//map(辞書)
#include<numeric>//iota(整数列の生成),gcdとlcm(c++17)
#include<queue>//キュー
#include<set>//集合
#include<stack>//スタック
#include<string>//文字列
#include<unordered_map>//イテレータあるけど順序保持しないmap
#include<unordered_set>//イテレータあるけど順序保持しないset
#include<utility>//pair
#include<vector>//可変長配列

using namespace std;
using Graph = vector<vector<int>>; // グラフ型
typedef long long ll;

//マクロ
#define REP(i,n) for(ll i=0;i<(ll)(n);i++)
#define REPD(i,n) for(ll i=(ll)(n)-1;i>=0;i--)
#define FOR(i,a,b) for(ll i=(a);i<=(b);i++)
#define FORD(i,a,b) for(ll i=(a);i>=(b);i--)
#define ALL(x) (x).begin(),(x).end() //sortなどの引数を省略したい
#define SIZE(x) ((ll)(x).size()) //sizeをsize_tからllに直しておく
#define MAX(x) *max_element(ALL(x))
//#define INF 1000000000000 //10^12
#define MOD 10000007 //10^9+7
#define PB push_back
#define MP make_pair
#define F first
#define S second
#define MAXR 100000 //10^5:最大のrange(素数列挙などで使用)

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;
}

const long long INF = 1LL << 60;

int main() {
  // 高速化
    std::ios::sync_with_stdio(false);
    std::cin.tie(0);


    int n;
    cin >> n;
    vector<ll> a(n);

    REP(i, n){
      cin >> a[i];
    }

    vector<ll>  dp(n, INF); // INFで初期化
    dp[0] = 0;   // 初期条件

    FOR(i, 1, n-1){
      chmin(dp[i], dp[i-1] + abs(a[i] - a[i-1]));

      if(i > 1){
        chmin(dp[i], dp[i-2] + abs(a[i] - a[i-2]));
      }
    }

  
    cout << dp[n-1] << '\n';
  
    return 0;
}


Measured memory_bytes: 1792
package main

import (
	"fmt"
	"strconv"
)

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

	sum := 0
	for i := 0; i < (1 << uint(len(s)-1)); i++ {
		// iのbitが立っている個所に+を挿入していく
		tmp := uint(i)
		start := 0
		for j := 1; j <= len(s); j++ {
			if tmp&1 == 1 {
				n, _ := strconv.Atoi(s[start:j])
				sum += n
				start = j
			}

			if j == len(s) {
				n, _ := strconv.Atoi(s[start:j])
				sum += n
			}
			tmp = tmp >> 1
		}

	}

	fmt.Println(sum)
}


Measured memory_bytes: 512
#include<stdio.h>
int main()
{
    int a[10],b[10]={0},c[11]={0},t,i,j,k,flag;
    scanf("%d",&t);
    while(t--)
    {
        flag=1;
        for(i=0;i<10;i++)
            scanf("%d",&a[i]);
        b[0]=a[0];
        k=1;
        j=1;
        for(i=1;i<10;i++)
        {
            if((a[i]>b[k-1])&&(a[i]>c[j-1]))
            {
                if((a[i]-b[k-1])<(a[i]-c[j-1]))
                {
                    b[k]=a[i];
                    k++;
                }
                else
                {
                    c[j]=a[i];
                    j++;
                }
            }
            else if((a[i]>b[k-1])&&(a[i]<c[j-1]))

            {
                b[k]=a[i];
                k++;
            }
            else if((a[i]<b[k-1])&&(a[i]>c[j-1]))
            {
                c[j]=a[i];
                j++;
            }
            else
            {
                flag=0;
                break;
            }
        }
        if(flag==0)
            printf("NO\n");
        else
            printf("YES\n");
    }
    return 0;
}



Measured memory_bytes: 2064
import java.util.Scanner;
 
public class Main { //クラス名はMain
    public static void main(String[] args) {
    Scanner in = new Scanner(System.in);
      int N = in.nextInt();
      int hundreds = N / 100;
      int tens = (N / 10) % 10; // (n % 100) / 10
      int ones = N % 10;
       if ((hundreds == 7) || (tens == 7) || (ones == 7))
            System.out.println("Yes");
       else
            System.out.println("No");
        
  
    }
}

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

int main(){
	string la,lb;
	int a[4],b[4];
	int hit,blow;
	while(cin>>la>>lb,la!="0"&&lb!="0"){
	hit=blow=0;
	for(int i=0;i<4;i++){
		if(la[i]==lb[i]){hit++;}
		a[i]=la[i]-'0';
		b[i]=lb[i]-'0';
	}
	sort(a,a+4);sort(b,b+4);
	for(int i=0;i<4;i++){
		for(int j=0;j<4;j++){
			if(a[i]==b[j])blow++;
			if(a[i]<b[j])break;
		}
	}
	
	cout<< hit<<" "<<blow-hit<<endl;
	}
	
}

Measured memory_bytes: 1204
#include <iostream>

using namespace std;

int main(){
    int X;
    cin>>X;
    if(X==7){
        cout<<"YES\n";
    }
    else if(X==5){
        cout<<"YES\n";
    }
    else if(X==3){
        cout<<"YES\n";
    }
    else{
        cout <<"NO\n";
    }
    return 0;
}

Measured memory_bytes: 256
/*******************************
 Author: i_o__o_i
 Created: Friday 2020-04-10
********************************/
#include<bits/stdc++.h>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/pb_ds/assoc_container.hpp>
#pragma GCC optimization("Ofast")

using namespace std;
using namespace __gnu_pbds;

typedef     long long   ll;

#define     CS(x) cout << "Case " << x << ": ";
#define     _test int TC; cin >> TC; while(TC--)
#define     sq(x) ((x) * 1LL * (x))
#define     eb emplace_back
#define     pb push_back
#define     all(_n) _n.begin(), _n.end()
#define     rall(_n) _n.rbegin(), _n.rend()
#define     Clear(a, b) memset(a, b, sizeof(a))
#define     sp << ' ' <<
#define     endl "\n"
#define     nl cout << endl
#define     D(x) cout << #x << " >>>>>> " << x << endl;
#define     D2(x, y) cout << #x << " >>> " << x << " # " << #y << " >>> " << y << endl;
#define     DD cout << "--\n";
#define     dbg cout << "!!ERROR ERROR ERROR!!" << endl;
#define     show(x) cout << x << endl
#define     precision(n) cout << fixed << setprecision(n);
#define     exeTime(fun){clock_t start, end; start = clock(); fun; end = clock(); double time_taken = double(end - start) / double(CLOCKS_PER_SEC); cout << "Execution time: " << time_taken << " secs."; }
#define     F first
#define     S second
#define     mini(a, b) a = min(a, b)
#define     maxi(a, b) a = max(a, b)
#define     sz(x) int( x.size() )
#define     gcd(a, b) __gcd(a, b)
#define     lcm(a, b) (abs((a) * (b)) / gcd(a, b))
#define     getbit(n, i) (((n) & (1LL << i)) != 0)
#define     setbit0(n, i) ((n) & (~(1LL << i)))
#define     setbit1(n, i) ((n) | (1LL << i))
#define     kbits(n, k) ((n) & ((1LL << k) - 1))
#define     LSB(n) ((n) & (-(n)))
#define     MSB(n) (1LL << (int)log2(n))
#define     isPowOf2(n) ((n > 0) && (((n) & (n-1)) == 0))
#define     parity(a, b) (a&1 ^ b&1)
#define     cond(__C, __R1, __R2) (__C ? __R1 : __R2)

inline bool _equal(double a, double b) { return fabs(a-b) < 1e-9; }
template<typename T> void print (T t){ for(const auto &it : t) cout << it << ' '; nl; }
template<class T> inline T min(T a, T b, T c){ return min(min(a, b), c); }
template<class T> inline T max(T a, T b, T c){ return max(max(a, b), c); }
template <typename T>  using orderedSet = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>; // order_of_key find_by_order

//mt19937 mrand(random_device{}());
//int rnd(int x) { return mrand() % x;}

const    double Pi = acos(-1.0);
const    int Mod = 1e9 + 7;
const    int Eps = 1e-9;
const    int Inf = 1 << 30;
const    int Maxx = 1e5 + 10;

/******************************[Code Starts Here]********************************/


void _case()
{
    int n, m;
    cin >> n >> m;
    vector<int> v(n);
    for(auto &it : v) cin >> it;
    ll sum = accumulate(all(v), 0LL);
    int cnt = 0;
    for(auto &it : v) {
        if(it  >= (sum * (1/double(4*m)))) cnt++;
    }
    if(cnt >= m) show("Yes");
    else show("No");
}

int main()
{
    ios::sync_with_stdio(false), cin.tie(nullptr), cout.tie(nullptr);
    _case();
    return 0;
}




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

int main(){
  char c;
  cin >> c;
  if( (c == 'a') || (c == 'e') || (c == 'i') || (c == 'u') || (c == 'o') ){
    cout << "vowel" << endl;
  }
  else cout << "consonant" << endl;
}

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

int main() {
  int N, K;
  string S;
  cin >> N >> K >> S;
  vector<int> V(2);
  char c = '1';
  for (int i = 0, j = 1; i < N; i++) {
    if (S.at(i) == c) V.at(j)++;
    else V.push_back(V.at(j) + 1), c = (c == '1') ? '0' : '1', j++;
  }
  int ans = 0, v = V.size();
  for (int i = 1; i < v; i += 2)
    ans = max(ans, V.at(min(v - 1, i + K * 2)) - V.at(i - 1));
  cout << ans << "\n";
}

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

int main(){
    int x;
    cin >> x;
    vector<bool>a(x+1);
    a[1]=true;
    for(int b=2;b<=x;b++){
        int num=b*b;
        while(num<=x){
            a[num]=true;
            num*=b;
        }
    }
    for(int i=x;i>=1;i--){
        if(a[i]==true){
            cout << i << endl;
            return 0;
        }
    }
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define int long long int
signed main()
{
    int len;
    cin >> len;
    string s;
    cin >> s;
    int red = 0, green = 0, blue = 0;
    for (int i = 0; i < len; i++)
    {
        if (s[i] == 'R')
            red++;
        else if (s[i] == 'G')
            green++;
        else
            blue++;
    }
    int total = red * blue * green;
    if (total == 0)
    {
        cout << 0 << endl;
        return 0;
    }
    for (int i = 0; i < len - 2; i++)
    {
        for (int j = i + 2; j < len; j += 2)
        {
            int current = i;
            int middle = (i + j) / 2;
            int next = j;
            if (s[current] != s[middle] && s[middle] != s[next] && s[current] != s[next])
                total--;
        }
    }
    cout << total << endl;
    return 0;
}


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

using namespace std;



int32_t main() {

    ios_base::sync_with_stdio(false);

    cin.tie(0);

    long long k;

    cin >> k;

    long long cur=0;

    long long mul=1;

    for(long long i = 0 ; i < 1e7 ; i++) {

        cur+=((7*mul)%k);

        cur%=k;

        if(cur==0) {

            cout << i+1 << '\n';

            return 0;

        }

        mul*=10;

        mul%=k;

    }

    cout << -1 << '\n';

    return 0;

}



Measured memory_bytes: 3636
#include <stdio.h>

int main(void)
{
    
    int a,b,c;
    
    scanf("%d %d %d",&a,&b,&c);
    
    if (a+b==c) {
        printf("Yes\n");
    }
    else if (a+c==b) {
        printf("Yes\n");
    }
    else if (b+c==a) {
        printf("Yes\n");
    }
    else
    {
        printf("No\n");
    }
    
    return 0;
}

Measured memory_bytes: 128
#include <bits/stdc++.h>
using namespace std;
typedef long long  ll;
#define FOR(i,a,n) for(ll i=(ll)a;i<(ll)n;i++)
#define RFOR(i,a,n) for(ll i=(ll)n-1;i >= (ll)a;i--)
#define rep(i,n) FOR(i,0,n)
#define rrep(i,n) RFOR(i,0,n)
#define ALL(v) v.begin(), v.end()
#define bra(first,second) '(' << first << ',' << second << ')'
constexpr ll MOD = 1000000007;
//constexpr ll MOD = 998244353;
ll INF = 6001001001001001001;
long double EPS = 1e-6;
long double PI = 3.141592653589793238;
template<typename T>
void remove(std::vector<T>& vector, unsigned int index){
    vector.erase(vector.begin() + index);
}

using Graph = vector<vector<pair<ll,double>>>;

// MOD確認

int main(){
    ll K,N;
    cin >> K >> N;
    vector<ll> A(N);
    rep(i,N) cin >> A[i];
    sort(ALL(A));
    ll ans = INF;
    rep(i,N){
        if(i == N-1){
            ans = min(ans,K - abs(K - A[i] + A[0]));
        }else{
            ans = min(ans,K - abs(A[i] - A[i+1]));
        }
    }
    cout << ans << endl;
}


Measured memory_bytes: 1920
#include <iostream>
#include <string>
using namespace std;
int main(void){
    // Here your code !
 
    string p;
    string s;
    
    cin>>p;
    cin>>s;
    
    p+=p;
    

    string::size_type hantei = p.find(s);
    
    if(hantei!=string::npos)
        cout<<"Yes"<<endl;
        else
        cout<<"No"<<endl;
}

Measured memory_bytes: 1192
a = [list(map(int, input().split())) for _ in range(3)]
n = int(input())
b = [int(input()) for _ in range(n)]

for i in range(3):
    for j in range(3):
        for k in range(n):
            if a[i][j] == b[k]:
                a[i][j] = 0

for i in range(3):
    if a[i][0] + a[i][1] + a[i][2] == 0:
        print('Yes')
        exit()
    if a[0][i] + a[1][i] + a[2][i] == 0:
        print('Yes')
        exit()

if a[0][0]+a[1][1] + a[2][2] == 0:
    print('Yes')
    exit()
if a[2][0]+a[1][1] + a[0][2] == 0:
    print('Yes')
    exit()
    
print('No')


Measured memory_bytes: 38384
import java.util.*;


/**
 * Created by Seiya on 2016/10/16.
 */

public class Main {

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

        long[] map = new long[100002];

        int n = scanner.nextInt();
        long k = scanner.nextLong();

        for (int i = 0; i < n; i++) {
            int a = scanner.nextInt();
            long b = scanner.nextLong();
            map[a] += b;
        }

        long total = 1;
        for (int i = 0; i < 100001; i++) {
            total += map[i];
            if(total > k){
                System.out.println(i);
                break;
            }
        }


    } // mainMethod


} // MainClass


Measured memory_bytes: 63684
#include <iostream>
#include <cstdio>
#include <string>
#include <cstring>
#include <deque>
#include <list>
#include <queue>
#include <stack>
#include <vector>
#include <utility>
#include <algorithm>
#include <map>
#include <set>
#include <complex>
#include <cmath>
#include <limits>
#include <cfloat>
#include <climits>
#include <ctime>
#include <cassert>
#include <numeric>
#include <functional>
#include <bitset>

using namespace std;
#define int long long int
const int INF = 1001001001001001LL;
const int MOD = 1000000007;

int di[] = {-1, 0, 1, 0, -1, 1, 1, -1};
int dj[] = {0, 1, 0, -1, 1, 1, -1, -1};

signed main(){
    
    string s; cin >> s;
    map<char, int> m;
    for(int i = 0; i < 4; i++){
        m[s[i]] = m[s[i]] + 1;
    }

    if(m.size() == 2){
        for(auto x : m){
            if(x.second != 2){
                cout << "No" << endl;
                return 0;
            }
        }
    }else{
        cout << "No" << endl;
        return 0;
    }

    cout << "Yes" << endl;
    return 0;
}


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

using namespace std;

#define REP(i, N) for (int i = 0; i < (int)N; i++)
#define RREP(i, N) for (int i =(int)N-1; i >= 0; i--)
#define FOR(i, a, b) for (int i = a; i < (int)b; i++)
#define ALL(x) (x).begin(), (x).end()
#define INF (1 << 30)
#define LLINF (1LL << 62)
#define DEBUG(...) debug(__LINE__, ":" __VA_ARGS__)

typedef long long ll;
typedef pair<int, int> Pii;
typedef pair<ll, ll> Pll;

int main(){
  int a,b,c,d;
  cin>>a>>b>>c>>d;
  while(1){
    c-=b;
    if(c<=0){
      cout<<"Yes"<<endl;
      return 0;
    }
    a-=d;
    if(a<=0){
      cout<<"No"<<endl;
      return 0;
    }
  }
}


Measured memory_bytes: 3632
#include <bits/stdc++.h>
using namespace std;
#define FOR(i, begin, end) for(int i=(begin),i##_end_=(end);i<i##_end_;i++)
#define IFOR(i, begin, end) for(int i=(end)-1,i##_begin_=(begin);i>=i##_begin_;i--)
#define REP(i, n) FOR(i,0,n)
#define IREP(i, n) IFOR(i,0,n)
template <typename T> bool chmax(T &m, const T q) { if (m < q) {m = q; return true;} else return false; }
template <typename T> istream &operator>>(istream &is, vector<T> &vec) { for (auto &v : vec) is >> v; return is; }

int main()
{
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    int N;
    cin >> N;
    vector<int> A(N), B(N);
    cin >> A >> B;
    vector<int> V(N);
    REP(i, N)
    {
        V[i] = upper_bound(B.begin(), B.end(), A[i]) - B.begin();
        if (i) chmax(V[i], V[i - 1] + 1);
    }
    IREP(i, N - 1) chmax(V[i], V[i + 1] - 1);
    REP(i, N) if (A[i] == B[V[i] % N])
    {
        puts("No");
        return 0;
    }

    cout << "Yes\n";
    REP(i, N) cout << B[V[i] % N] << ' ';
}


Measured memory_bytes: 5580