akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;

string s;

int main() {
    cin>>s;
    string ans="Yes";
    for (int i=0; i<s.size(); i++) {
        if (i%2==0/*奇数*/) {
            if (s[i]=='L') {
                ans="No";
                break;
            }
        }
        else {
            if (s[i]=='R') {
                ans="No";
                break;
            }
        }
    }
    cout<<ans<<endl;
    return 0;
}
//next_permutation


Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
  
using namespace std;
using namespace __gnu_pbds;
 
#define ll long long
#define uint unsigned int
#define ull  unsigned long long
#define pb push_back
#define mk make_pair
#define ins insert
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(),(x).rend()
#define X first
#define Y second
#define umap unordered_map
#define speed() ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
#define setvalue(d,s,e,n) for(int qwe = s; qwe < e; ++qwe) d[qwe] = n
#define mset multiset
#define pqueue priority_queue
   
template<class T> using oset = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
        
const int  N = 3e3 + 314;
const int INF = 1e9;
const double PI = acos(-1);
const int MOD = 1e9 + 7;
const double eps = 1e-9;
const long long LINF = 1e18 + 3141;
int n, m;
int dp[N][N];
pair <int,int>  par[N][N];
char lst[N][N];
string s, t;
string maxs(string &s1, string &s2){
    if(s1.size() > s2.size())
        return s1;
    return s2;
}
void solve(){
    cin >> s >> t;
    n = (int)s.size();
    m = (int)t.size(); 
    s = "?" + s;
    t = "!" + t;
    for(int i = 0; i < N; ++i)
        for(int j = 0; j < N; ++j)
            lst[i][j] = ' ';
    
    for(int i = 0; i < N; ++i)
        for(int j = 0; j < N; ++j)
            par[i][j] = {0, 0};
    
    for(int i = 1; i <= n; ++i) {
        for(int j = 1; j <= m; ++j) {
            if(t[j] == s[i]) {
                dp[i][j] = dp[i - 1][j - 1] + 1;
                lst[i][j] = t[j];
                par[i][j] = {i - 1, j - 1};
            }
            else{
                dp[i][j] = max(dp[i][j - 1], dp[i - 1][j]);
                if(dp[i][j - 1] > dp[i - 1][j]){
                    par[i][j] = {i, j - 1};

                }else{
                    par[i][j] = {i - 1, j};
                }
            }
        }
    }
    if(dp[n][m]){
        pair <int,int> cur = {n, m};
        string ans = "";
        while(cur != mk(0, 0)) {
            if(lst[cur.X][cur.Y] != ' ')
            ans += lst[cur.X][cur.Y];
            cur = par[cur.X][cur.Y];
        }
        reverse(all(ans));
        cout << ans;
    }
}   
 
int main(){
    speed();
    int t = 1;
    // cin >> t;
    while(t--)solve();
}

Measured memory_bytes: 137472
#include<cstdio>
#include<cstring>
#include<vector>
#include<algorithm>

using namespace std;

using ll=long long;
using vi=vector<int>;
using vvi=vector<vi>;
using pii=pair<int,int>;
using vll=vector<ll>;
using vvll=vector<vll>;


bool is_kaibun(const char *s, int n)
{
	for(int i=0;i<n/2;i++)
	{
		if(s[i]!=s[n-1-i]) return false;
	}
	return true;
}


int main(void)
{
	char s[99+2];

	while(scanf("%99[a-z]\n", s)==1)
	{
		int n=strlen(s);
		int m=(n+3)/2-1;
		bool ans=is_kaibun(s, n)&&is_kaibun(s+m, n-m);
		printf("%s\n", ans?"Yes":"No");
	}
	return 0;
}


Measured memory_bytes: 128
#include<bits/stdc++.h>
using namespace std;
#define ll long long int
#define all(in) in.begin(), in.end()
#define FIO ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);
typedef pair<int, int> PII;

int main(){
    FIO;
    string s;
    cin >> s;
    ll n = s.size();
    ll l[n], r[n], dp[n];
    r[0] = 0;   l[n-1] = n-1;
    for(ll i = 1 ; i < n ; i++){
        r[i] = r[i-1];
        dp[i] = 0;
        if(s[i] == 'R'){
            r[i] = i;
        }
    }
    dp[0] = 0;
    for(ll i = n-2 ; i >= 0 ; i--){
        l[i] = l[i+1];
        if(s[i] == 'L'){
            l[i] = i;
        }
    }
    for(ll i = 0 ; i < n ; i++){
        if(s[i] == 'R'){
            ll index = l[i] - 1;
            ll steps = index - i;
            if(steps%2==0){
                dp[index]++;
                //cout << index << " ";
            }else{
                dp[l[i]]++;
                //cout << l[i] << " ";
            }
        }else{
            ll index = r[i] + 1;
            ll steps = i - index;
            if(steps%2==0){
                dp[index]++;
                //cout << index << " ";
            }else{
                dp[r[i]]++;
                //cout << r[i] << " ";
            }
        }
        //cout << endl;
    }
    for(ll i = 0 ; i < n-1 ; i++){
        cout << dp[i] << " ";
    }
    cout << dp[n-1];
    cout << endl;
    return 0;
}

Measured memory_bytes: 3024
#include <bits/stdc++.h> 
using namespace std;
#define rep(i, N) for(int i=0; i<N; i++)
typedef long long ll;
#define dump(x) cerr<<#x<<"="<<x<<endl
using P = pair<int, int>;

int main() {
    int n, k;
    cin >> n >> k;
    vector<int> a(n+1, 0);
    rep(i, n) cin >> a.at(i+1);

    k = min(50, k);
    vector<int> b(n+2, 0);
    for(int j=0; j<k; j++){
        rep(i, n){
            b.at(i+1) = 0;
        }
        
        for(int i=1; i<=n; i++){
            int l = max(1, i-a.at(i));
            int r = min(n, i+a.at(i));

            b.at(l)++;
            if(r<n) b.at(r+1)--;
        }

        for(int i=2; i<=n; i++){
            b.at(i) += b.at(i-1);
        }

        rep(i, n){
            a.at(i+1) = b.at(i+1);
        }
   }

   rep(i, n){
       cout << a.at(i+1) << " ";
   }
   cout << endl;

    return 0;
}


Measured memory_bytes: 4844
#include <bits/stdc++.h>
#include <string>
#include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <bitset>
typedef long long ll;
using namespace std;
#define rep(i,n) for(int i=0;i<(n);i++)
 
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 { return mint(*this) += a;}
  mint operator-(const mint a) const { return mint(*this) -= a;}
  mint operator*(const mint a) const { return mint(*this) *= 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 { return mint(*this) /= a;}
};
istream& operator>>(istream& is, const mint& a) { return is >> a.x;}
ostream& operator<<(ostream& os, const mint& a) { return os << a.x;}
 
 
struct combination {
  vector<mint> fact, ifact;
  combination(int n):fact(n+1),ifact(n+1) {
    assert(n < mod);
    fact[0] = 1;
    for (int i = 1; i <= n; ++i) fact[i] = fact[i-1]*i;
    ifact[n] = fact[n].inv();
    for (int i = n; i >= 1; --i) ifact[i-1] = ifact[i]*i;
  }
  mint operator()(int n, int k) {
    if (k < 0 || k > n) return 0;
    return fact[n]*ifact[k]*ifact[n-k];
  }
} c(200005);
 
vector<pair<long long, long long> > prime_factorize(long long N) {
    vector<pair<long long, long long> > res;
    for (long long a = 2; a * a <= N; ++a) {
        if (N % a != 0) continue;
        long long ex = 0; // 指数
 
        // 割れる限り割り続ける
        while (N % a == 0) {
            ++ex;
            N /= a;
        }
 
        // その結果を push
        res.push_back({a, ex});
    }
 
    // 最後に残った数について
    if (N != 1) res.push_back({N, 1});
    return res;
}
vector<long long> enum_divisors(long long N) {
    vector<long long> res;
    for (long long i = 1; i * i <= N; ++i) {
        if (N % i == 0) {
            res.push_back(i);
            // 重複しないならば i の相方である N/i も push
            if (N/i != i) res.push_back(N/i);
        }
    }
    // 小さい順に並び替える
    sort(res.begin(), res.end());
    return res;
}


int main(int argc, const char * argv[]) {
    
    ll N; cin >> N;
    vector<ll> A(N);
    
    for(ll i=0;i<N;i++){
        cin >> A[i];
    }
    
    ll sum=0;
    for(ll i=1;i<N;i++){
        if(A[i-1]>A[i]){
            sum += A[i-1] - A[i];
            A[i] = A[i-1];
        }
        
    }
    cout << sum << endl;
    
    
    return 0;

}


Measured memory_bytes: 8004
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String S = sc.nextLine();
        String T = sc.nextLine();
        int ans = 0;

        for(int i = 0; i < 3; i++){
            if (S.charAt(i) == T.charAt(i)) {
                ans++;
            }
        }

        System.out.println(ans);
        sc.close();
    }
}

Measured memory_bytes: 22100
#include <iostream>
#include <vector>
#include <bitset>
#include <cmath>
#include <map>
#include <algorithm>
#include <queue>
#include <array>
#include <random>
#include <fstream>
#include <list>

int main() {
    std::cin.tie(0); std::ios::sync_with_stdio(false);
    std::vector<std::vector<bool>> mp;
    int n, m;
    int bl = 0;
    std::cin >> n >> m;
    for (int i = 0; i < n; ++i) {
        mp.push_back({});
        for (int j = 0; j < m; ++j) {
            char tmp;
            std::cin >> tmp;
            mp[i].push_back(tmp == '.');
            if(tmp == '#') bl++;
        }
    }
//    for (auto &&item : mp) {
//        for (auto &&ta : item) {
//            std::cout << (ta ? '.' : '#');
//        }
//        std::cout << std::endl;
//    }
    std::vector<std::vector<int>> d(n,std::vector<int>(m,-1));
    d[0][0] = 0;
    std::queue<std::pair<int,int>> q;
    q.push({0,0});
    while(!q.empty()){
        auto now = q.front();
        q.pop();
        int x = now.first;
        int y = now.second;
//        std::cerr << "now" <<x << ',' << y << std::endl;
        for (int i = -2; i <= 2; ++i) {
            int nx = x + i/2;
            int ny = y + i%2;
            if(nx >= 0 && nx < n && ny>= 0 && ny < m){
//                std::cerr << "next" << nx << ',' << ny << std::endl;
                if(d[nx][ny] == -1 && mp[nx][ny]){
                    d[nx][ny] = d[x][y] + 1;
                    q.push({nx,ny});
                }
            }
        }
    }
//    std::cerr << d[n][m] << '\n';
    if(d[n-1][m-1] == -1){
        std::cout << "-1\n";
    }
    else{
        int ans = (n*m) - d[n-1][m-1] - 1 - bl;
        std::cout << ans << std::endl;
    }
}


Measured memory_bytes: 256
n=int(input())
dict={'M':0,'A':0,'R':0,'C':0,'H':0}
for i in range(n):
  s=input()
  if s[0] in dict:
    dict[s[0]]+=1
data=['M','A','R','C','H']
ans=0
for i in range(3):
  for j in range(i+1,4):
    for k in range(j+1,5):
      ans+=dict[data[i]]*dict[data[j]]*dict[data[k]]
print(ans)

Measured memory_bytes: 9096
import java.io.*;
import java.util.*;
 
public class Main {
	Scanner sc = new Scanner(System.in);
	public static void main(String[] args) {
		new Main();
	}
	public Main(){
		new aoj103().doIt();
	}
	class aoj103{
		String a[] ={"HIT","OUT","HOMERUN"}; 
		int baseball(int cnt,int out){
			Queue<Integer> que = new LinkedList<Integer>();
			que.add(0);que.add(0);que.add(0);
			while(true){
				String str = sc.next();
				if(str.equals(a[0])){
					que.add(1);
					cnt = cnt + que.remove();
				}else if(str.equals(a[1])){
					out++;
				}else{
					que.add(1);que.add(0);que.add(0);que.add(0);
					cnt = cnt + que.remove();
					cnt = cnt + que.remove();
					cnt = cnt + que.remove();
					cnt = cnt + que.remove();
				}
				if(out == 3){
					break;
				}
			}
			return cnt;
		}
		void doIt(){
			int n = sc.nextInt();
			for(int i = 0;i < n;i++){
				int cnt = 0,out = 0;
				System.out.println(baseball(cnt,out));			
			}
	    }
	}
}

Measured memory_bytes: 17212
// https://qiita.com/tanakh/items/0ba42c7ca36cd29d0ac8
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
    ($($r:tt)*) => {
        let mut s = {
            use std::io::Read;
            let mut s = String::new();
            std::io::stdin().read_to_string(&mut s).unwrap();
            s
        };
        let mut iter = s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
}

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

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

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

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

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

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

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

fn main() {
    input! {
        s: String,
    }

    let ans = match s.as_str() {
        "SUN" => 7,
        "MON" => 6,
        "TUE" => 5,
        "WED" => 4,
        "THU" => 3,
        "FRI" => 2,
        "SAT" => 1,
        _ => 0,
    };
    println!("{}", ans);
}


Measured memory_bytes: 4352
#include <iostream>
#include <vector>
using namespace std;
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 long long INF = 1LL << 60;

int main() {
	
	int n;
	vector<long long> h(100010);
	vector<long long> dp(100010);

	cin >> n;
	for (int i = 0; i < n; i++) cin >> h[i];
	for (int i = 0; i < 100010; i++) dp[i] = INF;

	dp[0] = 0;

	for (int i = 1; i < n; i++) {
		chmin(dp[i], dp[i - 1] + abs(h[i] - h[i - 1]));
		if (i > 1) chmin(dp[i], dp[i - 2] + abs(h[i] - h[i - 2]));
	}
	cout << dp[n - 1] << endl;
}

Measured memory_bytes: 1792
#include<iostream>
#include<vector>
#include<algorithm>
#include<queue>
#include<iomanip>
#include <math.h>
using namespace std;
int main(){
    string s,t;
    cin>>s>>t;
    int ans=10000,n=0;
    for(int i=0;i<=s.size()-t.size();i++){
        for(int j=0;j<t.size();j++){
            if(s[i+j]!=t[j]){
                n++;
            }
        }
        if(n<ans){
            ans=n;
        }
        n=0;
    }
    cout<<ans<<endl;
    return 0;
}


Measured memory_bytes: 3604
function myin(){return require("fs").readFileSync("/dev/stdin", "utf8").trim();}
function myout(t){console.log(t);}//standard output
//[no]param
//0:何もしない  1:数値へ変換  2:半角SPで分割  3:改行で分割  4:半角SPで分割し、数値配列へ
//5:改行で分割し、数値配列へ  6:1文字に分割  7:1文字に分割し、数値配列へ
function myconv(i,no){switch(no){case 0:return i;case 1:return parseInt(i);case 2:return i.split(" ");case 3:return i.split("\n");case 4:return i.split(" ").map((a)=>Number(a));case 5:return i.split("\n").map((a)=>Number(a));case 6:return i.split("");case 7:return i.split("").map((a)=>Number(a));}}

function Main(input) {
  input = myconv(input,4);
  var a = input[0];
  var b = input[1];
  var x = input[2];
  var tmpH = x / (a*a);
  if(tmpH <= b / 2){
     var tmpA = 2 * x / (a*b);
    myout(Math.atan(b / tmpA) /Math.PI * 180);
     }else{
       var tmpB = (2 * x - a*a*b) / (a*a);
       var tmpB2 = b - tmpB;
       //var tmpA = 2 * x / (a*b);
    myout(Math.atan(tmpB2 / a) /Math.PI * 180); 
     }
  
  
  
}

Main(myin());


Measured memory_bytes: 7372
//from sounansya
import java.util.*;
public class Main{
        public static void main(String[] args){
                Scanner sc = new Scanner(System.in);
                HashMap hs = new HashMap();
                int n = sc.nextInt();
                String[] q = new String[n];
                for(int i = 0 ; i < n ; ++i){
                        q[i] = sc.next();
                }
                for(String s : q){
                        int c = 0;
                        if(hs.containsKey(s)) c = (int)hs.get(s);
                        hs.put(s , c + 1);
                }
                int[] qq = {0};
                hs.forEach((s , c) -> {
                        if(qq[0] < (int)c) qq[0] = (int)c;
                });
                String[] u = new String[n];
                int[] yono = {0};
                hs.forEach((s , cc) -> {
                        if((int)cc == qq[0]){
                                u[yono[0]] = (String)s;
                                ++yono[0];
                        }
                });
                sc.close();
                String[] it = new String[yono[0]];
                for(int i = 0, end_ = yono[0] ; i < end_ ; ++i){
                        it[i] = u[i];
                }
                Arrays.sort(it);
                for(int i = 0, end_ = yono[0] ; i < end_ ; ++i){
                        System.out.println(it[i]);
                }
        }
}


Measured memory_bytes: 81316
#include <bits/stdc++.h>
#define FOR(i,a,b) for (int i=(a);i<(b);i++)
#define FORR(i,a,b) for (int i=(a);i>=(b);i--)
#define pb push_back
#define pcnt __builtin_popcount
#define show(x) cout<<#x<<" = "<<x<<endl;
#define maxs(x,y) x = max(x,y)
#define mins(x,y) x = min(x,y)
#define fi first
#define se second
#define rng(a) (a.begin()),(a.end())
#define each(it,c) for(__typeof((c).begin()) it=(c).begin();it!=(c).end();it++)
#define sz(x) (int)(x).size()
#define mp make_pair

using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<pii> vpii;
typedef set<int> si;
typedef pair<ll,ll> pll;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef vector<pll> vpll;
typedef set<ll> sl;
typedef __int128_t lll;
typedef pair<lll,lll> plll;
typedef vector<lll> vlll;
template<typename T>string join(vector<T>&v)
{stringstream s;FOR(i,0,sz(v))s<<' '<<v[i];return s.str().substr(1);}
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 modpow(lll a,lll n,ll m){if(a==0)return a;lll p=1;for(;n>0;n/=2,a=a*a%m)if(n&1)p=p*a%m;return(ll)p;}
void dout(double d){printf("%.12f\n",d);}

const int iinf = 1e9;
const ll linf = 1e18;
const int mod = 1e9+7;
const double pi = acos(-1);
const double eps = 1e-10;
vi v;
int n, memo[100001];
main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  v.pb(1);
  FOR(i, 1, 7) v.pb(modpow(6, i, iinf));
  FOR(i, 1, 6) v.pb(modpow(9, i, iinf));
  sort(rng(v));
  cin >> n;
  FOR(i, 1, n+1){
    memo[i] = iinf;
    each(itr, v){
      if(i < *itr) break;
      mins(memo[i], memo[i - *itr]);
    }
    memo[i]++;
  }
  cout << memo[n] << endl;
  return 0;
}

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

using namespace std;

int main(){
    int n;
    cin >> n;
    vector<int> a(n,0);
    for(int i=0;i<n;i++){
        cin >> a[i];
    }
    int cnt=0;
    bool flag=true;
    while(flag){
        flag=false;
        for(int i=n-1;i>=1;i--){
            if(a[i]<a[i-1]){
                int t=a[i];
                a[i]=a[i-1];
                a[i-1]=t;
                cnt++;
                flag=true;
            }
        }
    }
    
    for(int i=0;i<n;i++){
        cout << a[i];
        if(i!=n-1)cout << " ";
    }
    cout << endl;
    cout << cnt << endl;
    return 0;
}

Measured memory_bytes: 3100
n = int(input())
a = [0] + list(map(int, input().split()))
b = [0]*(n+1)
for i in range(n,0,-1):
    p = 0
    for t in range(i*2,n+1,i):
        p += b[t]
    b[i] = (p%2)^a[i]
print(sum(b))
print(" ".join(map(str,[i for i in range(1,n+1) if b[i]])))

Measured memory_bytes: 18988
#include<iostream>
#include<cstdio>
#include<cstdlib>
#include<cassert>
#include<cstring>
#include<climits>
#include<sstream>
#include<deque>
#include<vector>
#include<algorithm>
#include<set>
#include<map>
#include<bitset>

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

using namespace std;

typedef long long ll;

#define MAX_V 9

int V,E;

bool edge[MAX_V][MAX_V];

ll dp[(1<<MAX_V)][MAX_V];

void compute() {
  dp[1][0] = 1;
  rep(viz,(1<<V)) {
    rep(cur,V) if( (viz>>cur) & 1 ) {
      rep(nex,V) if( !( (viz>>nex) & 1 ) ){
	if( !edge[cur][nex] ) continue;
	dp[viz|(1<<nex)][nex] += dp[viz][cur];
      }
    }
  }
  ll ans = 0;
  rep(i,V) ans += dp[(1<<V)-1][i];
  cout << ans << endl;
}

int main() {
  cin >> V >> E;
  rep(i,E) {
    int s,t;
    cin >> s >> t;
    --s, --t;
    edge[s][t] = edge[t][s] = true;
  }
  compute();
  return 0;
}




Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
template<class TH> void _dbg(const char *sdbg, TH h){ cerr<<sdbg<<'='<<h<<endl; }
template<class TH, class... TA> void _dbg(const char *sdbg, TH h, TA... a) {
  while(*sdbg!=',')cerr<<*sdbg++;
  cerr<<'='<<h<<','; _dbg(sdbg+1, a...);
}
template<class T> ostream &operator<<(ostream& os, vector<T> V) {
  os << "["; for (auto vv : V) os << vv << ","; return os << "]";
}
template<class L, class R> ostream &operator<<(ostream &os, pair<L,R> P) {
  return os << "(" << P.first << "," << P.second << ")";
}
#define debug(...) _dbg(#__VA_ARGS__, __VA_ARGS__)
typedef long long ll;
const int maxn=1e5+233;

long double n,k;
int main()
{
	ios_base::sync_with_stdio(false);
	cin>>n>>k;
	long double ans=0,tp;
	for(int i=1;i<=n;i++){
		int t=ceil(log2(k/i));
		tp=1.0;
		for(int i=1;i<=t;i++)tp*=0.5;
		ans+=tp;
	}
	ans/=n;
	cout<<setprecision(12)<<ans<<endl;
    return 0;
}




Measured memory_bytes: 512
/*https://atcoder.jp/contests/abc153/tasks/abc153_d*/
#include<bits/stdc++.h>
using namespace std;
int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
#ifndef ONLINE_JUDGE
	// for getting input from input.txt
	freopen("input.txt", "r", stdin);
	// for writing output to output.txt
	freopen("output.txt", "w", stdout);
#endif
	long long h, count = 0 , a, i;
	cin >> h;
	a = h;
	if (h > 1)
		h /= 2, count ++, i = 2;
	while (h > 1)
	{
		// cout << h << "->" << i << ":" << count << endl;
		h /= 2, count += i * 1, i *= 2;

	}
	if (h == 1 && a > 1)
		count += i * 1;
	else if (h == 1 && a <= 1)
		count++;
	cout << count;

}

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

int n;
int H[500005];

int main()
{
    cin>>n;
    int i;
    for(i=1;i<=n;i++){cin>>H[i];}
    for(i=n/2;i>0;i--){
        int j=i;
        while(j*2<=n){
            int ma=j*2;
            if(H[j*2+1]>H[j*2]&&j*2+1<=n)ma=j*2+1;
            if(H[j]<H[ma])swap(H[j],H[ma]);
            j=ma;
        }
    }
    for(i=1;i<=n;i++)cout<<" "<<H[i];
    cout<<endl;
    return 0;
}

Measured memory_bytes: 5056
#include<stdio.h>
#include<math.h>
int main(void){
 long long int i,n,k,t,m;
  int s=0;
scanf("%lld %lld",&n,&k);
for(i=0;i<n;i++){
scanf("%lld %lld",&t,&m);
if(k*k>=(t*t+m*m))s++;
}
printf("%d",s);
      return 0;
}


Measured memory_bytes: 1724
#include<bits/stdc++.h>
#define STIZE(x) fprintf(stderr, "STIZE%d\n", x);
#define PRINT(x) fprintf(stderr, "%s = %d\n", #x, x);
#define NL(x) printf("%c", " \n"[(x)]);
#define lld long long
#define pii pair<int,int>
#define pb push_back
#define fi first
#define se second
#define all(a) begin(a),end(a)
#define sz(a) int((a).size())
#define LINF 1000000000000000
#define INF 1000000000
#define EPS 1e-9
using namespace std;


int main() {
    int n; scanf("%d", &n);
    lld rez = 0;
    for(int i = 0; i < n; i++) {
        int l, r; scanf("%d%d", &l, &r);
        rez += r-l+1;
    }
    printf("%lld", rez);
    return 0;
}


Measured memory_bytes: 256
x, n = map(int, input().split())
if n == 0:
    print(x)
    exit()
    
P = set(map(int, input().split()))

d_min = 1000
ans = 1000
for num in range(-1, 102):
    if num in P:
        continue
    
    d = abs(x-num)
    if d < d_min:
        d_min = d
        ans = num

print(ans)

Measured memory_bytes: 9200
#include <iostream>
#define SIZE 200

int main(void){
  int n, a[SIZE], count = -1, i;
  bool frag = true;
  std::cin >> n;
  for(i = 0; i < n; i++) std::cin >> a[i];
  while(frag){
    for(i = 0; i < n && frag; i++){
      if(a[i] % 2 != 0) frag = false;
      a[i] /= 2;
    }
    count++;
  }
  std::cout << count << std::endl;
  return 0;
}

Measured memory_bytes: 3632
#include <vector>
#include <list>
#include <map>
#include <set>
#include <stack>
#include <algorithm>
#include <iostream>
#include <iomanip>
#include <cmath>
#include <string>

using namespace std;

//using
using VI = vector<int>;
using VVI = vector<VI>;
using VS = vector<string>;
using PII = pair<int, int>;
using LL = long long;

//repetition
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define REP(i,n)  for(int i=0;i<(n);i++)

//constant
const int INF = 1 << 29;
const double EPS = 1e-10;
const double PI = acos(-1.0);

//debug
#define dump(x)  cout << #x << " = " << (x) << endl;

int main() {
  string S;
  cin >> S;
  int n = S.length();
  int ans = 0;
  char nowColor = S[0];
  FOR(i, 1, n) {
    if (nowColor != S[i]) {
        nowColor = S[i];
        ans++;
    }
  }
  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 512
#include <iostream>
#include <iomanip>
#include <algorithm>
#include <cmath>
#include <queue>
#include <list>
#include <string>
using namespace std;
 
typedef long long ll;
typedef pair<int, int> P;
const int MOD = 998244353;

int gcd(int a, int b){
  if(b == 0) return a;
  return gcd(b, a%b);
}

int main()
{
  int count=0;
  string s;
  cin >> s;
  for(int i=0;i<s.size();i++){
    if(i % 2 == 0 && s[i] == '0') count++;
    if(i % 2 == 1 && s[i] == '1') count++;
  }
  if(count > s.size() - count) count = s.size() - count;
  cout << count;
}


Measured memory_bytes: 512
/*#include <boost/multiprecision/cpp_dec_float.hpp>
#include <boost/multiprecision/cpp_int.hpp>

#include <boost/rational.hpp>
*/
#include <bits/stdc++.h>
using namespace std;
#define _GLIBCXX_DEBUG
#define rep(i, n) for (ll i = 0; i < (ll)(n); i++)
using ll = long long;
using ld = long double;
#define rep2(i, s, n) for (ll i = (s); i < (ll)(n); i++)
#define rep3(i, n) for (ll i = 1; i < (ll)(n+1); i++)
#define rep4(i, s, n) for (ll i = (s); i < (ll)(n+1); i++)
#define repr(i,n) for (ll i = (n-1); i>=0;i--)
#define repr3(i,n) for(ll i = (n);i>0;i--)
#define repr4(i,s,n) for(ll i = (n);i>=(s);i--)
#define stlen(s) ll s.size()-1
#define all(v) v.begin(), v.end()
#define cout(n) cout<<std::fixed<<std::setprecision(n)
using Graph = vector<vector<int>>;
using Graphw = vector<vector<pair<ll,ll>>>;
#define INF1  INT_MAX;
#define INF2  LLONG_MAX;
#define PI  3.14159265358979323846;
#define MOD 1000000007;
/*
namespace mp = boost::multiprecision;
// 任意長整数型
using Bint = mp::cpp_int;
// 仮数部長が32の浮動小数点数型
using Real32 = mp::number<mp::cpp_dec_float<32>>;
// 仮数部長が1024の浮動小数点数型
using Real1024 = mp::number<mp::cpp_dec_float<1024>>;
// 有理数型
using Rat = boost::rational<Bint>;
*/
const int mod = 1000000007;




int main() {
int n;
cin>>n;
int count[26],min_count[26];
rep(i,26){
  
  min_count[i]=100;
}
rep(i,n){
  string s;
  cin>>s;
  rep(i,26){
    count[i]=0;
  }
  rep(i,s.size()){
    count[s[i]-'a']++;
  }
  rep(i,26){
    min_count[i]=min(min_count[i],count[i]);
  }

}
string ans="";
rep(i,26){
  ans+=string(min_count[i],(char)(i+'a'));
}
cout<<ans<<endl;
return 0;
}

Measured memory_bytes: 3636
#!/usr/bin/env -S JULIA_VERSION=1.4.0 julia
# contest: abc167, problem: abc167_a, alphabet: A
const YES = "Yes"
macro Y() :( println(YES); return ) end
const NO = "No"
macro N() :( println(NO); return ) end

function solve(S::String, T::String)
  length(T) == length(S)+1 && startswith(T, S) && @Y
  @N
end

function main()
  tokens = Channel{String}(32)
  Task() do
    for line in eachline(@static VERSION < v"0.6" ? STDIN : stdin)
      startswith(line, '\0') && break
      for token in split(chomp(line))
        put!(tokens, token)
      end
    end
    close(tokens)
  end |> schedule
  S = take!(tokens)
  T = take!(tokens)
  solve(S, T)
end

if isempty(get(ENV, "ATCODER_LOCAL", ""))
  isempty(ARGS) && main()
else
  @eval begin
    const samples = [("chokudai\nchokudaiz", "Yes"), ("snuke\nsnekee", "No"), ("a\naa", "Yes")]
    function test(sampleids...)
      isempty(sampleids) && return test(collect(1:length(samples))...)
      ostdin, ostdout = @static VERSION < v"0.6" ? (STDIN, STDOUT) : (stdin, stdout)
      rd, wr = first(redirect_stdout()), last(redirect_stdin())
      try
        map(sampleids) do sampleid
          input, output = samples[sampleid]
          print(ostdout, "Testing sample #$(sampleid)..."); flush(ostdout)
          println(wr, input)
          println(wr, "\0")
          t = @elapsed main()
          println()
          result = strip(String(readavailable(rd)))
          if result == output
            println(ostdout, "OK ($t sec).")
            true
          else
            println(ostdout, "ERROR ($t sec)")
            println(ostdout, "== expected ==\n$output")
            println(ostdout, "== actual ==\n$result\n")
            false
          end
        end |> all
      finally
        redirect_stdin(ostdin)
        redirect_stdout(ostdout)
      end
    end
    submit() = test() && (prog = @__FILE__; run(`atcoder-submit $prog`))
    !isinteractive() && submit()
  end
end


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

using namespace std;
#define rep(i, n) for (int i = 0; i < n; i++)
#define ll long long int
#define INF 1000000007
#define llINF 1000000000000000007
// cin.eof() 入力個数の問題

int main() {
int a;
cin >> a;
cout<<a+a*a+a*a*a<<endl;
  return 0;
}


Measured memory_bytes: 3540
#include <iostream>
#include <stdio.h>
#include <bits/stdc++.h>
#include <math.h>
using namespace std;
int gcd(int x, int y){
    if (y>x){
       swap(x,y); 
    }
    while (y!=0){
        int r=x%y;
        x=y;
        y=r;
    }
    return x;
}

int gcd3(int x, int y, int z){
    int a=gcd(x,y);
    int b=gcd(a,z);
    return b;
}
int main(){
    int sum=0;
    int k;
    cin>>k;
    for (int i=1; i<=k; i++){
        for (int j=1; j<=k; j++){
            for (int t=1; t<=k; t++){
                sum+=gcd3(i,j,t);
            }
        }
    }
    cout<<sum<<endl;
}

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

int main() {
    int n;
    cin >> n;
    for (int i = 0; i < n; i++) {
        cout << "Case " << i + 1 << ":" << endl;
        int s;
        cin >> s;
        for (int j = 0; j < 10; j++) {
            s = (s * s / 100) % 10000;
            cout << s << endl;
        }
    }
}

Measured memory_bytes: 0
#include<iostream>
#include<string>
using namespace std;
int main(){
	double a,b,c=0,d=0,i=0;
	char z;
	while(cin>>a>>z>>b){
		c+=a*b;
		d+=b;
		i++;
	}
	cout<<c<<endl;
	double e=d/i;
	e+=0.5;
	int f=e;
	cout<<f<<endl;
	return 0;
}

Measured memory_bytes: 1284
#define _USE_MATH_DEFINES

#include <iostream>
#include <iomanip>
#include <stdio.h>

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

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

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

#include <ctime>
////
//#include <random>//
/////////

typedef long long LL;
typedef long double LD;
typedef unsigned long long ULL;

////定数
const int INF = (int)1e9 + 10;
const LL MOD = (LL)1e9 + 7;
const LL LINF = (LL)4e18 + 20;
const LD PI = acos(-1.0);
const double EPS = 1e-9; 
/////////
using namespace::std;
void chmax(LL& a, LL b) {
	a = max(a, b);
}
void chmin(LL& a, LL b) {
	a = min(a, b);
}
//////////////

vector<LL> yaku(LL N) {
	vector<LL> ans;
	for (LL i = 1; i * i <= N; ++i) {
		if (N % i == 0) {
			ans.push_back(i);
			ans.push_back(N / i);
		}
	}
	return ans;
}
void solve() {
	LL N, M;
	cin >> N>>M;
	vector<LL> A = yaku(M);
	sort(A.begin(), A.end());
	reverse(A.begin(), A.end());
	int len = A.size();
	for (int i = 0; i < len; ++i) {//10^(9/2)
		LL res = M / A[i];
		if (res >= N) {
			cout << A[i] << endl;
			return;
		}
	}
}

signed main(void) {
	std::cin.tie(0);
	std::ios::sync_with_stdio(false);
	std::cout << std::fixed;//小数を10進数表示
	cout << setprecision(16);//小数点以下の桁数を指定//coutとcerrで別	

	solve();
}


Measured memory_bytes: 256
import math
import queue
import bisect
import heapq
import time
import itertools

mod = int(1e9+7)

def swap(a,b):
    return (b,a)

def gcd(a,b): #最大公約数
    if (a<b):
        a,b = swap(a,b)
    if (b==0):
        return a
    else:
        return gcd(b,a%b)

def lcm(a,b): #最小公倍数
    return a/gcd(a,b)*b

def divisors(a): # 約数列挙
    divisors = []
    for i in range(1,int(a**0.5)+1):
        if a%i==0:
            divisors.append(i)
            if i!=a//i:
                divisors.append(a//i)
    return divisors

def is_prime(a): #素数判定
    if a<2:
        return False
    elif a==2:
        return True
    elif a%2==0:
        return False
    sqrt_num = int(a**0.5)
    for i in range(3,sqrt_num+1,2):
        if a%i==0:
            return False
    return True

def prime_num(a): #素数列挙
    pn = [2]
    for i in range(3,int(a**0.5),2):
        prime = True
        for j in pn:
            if i%j==0:
                prime = False
                break
        if prime:
            pn.append(i)
    return pn

def prime_fact(a): #素因数分解
    sqrt = math.sqrt(a)
    res = []
    i = 2
    if is_prime(a):
        res.append(a)
    else:
        while a!=1:
            while a%i==0:
                res.append(i)
                a //= i
            i += 1
    return res

def main():
    x = int(input())
    if x<1200:
        print("ABC")
    else:
        print("ARC")
    return

if __name__=='__main__':
    main()


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

int main() {
	
	
	vector <int> v;
	
	for (int i = 1; i <= 9; i++)
	{
	    for (int j = 1; j <= 9; j++)
	    {
	        int ans = i * j; 
	        v.push_back (ans);
	    }
	}
	
	int n;  cin >> n;
	
	auto it = find (v.begin(),v.end(),n);
	
	if (it != v.end())  cout << "Yes";
	else                cout << "No";
	
	return 0;
}

Measured memory_bytes: 384
#include<stdio.h>
long long square(long long n)
{
    return n*n;
}
long long bigmod(long long b,long long p,long long m)
{
    //long long m=1000000007;
    if(p==0)
        return 1;
    else if(p%2==0)
        return square(bigmod(b,p/2,m))%m;
    else
        return ((b % m)*bigmod(b,p-1,m))%m;
}
main()
{
    long long b,p,m,a,i;
    while(scanf("%lld%lld",&b,&p)==2)
    {
        a=bigmod(b,p,1000000007);
        printf("%lld\n",a);
    }
    return 0;
}

Measured memory_bytes: 596
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, a, b) for (int i = a; i < b; i++)
//'A' = 65, 'Z' = 90, 'a' = 97, 'z' = 122

int main() {
    int n, a, b;
    cin >> n >> a >> b;
    int x = min(a, b);
    int y = max(0, a + b - n);

    cout << x << " " << y << endl;

    return 0;
}


Measured memory_bytes: 256
awk -F" " '
function check_number(input)
{
  for (i=1 ; i<4; i++) {
    for (j=1; j<4; j++) {
      if (input==n[i","j]) {k[i","j]=1}
    }
  }
}
{
  if (c<3) {
    c++;
    n[c","1] = $1;
    n[c","2] = $2;
    n[c","3] = $3;
  }
  else {
    check_number($1);
  };
}

END {
       if (k[1","1] * k[1","2] * k[1","3] == 1) {print "Yes";}
  else if (k[2","1] * k[2","2] * k[2","3] == 1) {print "Yes";}
  else if (k[3","1] * k[3","2] * k[3","3] == 1) {print "Yes";}
  else if (k[1","1] * k[2","1] * k[3","1] == 1) {print "Yes";}
  else if (k[1","2] * k[2","2] * k[3","2] == 1) {print "Yes";}
  else if (k[1","3] * k[2","3] * k[3","3] == 1) {print "Yes";}
  else if (k[1","1] * k[2","2] * k[3","3] == 1) {print "Yes";}
  else if (k[1","3] * k[2","2] * k[3","1] == 1) {print "Yes";}
  else {print "No";}  
}
'

Measured memory_bytes: 1560
#include<iostream>
using namespace std; //or std::cin et al.

int main() {
	int n,a;
	long long sum,min,max;
	int i;
	
	cin >> n;
	if (n != 0) {
	    cin >> a;
	    min = max = sum = a;
	}
	for ( i = 1; i < n; i++ ) {
		cin >> a;
		sum += a;
		min =  min > a?a:min;
		max =  max < a?a:max;
	}
	cout << min << " " << max << " " << sum << endl;
	
	return 0;
}


Measured memory_bytes: 3132
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
#define rep(i, n) for (int i = 0; i < (int)(n); ++i)
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;}

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    int a,b;cin>>a>>b;
    if(a>8 || b>8){
        cout<<":("<<endl;
        return 0;
    }else {
        cout<<"Yay!"<<endl;
        return 0;
    }
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using ll = int_fast64_t;
#define REP(i,b,e) for(ll i=b; i<e; i++)

int main(){
	ll x;
	scanf("%ld", &x);
	printf("%ld\n", x/11*2+(x%11>0)+(x%11>6));
	return 0;
}



Measured memory_bytes: 3720
#include <iostream>
#include <vector>
#include <queue>

using namespace std;

class store {
    public:
    long long price;
    long long number;
    store(long long a, long long b){
        price = a;
        number = b;
    }
    store(){};
};
bool operator>(const store &s1, const store &s2){
        return s1.price > s2.price;
}

int main(){
    long long n,m; cin >> n >> m;
    long long a,b;
    priority_queue<store, vector<store>, greater<store> > pq;
    for(int i=0;i<n;i++){
        cin >> a >> b;
        pq.push(store(a,b));
    }
    long long  sum = 0;
    long long  current_num = 0;
    while(!pq.empty()){
        store tmp = pq.top();
        pq.pop();
        while(m > current_num && tmp.number > 0){
            current_num++;
            tmp.number--;
            sum += tmp.price;
        }
    }
    cout << sum << endl;
}


Measured memory_bytes: 2420
import itertools, math
from functools import reduce
def gcd(*numbers):
    return reduce(math.gcd, numbers)
    
K = int(input())
if K == 1:
    print(1)
    exit()
elif K ==2:
    print(9)
    exit()
l_2 = itertools.combinations(range(1, K + 1), 2)
l_3 = itertools.combinations(range(1, K + 1), 3)
sum = int(K * (K + 1) / 2)
for x in l_2:
    sum += math.gcd(x[0], x[1]) * 6
for x in l_3:
    sum += gcd(x[0], x[1], x[2]) * 6
print(sum)

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

#define MAX_N 60

int main(){
    int a[3],i,j,k;
    char grade;
    cin>>a[0]>>a[1]>>a[2];
    while(!(a[0]==-1&&a[1]==-1&&a[2]==-1)){
        i=0;
        i=a[0]+a[1];
        if(a[0]==-1||a[1]==-1){
            grade='F';
        }
        else if(i<30){
            grade='F';
        }
        else if(i>=30&&i<50){
            if(a[2]>=50){
                grade='C';
            }
            else grade='D';
        }
        else if(i>=50&&i<65){
            grade='C';
        }
        else if(i>=65&&i<80){
            grade='B';
        }
        else grade='A';
        cout<<grade<<endl;
        cin>>a[0]>>a[1]>>a[2];
    }
    return 0;
}


Measured memory_bytes: 3112
#include <bits/stdc++.h>
using namespace std;
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define rep(i,n)   FOR(i,0,n)
#define pb emplace_back
typedef long long ll;
typedef pair<int,int> pint;

int main(){
    int a,b;
    cin>>a>>b;
    if(a<=b){
        cout<<a<<endl;
    }
    else cout<<a-1<<endl;
    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <math.h>
using namespace std;

int main(){
  int N, D;
  
  int a[21][11];
  
  cin >> N >> D;
  
  for (int i = 0; i < N; i++){
    for (int d = 0; d < D; d++){
      cin >> a[i][d];
    }
  }
  
  int counter = 0;
  
  for (int i = 0; i <N; i++){
    for (int j = 0; j< i; j++){
      int ds = 0;
      for (int d = 0; d < D; d++){
        ds +=  (a[i][d] - a[j][d]) * (a[i][d] - a[j][d]);
      }
      float d = sqrt(ds);
      if (ceil(d) == floor(d)){
        counter+=1;
      }
    }
  }
  
  cout <<  counter << endl;
  return 0;
}



Measured memory_bytes: 888
#include<stdio.h>

//数组a和b存储连接线，数组c存储岛屿。
int a[200001],b[200001],c[200001];

int main(void)
{
	int n,m,possible;
	scanf("%d %d",&n,&m);
	for(int i=0;i<n;i++) c[i]=0;
	//和1相连的岛屿都打上标记。
	for(int i=0;i<m;i++) scanf("%d %d",&a[i],&b[i]);
	for(int i=0;i<m;i++){
		if(a[i]==1) c[b[i]]=1;
	}
	//再次遍历m条线，起点打过标记同时终点是n,则为possible。
	possible=0;
	for(int i=0;i<m;i++){
		if(c[a[i]]==1&&b[i]==n){
			possible=1; 
			break;
		}
	}	
	if(possible) printf("POSSIBLE\n");
	else printf("IMPOSSIBLE\n");
	return 0;
}	


Measured memory_bytes: 2560
#include<bits/stdc++.h>
using namespace std;
constexpr int64_t mod=1e9+7;

int main()
{
  int n;
  cin>>n;
  string s;
  cin>>s;
  for(auto&& e: s) 
  {
    e+=n;
    if(e>'Z')
    {
      e='A'+e-'Z'-1;
    }
  }
  cout<<s<<endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for(int i = 0; i < (n); i++)
#define rep2(i, a, b) for(int i = (a); i < (b); i++)
typedef long long ll;

int main() {
   char c;
   cin >> c;

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

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define FOR(I,A,B) for(ll I = (A); I < (B); ++I)
#define ERASE(x) x.erase(unique(x.begin(),x.end()),x.end())
#define POSL(x,v) (lower_bound(x.begin(),x.end(),v)-x.begin()) //ai>=v
#define POSU(x,v) (upper_bound(x.begin(),x.end(),v)-x.begin()) //ai>v
#define NUM(x,v) (POSU(x,v)-POSL(x,v))
const ll INF=1e9+7;
const ll N = 200003;
ll n,m,ans=1;

int main(){
	ios::sync_with_stdio(false);
	cin.tie(0);
	cin>>n>>m;
	if(abs(n-m)>1){
		cout<<0<<endl;
		return 0;
	}
	if(n==m){
		FOR(i,0,m){
			ans*=(i+1);
			ans%=INF;
			ans*=(i+1);
			ans%=INF;
		}
		ans*=2;
		ans%=INF;
	}else{
		FOR(i,0,m){
			ans*=(i+1);
			ans%=INF;
		}
		FOR(i,0,n){
			ans*=(i+1);
			ans%=INF;
		}
	}
	cout<<ans<<endl;
	return 0;
}

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

using namespace std;

#define debug(n) cerr << #n << ':' << n << endl;
#define dline    cerr << __LINE__ << endl;

using ll = long long;
template<class T, class U> using P = pair<T,U>;
template<class T> using Heap = priority_queue<T>;
template<class T> using heaP = priority_queue<T,vector<T>,greater<T>>;
template<class T,class U> using umap = unordered_map<T,U>;
template<class T> using uset = unordered_set<T>;

template<class T>
bool ChangeMax(T&a,const T&b){
  if(a >= b) return false;
  a = b;    return true;
}

template<class T>
bool ChangeMin(T&a,const T&b){
  if(a <= b) return false;
  a = b;    return true;  
}

template<class T, size_t N, class U>
void Fill(T (&a)[N], const U&v){
    fill((U*)a,(U*)(a+N),v);
}

template<class T>
istream& operator >> (istream&is, vector<T>&v){
  for(auto&e:v)is >> e;
  return is;
}

int main(){
  int n; cin >> n;
  string s; cin >> s;
  int size = (int)s.size();
  for(int i = 0; i < size; ++i){
    char c = char(s[i]+n);
    if(c>'Z')c -= 26;
    cout << c;
  }
  cout << endl;
  return 0;
}


Measured memory_bytes: 256
{-# LANGUAGE BangPatterns #-}
{-# LANGUAGE BinaryLiterals #-}
{-# LANGUAGE MultiWayIf #-}
{-# LANGUAGE NumDecimals #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE TupleSections #-}

import Control.Applicative
import Control.Arrow
import Control.Monad
import Control.Monad.ST

import Data.Char
import Data.List
import Data.Maybe

import qualified Data.ByteString.Char8 as B

import Data.Array.ST.Safe
import Data.STRef

import Debug.Trace
import Text.Printf

readInt = readLn :: IO Int
readInts = map ( fst . fromJust . B.readInt ) . B.words <$> B.getLine
readNInts = readInt >>= flip replicateM readInt

which a b f = if f then a else b
mp [ a, b ] = ( a, b )

main = getLine >>= printf "%.12f\n" . uncurry (/) . mp . map ( read :: String -> Double ) . words

Measured memory_bytes: 508
#include<bits/stdc++.h>
using namespace std;
#define int 		  long long
#define	pb 			  push_back
#define all(a)		  (a).begin(),(a).end()
#define sz(x)		  (int)x.size()
#define endl	 	  "\n"
#define inf 		  1000000007
#define FOR(i, a, b)  for(int i=a; i<b; i++)
int dp[100011] = {0};
int r, p, s;
int fu(char st){
	if(st=='r')return p;
	else if(st=='p') return s;
	else return r;
}
void solve(){
	int n, k, res=0;
	cin>>n>>k;
	cin>>r>>s>>p;
	string g;
	cin>>g;
	FOR(i, 0, k){
		res+=fu(g[i]);
		dp[i] = res;
	}
	//cout<<dp[k-1]<<endl;
	FOR(i, k, sz(g)){
		if(g[i-k]==g[i]){
 
			dp[i] = max(dp[i-k], dp[i-1]);
			g[i]='0';
		}
		else{
			dp[i] = dp[i-1]+fu(g[i]);
		}
		//cout<<dp[i]<<" ";
	}
	cout<<dp[n-1];
}
 
signed main(){
	ios::sync_with_stdio(false);
	cin.tie(0);
	int t=1;
	//cin>>t;
	FOR(i, 1, t+1){	
	//	cout<<"Case #"<<i<<":"<<endl;
		solve();
	}
	return 0;
 
}

Measured memory_bytes: 1232
#include <iostream>
using namespace std;
typedef long long ll;

ll N,ans;

void dfs(ll value,ll a, ll b, ll c){
    if(N < value)return;
    if(a>0 && b >0 && c>0)ans++;
    dfs(10*value+3,a+1,b,c);
    dfs(10*value+5,a,b+1,c);    
    dfs(10*value+7,a,b,c+1);
    return;
}

int main(void){
    cin >> N;
    dfs(0,0,0,0);
    cout << ans << endl;
}


Measured memory_bytes: 256
#include<stdio.h>
int main(){
  int length,data[100];
  int i,flag,datai,count=0;

  //input
  scanf("%d",&length);
  
  for(i=0;i<length;i++){
    scanf("%d",&data[i]);
  }
  
  
  flag=1;
  while(flag){
    flag=0;
    
    for(i=length-1;i>0;i--){
      if(data[i] < data[i-1]){
	datai=data[i];
	data[i]=data[i-1];
	data[i-1]=datai;
	flag=1;
	count++;
      }
    }
  }


  //output
  for(i=0;i<length;i++){
    if(i+1==length){
      printf("%d",data[i]);
    }
    else{
      printf("%d ",data[i]);
    }
  }
  
  printf("\n%d\n",count);

  return 0;
}



Measured memory_bytes: 2048
def main():
    n = int(input())
    s = list(input())
    count = {"G": 0, "R":0, "B":0}
    for i in s:
        count[i] += 1
    ans = count["G"]*count["R"]*count["B"]
    for j in range(n):
        for i in range(1, n//2+1):
            if j+2*i > n-1:
                continue
            if s[j] != s[j+i] and s[j+i] != s[j+i+i] and s[j] != s[j+i+i]:
                ans -= 1
    print(ans)
    
    

if __name__ == "__main__":
    main()

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

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

int main() {
  ll n, ans = 8;
  cin >> n;
  ll t = 599;
  while (n > t) t += 200, ans--;

  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 3636
A,B,C,D,E,F = map(int,input().split())
ans = ["0","0"]
M = -1
for a in range(31):
    if F < a*A*100:
        break
    for b in range(31-a):
        if a == 0 and b == 0:
            continue
        W = (a*A+b*B)*100
        if F < W:
            break
        CD_max = min((E * W) // 100,F-W)
        for c in range(CD_max//C+1):
            d = max(0,(CD_max-c*C)//D)
            CD = c*C+d*D
            con = CD/(W+CD)
            if con > M:
                M = con
                ans = [str(W+CD),str(CD)]
print(" ".join(ans))

Measured memory_bytes: 3064