akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
#ifdef __DEBUG__
    #define DBG(X) cout << #X << " = " << (X) << endl;
    #define SAY(X) cout << (X) << endl;
#else
    #define DBG(X)
    #define SAY(X)
#endif

using namespace std;

using ll = long long int;
using ull = unsigned long long int;
using ld = long double;
using pii = pair<int, int>;
using pll = pair<ll, ll>;

int dx[]={1, 0, -1, 0, 1,-1, 1,-1};
int dy[]={0, 1, 0, -1, 1, 1,-1,-1};
const int INT_INF = (int)(2e9);
const ll  LL_INF = (ll)(2e18);

inline void fast_io() { ios_base::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr); };
template<typename T, typename S> inline ostream& operator<<(ostream& os, const pair<T, S> p) { cout << "[" << p.first << ";" << p.second << "]"; return os; }
template<typename T, typename S> inline ostream& operator<<(ostream& os, const map<T, S> p) { for (auto el : p) cout << "[" << el.first << ";" << el.second << "]"; return os; }
template<typename T> inline ostream& operator<<(ostream& os, const vector<T>& v) { for (auto el : v) cout << el << " "; return os; }
template<typename T> inline ostream& operator<<(ostream& os, const deque<T>& v) { for (auto el : v) cout << el << " "; return os; }
template<typename T> inline ostream& operator<<(ostream& os, const set<T>& v) { for (auto el : v) cout << el << " "; return os; }
template<typename T> inline vector<T> fetch_vec(int sz) { vector<T> ret(sz); for (auto& elem : ret) cin >> elem; return ret; }

int a,b,c,d;
void input(){
    fast_io();
    cin >> a >> b >> c >> d;
}

int solve(){
    cout << max(a*b,c*d) << endl;
    return 0;
}   

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

Measured memory_bytes: 256
include Math

if __FILE__==$0
	inf=Float::INFINITY
	
	readln_i=lambda{|dl|fp.gets.chomp.split(dl).map(&:to_i)}
	read_i=lambda{fp.gets.chomp.to_i}
	readln_s=lambda{|dl|gets.chomp.split(dl)}
	read_s=lambda{fp.gets.chomp}
	
	str=readln_s[""]
	
	cr=Array.new(26){0}
	rt=97
	
	for c in str
		cr[c.ord-rt]+=1
	end
	
	cnt=0
	idx=0
	
	while cr[idx]!=0 && idx<26
		idx+=1
	end
	
	if idx<26
			puts (idx+rt).chr
	else
		puts "None"
	end
end

Measured memory_bytes: 6908
package main

import (
	"fmt"
	"math"
)

func main() {
	input := scanNums(2)
	L := int64(input[0])
	R := int64(input[1])

	var minNum int64 = math.MaxInt64
	for i := L; i <= R; i++ {
		for j := i+1; j <= R; j++ {
			minNum = minInt64(minNum, (i*j)%2019)
			if minNum == 0 {
				fmt.Print(minNum)
				return
			}
		}
	}
	fmt.Print(minNum)
	return
}

func minInt64(x, y int64) int64 {
	if x < y {
		return x
	}
	return y
}
func scanNums(len int) (nums []int) {
	var num int
	for i := 0; i < len; i++ {
		fmt.Scan(&num)
		nums = append(nums, num)
	}
	return
}


Measured memory_bytes: 512
#include <string>
#include <vector>
#include <algorithm>
#include <numeric>
#include <set>
#include <map>
#include <queue>
#include <iostream>
#include <sstream>
#include <cstdio>
#include <cmath>
#include <ctime>
#include <cstring>
#include <cctype>
#include <cassert>
#include <limits>
#include <functional>
#include <complex>
#define rep(i,n) for(int (i)=0;(i)<(int)(n);++(i))
#define rer(i,l,u) for(int (i)=(int)(l);(i)<=(int)(u);++(i))
#define reu(i,l,u) for(int (i)=(int)(l);(i)<(int)(u);++(i))
#if defined(_MSC_VER) || __cplusplus > 199711L
#define aut(r,v) auto r = (v)
#else
#define aut(r,v) __typeof(v) r = (v)
#endif
#define each(it,o) for(aut(it, (o).begin()); it != (o).end(); ++ it)
#define all(o) (o).begin(), (o).end()
#define pb(x) push_back(x)
#define mp(x,y) make_pair((x),(y))
#define mset(m,v) memset(m,v,sizeof(m))
#define INF 0x3f3f3f3f
#define INFL 0x3f3f3f3f3f3f3f3fLL-1
double EPS=1e-9;
using namespace std;
typedef vector<int> vi; typedef pair<int, int> pii; typedef vector<pair<int, int> > vpii; typedef long long ll;
typedef complex<double> P;
template<typename T, typename U> inline void amin(T &x, U y) { if(y < x) x = y; }
template<typename T, typename U> inline void amax(T &x, U y) { if(x < y) x = y; }
int n,k;
int cnt[27]={0};
int main(){
	cin>>n>>k;
	string str;
	for(int i=0;i<n;i++){
		cin>>str;
		int x=str[0]-'A';
		cnt[str[0]-'A']++;
	}
	int ans=0;
	while(1){
		int ccnt=0;
		sort(cnt,cnt+27);
		for(int i=26;i>=0;i--){
			if(cnt[i]!=0&&ccnt!=k)cnt[i]--,ccnt++;
		}
		if(ccnt==k)ans++;
		else break;
	}
	cout<<ans<<endl;
}

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

using namespace std;
 
int main() {
  char x,y;
  cin >> x >> y;
  if(x>y){
	  cout << ">";
  }else if(x<y){
	  cout << "<";
  }else{
	  cout << "=";
  }
  return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <cmath>
#define NMAX 2005
#define VALMAX 1000000002
using namespace std;

int v[ NMAX ], n, a, b, i, ultima, mn, mx, ans1,ans2, ans3, ans4, ans5, ans6;

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

    for ( i = 1; i <= n; i ++ )
        cin >> v[ i ];

    if( n == 1 )
        cout << abs ( v[ n ] - b );
    else
        cout << max( abs ( v[ n ] - v[ n - 1 ] ) , abs( v[ n ] - b ) );
}


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

int main() {
    ios::sync_with_stdio(0); cin.tie(0);
    int n;
    cin >> n;
    vector<int> h(n + 1), dp(n + 1);
    for(int i = 1; i <= n; ++i)
        cin >> h[i];
    dp[1] = 0;
    dp[2] = abs(h[1] - h[2]);
    for(int i = 3; i <= n; ++i)
        dp[i] = min(dp[i - 1] + abs(h[i] - h[i - 1]),
                    dp[i - 2] + abs(h[i] - h[i - 2]));
    cout << dp[n] << '\n';
}

Measured memory_bytes: 1024
n=int(input())
a=[]
for i in range(n):
    b=input()
    b=sorted(b)
    b=' '.join(b)
    b=b.replace(" ","")
    a.append(b)
import collections
c=collections.Counter(a)
c=list(c.values())
ans=0
import math
def combinations_count(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))
for i in c:
    if i>=2:
        ans+=combinations_count(i,2)
print(ans)

Measured memory_bytes: 19792
import math



def main():
    k = int(input())
    total = 0

    for a in range(1,k+1):
        for b in range(1,k+1):
            for c in range(1,k+1):
              temp = math.gcd(a,b)
              total += math.gcd(temp,c)
    print(total)


if __name__ == '__main__':
    main()


Measured memory_bytes: 9180
def examA():
    N, M = LI()
    if N==M:
        print("Yes")
    else:
        print("No")
    return

def examB():
    ans = 0
    print(ans)
    return

def examC():
    ans = 0
    print(ans)
    return

def examD():
    ans = 0
    print(ans)
    return

def examE():
    ans = 0
    print(ans)
    return

def examF():
    ans = 0
    print(ans)
    return

import sys,copy,bisect,itertools,heapq,math
from heapq import heappop,heappush,heapify
from collections import Counter,defaultdict,deque
def I(): return int(sys.stdin.readline())
def LI(): return list(map(int,sys.stdin.readline().split()))
def LSI(): return list(map(str,sys.stdin.readline().split()))
def LS(): return sys.stdin.readline().split()
def SI(): return sys.stdin.readline().strip()
global mod,mod2,inf,alphabet
mod = 10**9 + 7
mod2 = 998244353
inf = 10**18
alphabet = [chr(ord('a') + i) for i in range(26)]

if __name__ == '__main__':
    examA()

"""

"""

Measured memory_bytes: 3700
#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<iomanip>
#include<math.h>
#include<complex>
#include<queue>
#include<deque>
#include<stack>
#include<map>
#include<set>
#include<bitset>
#include<functional>
#include<assert.h>
#include<numeric>
using namespace std;
#define REP(i,m,n) for(int i=(int)(m) ; i < (int) (n) ; ++i )
#define rep(i,n) REP(i,0,n)
using ll = long long;
const int inf=1e9+7;
const ll longinf=1LL<<60 ;
const ll mod=1e9+7 ;
struct edge{int to;ll cap;int rev;};
using namespace std;

int main(){
    string s;
    int n,k;
    cin>>n>>k;
    cin>>s;
    int score = 0;
    rep(i,n-1) if(s[i] == s[i+1]) score++;
    cout<<min(score+2*k,n-1)<<endl;
  return 0;
}

Measured memory_bytes: 512
#include <iostream>
#include<string>
#include<list>
#include<algorithm>
#include<cstdio>
using namespace std;


int main(){
    
    int n,t;
    cin>>n;
    list<int> V;
    string com;
    for(int i=0;i<n;i++){
        
        cin>>com;
        
        if(com[0]=='i'){
            cin>>t;
            V.push_front(t);
            
        }else if(com[6]=='F'){
                V.pop_front();
                //deleteLast
        }else if(com[6]=='L'){
                V.pop_back();
        }else if(com[0]=='d'){
                cin>>t;
                for(list<int>::iterator it = V.begin();it!=V.end();it++){
                    if(*it==t){
                        V.erase(it);
                        break;
                    }
                }
            }
    }
    int i=0;

    for(list<int>::iterator it = V.begin();it != V.end();it++){
       if(i++) printf(" ");
        printf("%d",*it);
        }
        
    
    printf("\n");




return 0;
}



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

using lint = long long int;
using pint = pair<int, int>;
using plint = pair<lint, lint>;
#define ALL(x) (x).begin(), (x).end()
#define SZ(x) ((lint)(x).size())
#define POW2(n) (1LL << (n))
#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)

unsigned GetDigit(unsigned num)
{
    unsigned digit = 0;
    while (num != 0)
    {
        num /= 10;
        digit++;
    }
    return digit;
}

int main()
{

    lint n;
    cin >> n;
    lint ans=0;

    REP(i, n)
    {
        if(GetDigit(i+1)%2==1){
            ans += 1;
        }
    }

    cout << ans <<"\n";

    return 0;
}

Measured memory_bytes: 256
I = list(map(int, input().split()))
N, K = I[0], I[1]
S = input()

count = 0
flag = False

for i in range(N):
    if i == N-1:
        pass
    elif S[i] == S[i+1]:
        count += 1

need = (N - 1 - count) // 2
if (N - 1 - count) % 2 == 1:
    flag = True

if K > need:
    if flag:
        result = count + need * 2 + 1
    else:
        result = count + need * 2
else:
    result = count + K * 2

print(result)

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

using namespace std;

#define ll long long
#define endl '\n'

int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    long double l;
    cin >> l;
    cout << fixed << setprecision(12) << pow(l, 3) / 27 << endl;
    return 0;
}

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

int main(){
  int n,k;
  cin >> n >> k;
  
  vector<int> a(n);
  vector<int> cnt(n);
  
  for (int i=0; i<n; i++){
    cin >> a.at(i);
    cnt.at(a.at(i)-1)++;
  }
  
  sort(cnt.begin(),cnt.end());
  
  int res = 0;
  
  for (int i=0; i<n-k; i++){
    res += cnt.at(i);
  }
  
  cout << res << endl;
}

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

using namespace std;

int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int N, M;
  cin >> N >> M;
  vector<int> P(M), Y(M);
  for (int i = 0; i < M; i++) {
    cin >> P[i] >> Y[i];
  }

  map<int, int> cnt;
  vector<int> idx(M);
  for (int i = 0; i < M; i++) {
    idx[i] = i;
  }
  sort(idx.begin(), idx.end(), [&](int a, int b) { return Y[a] < Y[b]; });

  vector<pair<int, int>> res(M);
  for (int i = 0; i < M; i++) {
    int j = idx[i];
    res[j] = make_pair(P[j], cnt[P[j]]++);
  }

  for (int i = 0; i < M; i++) {
    cout << setfill('0') << right << setw(6) << res[i].first << setw(6)
         << res[i].second + 1 << '\n';
  }
  return 0;
}


Measured memory_bytes: 8192
#include<iostream>
#include<cstdio>
#include <cstring>
#include<map>
#include<string>
#include<stack>
#include <algorithm>
#include <sstream>
#include<vector>
#include<map>
#include<cmath>
using namespace std;

int StringToInt(string str)
{
            stringstream ss(str);
             int i;
             ss >> hex >> i;
             return i;
}


int main(){
	int n;
	while(cin>>n)
	{
	n=n%39;
	if(n==0)puts("3C39");
	else if(0<=n &&n<=9) cout<<"3C0"<<n<<endl;
	else cout<<"3C"<<n<<endl;
	}

	return 0;
}

Measured memory_bytes: 1164
#include <iostream>
#include<stdio.h>
#include<cstring>
#include<algorithm>
using namespace std;
typedef long long ll;
#define MAX 1000000

bool is_prime[MAX];
ll prime[MAX];

ll found(ll a)
{
    ll p=0;
    for(ll i=0;i<=a;i++)
    {
        is_prime[i]=true;
    }
    is_prime[0]=false;
    is_prime[1]=false;
    for(ll i=2;i<=a;i++)
    {
        if(is_prime[i])
        {
            prime[p++]=i;
            for(ll k=2*i;k<=a;k=k+i)
            {
                is_prime[k]=false;
            }
        }
    }
    return p;
}

int main()
{
    ll n;
    while(cin>>n)
    {
        ll q;
        q=found(n);
        cout<<q<<endl;
    }
    return 0;
}



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

int main() {
	int s;
	cin >> s;
	int a[100100];
  	bool dp[100100] = {false};
  
	for (int i = 1; ; i++) {
		if (i == 1) a[i] = s;
		else {
			if (a[i - 1] % 2 == 0) a[i] = a[i - 1] / 2;
			else a[i] = 3 * a[i - 1] + 1;
			if (dp[a[i]] == 1) {
				cout << i << endl;
				return 0;
			}
		}
		dp[a[i]] = 1;
	}
	
}

Measured memory_bytes: 384
#include<bits/stdc++.h>
using namespace std;
int main(){
  string S;
  cin>>S;
  int k=1;
  bool bo=true;
  for(int i=1;i<S.size();i++){
    if((bo && S[i]==S[i-1]) || (i==S.size()-2 && S[i]==S[i+1])){
      bo=false;
      i++;
    }else
      bo=true;
    k++;
  }
  cout<<k<<endl;
}

Measured memory_bytes: 3752
#include <iostream>
using namespace std;
 
int main()
{
  int k;
  cin>>k;
  string s;
  cin>>s;
  string end;
  if(k>=s.size())
  {
    cout<<s<<endl;
    return 0;
  }
  else
  {
    for (int i = 0; i < k; i++)
    {
      end+=s[i];
    }
    end+="...";
    cout<<end<<endl;
    return 0;
  }
}

Measured memory_bytes: 3056
n,m,x=map(int,input().split())
a=list(map(int,input().split()))
ans_1=0
ans_2=0
for i in range(x):
    if i in a:
        ans_1+=1
for i in range(x,n):
    if i in a:
        ans_2+=1
print(min(ans_1,ans_2))

Measured memory_bytes: 9092
using namespace std;

#include <iostream>
#include <cstdlib>
#include <algorithm>
#include <cmath>
#include <limits>
#include <climits>
#include <vector>
#include <string>
#include <set>
#include <queue>
#include <stack>
#include <map>
#include <numeric>
typedef long long ll;
typedef pair<int,int> p;

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


int main()
{
  string s1,s2;
  cin >> s1 >> s2;
  for (int i = 0; i < int(s1.size()); i++)
  {
    if (int(s1.size()) == int(s2.size())+1 && i == int(s1.size()) - 1)
    {
      cout << s1[i] << endl;
      return 0;
    }
    cout << s1[i] << s2[i];
  }
  cout << endl;
}


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

#define all(x) (x).begin(),(x).end()
#define init() \
  ios::sync_with_stdio(false); \
  cin.tie(0)

#define MOD 1000000007

using namespace std;

using ll = long long;
using ull = unsigned long long;

template<typename M, typename N>
constexpr common_type_t<M, N> gcd(M a, N b) {
  return a == 0 ? b
    : b == 0 ? a
    : gcd(b, a % b);
}

template <typename M, typename N>
constexpr common_type_t<M, N> lcm(M a, N b) {
  return a * b / gcd(a, b);
}

template <long long MAX>
class CombinationCalculator {
  long long mod_;
  long long fac[MAX];
  long long finv[MAX];
  long long inv[MAX];

public:
  CombinationCalculator(long long mi = MOD): fac(), finv(), inv() {
    mod_ = mi;
    fac[0] = fac[1] = 1;
    finv[0] = finv[1] = 1;
    inv[1] = 1;
    for (int i = 2; i < MAX; i++) {
      fac[i] = fac[i - 1] * i % mod_;
      inv[i] = mod_ - inv[mod_ % i] * (mod_ / i) % mod_;
      finv[i] = finv[i - 1] * inv[i] % mod_;
    }
  }

  long long c(long long n, long long k) const {
    if (n < k) return 0;
    if (n < 0 || k < 0) return 0;
    return fac[n] * (finv[k] * finv[n - k] % mod_) % mod_;
  }
};

template <long long MAX = 210000>
using CC = CombinationCalculator<MAX>;

template<typename T>
T modpow(T a, T n, T mod = MOD) {
    T res = 1;
    while (n > 0) {
        if (n & 1) res = res * a % mod;
        a = a * a % mod;
        n >>= 1;
    }
    return res;
}

template<typename T>
T modinv(T a, T m = MOD) {
    T b = m, u = 1, v = 0;
    while (b) {
        T t = a / b;
        a -= t * b; swap(a, b);
        u -= t * v; swap(u, v);
    }
    u %= m; 
    if (u < 0) u += m;
    return u;
}

/*
ll solve(ll h) {
  if (h <= 1) {
    return 1;
  }
  return solve(h / 2) + solve(h / 2) + 1;
}
*/

ll solve(ll h) {
  ll res = 0;
  ll pow = 1;
  while (h > 1) {
    res += pow;
    pow *= 2;
    h /= 2;
  }
  res += pow;
  return res;
}

int main() {
  init();

  ll h;
  cin >> h;

  cout << solve(h) << '\n';

  return 0;
}


Measured memory_bytes: 256
#include <stdio.h>

int A[500000];
int num;

void maxHeapify(int A[],int i){
  int tmp,largest,l,r;

  l = i*2;
  r = i*2+1;

  if (l <= num && A[l] > A[i])largest = l;
  else  largest = i;
  if (r <= num && A[r] > A[largest]) largest = r;
  if (largest != i){
    tmp = A[i];
    A[i] = A[largest];
    A[largest] = tmp;
    maxHeapify(A,largest);
  }
}


int main(){
  int i;
  scanf("%d",&num);
  for(i=1;i<=num;i++){
    scanf("%d",&A[i]);
  }
  for( i = num/2 ; i >0;i--){
    maxHeapify(A,i);
  }
  for(i = 1;i<=num;i++){
    printf(" %d",A[i]);
  }
  // printf("%d",A[num]);
  printf("\n");
  return 0;

}

Measured memory_bytes: 2552
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <cmath>
#define ll long long int
#define mod 1000000007
#define pii pair<int, int>
#define fr(n) for (int i = 0; i < n; i++)
#define fr1(n) for (int i = 1; i <= n; i++)
using namespace std;

int main() {
    ios::sync_with_stdio(false);
    string s;
    cin >> s;
    int i = 0, j = (int)s.length() - 1;
    while (s[i] != 'A') i++;
    while (s[j] != 'Z') j--;
    cout << j - i + 1;
}

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

/*第二引数で第一引数を割ったときの切り上げの計算*/
long long int maxtime(long long int x, long long int y) {
	return(x + y - 1) / y;

}
/*最大公約数*/
long long int lcm(long long int number1, long long int number2) {
	long long int m = number1;
	long long int n = number2;

	if (number2 > number1) {
		m = number2;
		n = number1;
	}
	long long int s = -1;
	while (s != 0) {
		s = m % n;
		m = n;
		n = s;
	}
	return m;
}
/*最大公倍数*/
long long int gcd(long long int number1, long long int number2) {
	long long int m = number1;
	long long int n = number2;
	return m / lcm(m, n) * n;
}
int dp[120][10200] = {};
int main() {
	string t;
	cin >> t;
	char a = '!';
	char b = '!';
	for (int i = 0; i < t.size(); i++) {
		if (b == t[i]) {
			cout << i << " " << i + 1;
			return 0;
		}
		if (a == t[i]) {
			cout << i - 1 << " " << i + 1;
			return 0;
		}
		a = b;
		b = t[i];
	}
	cout << -1 << " " << -1;
}

Measured memory_bytes: 512
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <map>
#include <set>
#include <cmath>
#include <random>
#include <queue>
#include <sstream>
#include <iomanip>

using namespace std;

using Graph = vector<vector<int> >;

vector<int> seen;



int main()
{
	int N;

	cin >> N;

	vector<int> Ls(N);

	for (int ni = 0; ni < N; ni++) {
		cin >> Ls[ni];
	}

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


	int add;
	long long cnt = 0;
	int cs,ce;
	for (int ai = 0; ai < N - 2; ai++) {
		for (int bi = ai + 1; bi < N - 1; bi++) {
			add = Ls[ai] + Ls[bi];
			cs = bi + 1;
			ce = upper_bound(Ls.begin(), Ls.end(), add-1 ) - Ls.begin();
			cnt += max(0,ce - cs);
	
			/*
			for (int ci = bi + 1; ci < N; ci++) {
				if (Ls[ci] < add) {
					cnt++;
				}
				else {
					break;
				}
			}
			*/
		}
	}


	//printf("%d %d %lld", xi, yi, H + gap);

	cout << cnt;


	return 0;
}



Measured memory_bytes: 256
#include <iostream>
#include <iomanip>
#include <cmath>

using namespace std;
  
int main()
{
  int n;
  cin >> n;

  int x[n], y[n];

  // input
  for(int i=0; i<n; i++){
    cin >> x[i];  }
  for(int i=0; i<n; i++){
    cin >> y[i];  }

  // calculation
  double D, sum;

  
  for(int p=1; p<=3; p++){
    sum = 0;

    for(int i=0; i<n; i++){
      sum += pow(  abs(x[i]-y[i]) ,  p);  } // end i loop

    D = pow( sum , 1.0 / p);
     cout << fixed << setprecision(6) << D << endl;
  }// end p loop (1,2,3)

  double max = 0;
  for(int i=0; i<n; i++){
    int tmp = abs(x[i] - y[i]);
    if(tmp > max)
      {max = tmp;}
  }
  cout << fixed << setprecision(6) << max << endl;

      return 0;
}



Measured memory_bytes: 3464
#include<bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i = 0; i < (int)(n); i++)
#define all(x) (x).begin(),(x).end() //使うときはsort(all())という感じで
using ll = long long;
#define PI 3.14159265359

int main(){
  int n;
  vector<int> a(9);
  vector<bool> ju(9,false);
  rep(i,9){
    cin>>a[i];
  }
  cin>>n;
  rep(i,9){
    int b;
    cin>>b;
    rep(j,9){
      if(b==a[j]) ju[j]=true;
    }
  }
  if(ju[0]&&ju[1]&&ju[2]){
    cout<<"Yes"<<endl;
  	return 0;
  }
  if(ju[3]&&ju[4]&&ju[5]){
    cout<<"Yes"<<endl;
  	return 0;
  }
  if(ju[6]&&ju[7]&&ju[8]){
    cout<<"Yes"<<endl;
  	return 0;
  }
  if(ju[0]&&ju[3]&&ju[6]){
    cout<<"Yes"<<endl;
  	return 0;
  }
  if(ju[1]&&ju[4]&&ju[7]){
    cout<<"Yes"<<endl;
  	return 0;
  }
  if(ju[2]&&ju[5]&&ju[8]){
    cout<<"Yes"<<endl;
  	return 0;
  }
  if(ju[0]&&ju[4]&&ju[8]){
    cout<<"Yes"<<endl;
  	return 0;
  }
  if(ju[2]&&ju[4]&&ju[6]){
    cout<<"Yes"<<endl;
  	return 0;
  }
  cout<<"No"<<endl;
  return 0;
}

Measured memory_bytes: 256
import bisect

primes = [0, 0] + [1] * 999999
for i in range(2, 1000):
    if primes[i]:
        for j in range(i*i, 1000000, i):
            primes[j] = 0

primes = [i for i, v in enumerate(primes) if v]
while True:
    try:
        n = int(input())
    except:
        break
    print(bisect.bisect(primes, n))



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

int dpTable[2][100];

void dp(vector<vector<int>>& a, int n) {
  for (int i = 0; i < 2; ++i) {
    for (int j = 0; j < n; ++j) {
      if (i == 0 && j == 0) {
        continue;
      }
      dpTable[i][j] = a[i][j] +
        max(dpTable[max(i - 1, 0)][j], dpTable[i][max(j - 1, 0)]);
    }
  }
}

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

  for (int i = 0; i < 2; ++i) {
    for (int j = 0; j < n; ++j) {
        dpTable[i][j] = 0;
    }
  }
  dpTable[0][0] = a[0][0];
  dp(a, n);
  cout << dpTable[1][n - 1] << endl;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define all(vec) vec.begin(), vec.end()
#define pb push_back
#define eb emplace_back
#define fi first
#define se second
using namespace std;
using ll = long long;
using P = pair<ll, ll>;
template <class T>
using V = vector<T>;
template <class T>
inline void chmin(T &a, const T &b) { a = min(a, b); }
template <class T>
inline void chmax(T &a, const T &b) { a = max(a, b); }
template <class T>
inline bool kbit(const T &x, const int &k) { return ((x >> k) & 1LL); }
inline int popcount(const int &n) { return __builtin_popcount(n); }
inline ll popcountll(const ll &n) { return __builtin_popcountll(n); }
inline ll mask(const ll &k) { return (1LL << k) - 1LL; }
template <class T>
void zip(V<T> &v) {
    sort(all(v));
    v.erase(unique(all(v)), v.end());
}
template <class T>
int lwb(V<T> &v, const T &x) { return lower_bound(all(v), x) - v.begin(); }
void dump() {
    cerr << '\n';
}
template <class Head, class... Tail>
void dump(Head &&head, Tail &&... tail) {
    cerr << head << (sizeof...(Tail) == 0 ? " " : ", ");
    dump(std::move(tail)...);
}
template <class T>
void print(const vector<T> &v) {
    for (int i = 0; i < v.size(); i++) cout << v[i] << (i + 1 == v.size() ? '\n' : ' ');
}
template <class T>
void read(vector<T> &v) {
    for (int i = 0; i < v.size(); i++) cin >> v[i];
}
constexpr char sp = ' ', newl = '\n';
constexpr int dx[4] = {0, 1, 0, -1}, dy[4] = {1, 0, -1, 0};
constexpr ll INF = (1LL << 60) - 1LL;
constexpr ll MOD = 1e9 + 7;
//////////////////////////////////////////////INSERT ABOVE HERE
int main() {
    ios::sync_with_stdio(0);
    cin.tie(0);
    int l, r, d;
    cin >> l >> r >> d;
    int res = 0;
    for (int i = l; i <= r; i++) res += (i % d == 0);
    cout << res << newl;
}

Measured memory_bytes: 3648
import sys

sys.setrecursionlimit(10 ** 6)
INF = float("inf")
MOD = 10 ** 9 + 7


def input():
    return sys.stdin.readline().strip()


def main():
    x, y = map(int, input().split())
    if x == 0:
        if y >= 0:
            print(y - x)
        else:
            print(-y + 1)
    elif y == 0:
        if x >= 0:
            print(x + 1)
        else:
            print(-x)
    elif 0 < x < y:
        print(y - x)
    elif 0 < y < x:
        print(2 + x - y)
    elif x < y < 0:
        print(y - x)
    elif y < x < 0:
        print(x - y + 2)
    elif x < 0 < y:
        print(abs(abs(x) - abs(y)) + 1)
    else:
        print(abs(abs(x) - abs(y)) + 1)


if __name__ == "__main__":
    main()


Measured memory_bytes: 3064
#ifdef _DEBUG
#include "MyLib.h"
#else
#define main_D main
#include "bits/stdc++.h" 
#include <regex>
#define _USE_MATH_DEFINES
#include <math.h>
#define FOR(i,s,e) for (int i = int(s); i < int(e); ++i)
#define REP(i,e) FOR(i,0,e)
#define INF (INT_MAX/2)
#define EPS (1.0e-8)
#define LINF (LLONG_MAX/2)
const int MGN = 10;
const int ARY_SZ_MAX = 10000000;
using namespace std;
using ll = long long; using ull = unsigned long long;
using vi = vector<int>; using vvi = vector<vi>; using vvvi = vector<vvi>;
using vb = vector<bool>; using vvb = vector<vb>; using vvvb = vector<vvb>;
using vl = vector<ll>; using vvl = vector<vl>;
using vd = vector<double>; using vs = vector<string>;
using pii = pair<int, int>; using pll = pair<ll, ll>;
using psi = pair<string, int>;
// functions

#endif 


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

    int N, M; cin >> N >> M;
    vl A(N); REP(i, N) cin >> A[i];

    priority_queue<ll> pq;
    REP(i, N) pq.push(A[i]);

    REP(i,M) {
        ll hi = pq.top(); pq.pop();
        hi /= 2;
        pq.push(hi);
    }

    ll ans = 0;
    while(!pq.empty()) {
        ans += pq.top(); pq.pop();
    }

    cout << ans << endl;


    return 0;
}

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

string print_LCS(string s, string t)
{ 
  int m = s.length();
  int n = t.length();
  
  int i,j;
  
  int lcs[m+1][n+1];
  
  for(i=0; i<=m; i++)
  {
    for(j=0; j<=n; j++)
    {
      if(i==0 || j==0)
        lcs[i][j] = 0;
      else if(s[i-1] == t[j-1])
        lcs[i][j] = 1 + lcs[i-1][j-1];
      else
         lcs[i][j] = max(lcs[i-1][j], lcs[i][j-1]);
    }
  }
  
  
  string ans = "";
  
  i = m, j = n; 
  while(i>0 && j>0)
  {
    if(s[i-1] == t[j-1])
    {
      ans = t[j-1] + ans;
      i--;
      j--;
    }
    else if(lcs[i-1][j] > lcs[i][j-1])
      i--;
    else
      j--;
  }
  
  //cout << lcs[m][n] << endl;
  
  return ans;
  
}

int main()
{
  string s,t;
  cin >> s >> t;
  
  cout << print_LCS(s, t) << endl;
  
  return 0;
}

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

public class Main {
	public static void main(String[] args) {
		BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
    
		String x = "";
		try {
			x = in.readLine();
		} catch (NumberFormatException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		
		double r = Double.parseDouble(x);

		String ans = String.format("%f %f", r * r * Math.PI, 2 * r * Math.PI);
		System.out.println(ans);
	}
}

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

int main() {
    string sa,sb,sc;cin>>sa>>sb>>sc;
    
    int i=0;
    int j=0;
    int k=0;
    
    string tmp = "a";
    
    while(true){
        
        if(tmp[0]=='a'){
            tmp = sa[i];
            ++i;
        }
        if(tmp[0]=='b'){
            tmp = sb[j];
            ++j;
        }
        if(tmp[0]=='c'){
            tmp = sc[k];
            ++k;
        }
        if(i==sa.size()+1){
            cout<<'A'<<endl;
            return 0;
        }
        if(j==sb.size()+1){
            cout<<'B'<<endl;
            return 0;
        }
        if(k==sc.size()+1){
            cout<<'C'<<endl;
            return 0;
        }
    }
	return 0;
}

Measured memory_bytes: 3608
x,y=map(int,input().split())
if x==2 or y==2:
    print("No")
elif x in [4,6,9,11] and y in [4,6,9,11]:
    print("Yes")
elif x in [1,3,5,7,8,10,12] and y in [1,3,5,7,8,10,12]:
    print("Yes")
else:
    print("No")

Measured memory_bytes: 38256
#include<bits/stdc++.h>
using namespace std;
#define ll long long int
#define md 1000000007
#define pb emplace_back
typedef vector<int> vi;
int n,w;
void solve(){
cin>>n>>w;
char in[n][w];
int dp[n][w];
memset(dp,0,sizeof dp);
for(int i=0;i<n;i++){
	for(int j=0;j<w;j++){
		cin>>in[i][j];
	}
}
for(int i=0;i<n;i++){
	if(in[i][0]=='#')
	break;
	dp[i][0]=1;
}
for(int i=0;i<w;i++){
if(in[0][i]=='#')
break;
dp[0][i]=1;
}
for(int i=1;i<n;i++){
	for(int j=1;j<w;j++){
		if(in[i][j]!='#'){
			dp[i][j]=dp[i][j-1]%md+dp[i-1][j]%md;
			dp[i][j]=dp[i][j]%md;
		}
		else{
			dp[i][j]=0;
		}
	}
}
cout<<dp[n-1][w-1]<<"\n";
}
int main(){
ios::sync_with_stdio(false);
cin.tie(0);
  int t=1;
  //cin>>t;
  while(t--){
  	solve();
  }
} 

Measured memory_bytes: 8476
#include <stdio.h>

typedef struct{
  char a;
  int b;
}trump;

void BubbleSort(trump card[],int n){
  int i,j;
  trump temp;

  for(i=0;i<n;i++){
    for(j=n-1;j>i;j--){
      if(card[j-1].b>card[j].b){
        temp=card[j];
        card[j]=card[j-1];
        card[j-1]=temp;
      }
    }
  }
  for(i=0;i<n;i++){
    if(i>0)printf(" ");
    printf("%c%d",card[i].a,card[i].b);
  }
  printf("\n");
}

void SelectionSort(trump card[],int n){
  int i,min,j;
trump temp;

  for(i=0;i<n;i++){
    min=i;
    for(j=i+1;j<n;j++){
      if(card[j].b<card[min].b){
        min=j;
      }
    }
    temp=card[i];
    card[i]=card[min];
    card[min]=temp;
  }
  for(i=0;i<n;i++){
    if(i>0)printf(" ");
    printf("%c%d",card[i].a,card[i].b);
  }
  printf("\n");
}

int main(void){
  int n,i,flag;
  trump card_1[36]={},card_2[36]={};

  scanf("%d",&n);

  for(i=0;i<n;i++){
    scanf(" %c%d",&card_1[i].a,&card_1[i].b);
    card_2[i].a=card_1[i].a;
    card_2[i].b=card_1[i].b;
    //printf("%c%d\n",card_2[i].a,card_2[i].b);
  }

  BubbleSort(card_1,n);
  printf("Stable\n");
  SelectionSort(card_2,n);
  for(i=0;i<n;i++){
    if(card_2[i].a!=card_1[i].a){
      flag=0;
      break;
    }
    else flag=1;
  }
  if(flag==0)printf("Not stable\n");
  if(flag==1)printf("Stable\n");

  return 0;
}

Measured memory_bytes: 1848
#include <stdio.h>
#include <string.h>

/* prototype declaration */
char convCap(char lower);

int main(int argc, const char *argv[])
{
	int ch = getchar();
	while(ch != '\n'){
		printf("%c",convCap(ch));
		ch = getchar();
	}
	printf("\n");
	return 0;
}

char convCap(char lower)
{
	if('a' <= lower && lower <= 'z') return lower-32;
	else return lower;
}

Measured memory_bytes: 0
n, x = map(int, input().split())
l = list(map(int, input().split()))
d = [0] * (n+2)
count = 1
for i in range(1, n+1):
    d[i] = d[i-1] + l[i-1]
    if d[i] <= x:
        count += 1
print(count)

Measured memory_bytes: 3060
def print_list(nums):
    output = ""
    for i in nums:
        output += str(i) + ' '
    print(output[:-1])

from sys import stdin
N = int(input())
nums = list(map(lambda x:int(x), stdin.readline().split(' ')))
for i in range(1, N):
    print_list(nums)
    num = nums[i]
    for j in range(0, i):
        if nums[j] > num:
            nums.insert(j, num)
            del nums[i+1]
            break
print_list(nums)
    


Measured memory_bytes: 5608
fun main(args: Array<String>) {
    val n = readLine()!!.toInt()

    when (n) {
        1 -> {
            println("Hello World")
        }
        2 -> {
            val a = readLine()!!.toInt()
            val b = readLine()!!.toInt()
            println(a + b)
        }
    }
}


Measured memory_bytes: 31804
#define __USE_MINGW_ANSI_STDIO 0
#include <bits/stdc++.h>

using namespace std;
using ll = long long;
#define int ll
using VI = vector<int>;
using VVI = vector<VI>;
using PII = pair<int, int>;

#define FOR(i, a, n) for (ll i = (ll)a; i < (ll)n; ++i)
#define REP(i, n) FOR(i, 0, n)
#define ALL(x) x.begin(), x.end()
#define PB push_back

const ll LLINF = (1LL<<60);
const int INF = (1LL<<30);
const int MOD = 1000000007;

template <typename T> T &chmin(T &a, const T &b) { return a = min(a, b); }
template <typename T> T &chmax(T &a, const T &b) { return a = max(a, b); }
template <typename T> bool IN(T a, T b, T x) { return a<=x&&x<b; }
template<typename T> T ceil(T a, T b) { return a/b + !!(a%b); }
template<class S,class T>
ostream &operator <<(ostream& out,const pair<S,T>& a){
  out<<'('<<a.first<<','<<a.second<<')';
  return out;
}
template<class T>
ostream &operator <<(ostream& out,const vector<T>& a){
  out<<'[';
  REP(i, a.size()) {out<<a[i];if(i!=a.size()-1)out<<',';}
  out<<']';
  return out;
}

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

signed main(void)
{
  int n, a;
  cin >> n >> a;
  n %= 500;
  if(n <= a) cout << "Yes" << endl;
  else cout << "No" << endl;

  return 0;
}


Measured memory_bytes: 256
import sys
read = sys.stdin.read
def main():
    def factorization(n):
        arr = []
        temp = n
        for i in range(2, int(-(-n ** 0.5 // 1)) + 1):
            if temp % i == 0:
                cnt = 0
                while temp % i == 0:
                    cnt += 1
                    temp //= i
                arr.append([i, cnt])
        if temp != 1:
            arr.append([temp, 1])
        if arr == []:
            arr.append([n, 1])
        return arr

    n = int(input())
    r = 0
    for i1 in range(1, n + 1, 2):
        ifac = factorization(i1)
        ifacn = [i[1] for i in ifac]
        ifacn.sort()
        if ifacn == [1, 3] or ifacn == [1, 1, 1]:
            r += 1
    print(r)

if __name__ == '__main__':
    main()


Measured memory_bytes: 9480
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <cmath>
#include <ctime>
#include <cctype>

#include <algorithm>
#include <random>
#include <bitset>
#include <queue>
#include <functional>
#include <set>
#include <map>
#include <vector>
#include <chrono>
#include <iostream>
#include <limits>
#include <numeric>

#define LOG(FMT...) fprintf(stderr, FMT)

using namespace std;

typedef long long ll;
typedef unsigned long long ull;

// mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());

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

template <class T>
ostream& operator<<(ostream& os, const vector<T>& v) {
  if (!v.empty()) {
    os << v.front();
    for (int i = 1; i < v.size(); ++i)
      os << ' ' << v[i];
  }
  return os;
}

int main() {
#ifdef LBT
  freopen("test.in", "r", stdin);
  int nol_cl = clock();
#endif
  ios::sync_with_stdio(false);
  cin.tie(nullptr);

  int n;
  cin >> n;
  cout << (n / 2 - (n % 2 == 0)) << '\n';

#ifdef LBT
  LOG("Time: %dms\n", int ((clock()
          -nol_cl) / (double)CLOCKS_PER_SEC * 1000));
#endif
  return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main(){
  int n; cin >> n;
  set<int> st;
  for(int i = 0; i < n; ++i){
    int x; cin >> x;
    st.insert(x);
  }
  cout << st.size() << endl;
  return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main()
{
    int n,a,b,ans=0;
    cin>>n;
    unordered_map<int, int> mp;
    while(n--){
        scanf("%d",&a);
        if(mp[a]==1){
            mp[a] = 0;
            ans--;
        }
        else{
            mp[a] = 1;
            ans++;
        }
    }
    cout<<ans<<endl;
    return 0;
}


Measured memory_bytes: 4388
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# べき乗は、a ** n or pow(a, n)
X = int(input())
# X = a**5 - b**5 
#   = (a-b)(a**4 + a**3 * b + a**2 * b**2 + a * b**3 + b**4)
# よって、X は　a-b　の倍数 X%(a-b) = 0

# a**5  = b**5 + X
#   a   = ( b**5 + X )**(1/5)
# X< 10**9 を満たす a,bの最大値は、120 , 119
flag = False
for ai in range(-119,120):
    for bi in reversed(range(-120,119)):
        if ai - bi != 0 and X > (ai - bi):
            if X % (ai - bi) == 0:
                if ai**5 - bi**5 ==X:
                    print(int(ai),int(bi))
                    flag = True
                    break
        else:
            if ai**5 - bi**5 ==X:
                print(int(ai),int(bi))
                flag = True
                break
    if flag:
        break

Measured memory_bytes: 9208
#![allow(non_snake_case)]

use std::io::{stdin, Read};
use std::str::FromStr;
fn read_option<T: FromStr>() -> Option<T> {
    let stdin = stdin();
    let stdin = stdin.lock();
    let token: String = stdin
        .bytes()
        .map(|c| c.expect("failed to read char") as char)
        .skip_while(|c| c.is_whitespace())
        .take_while(|c| !c.is_whitespace())
        .collect();
    token.parse().ok()
}
fn read<T: FromStr>() -> T {
    let opt = read_option();
    opt.expect("failed to parse token")
}

fn main() {
    let N: usize = read();
    let mut ans = 0;
    let mut before = 0;
    for _ in 0..N {
        let h: i32 = read();
        ans += std::cmp::max(h - before, 0);
        before = h;
    }
    println!("{}", ans);
}


Measured memory_bytes: 4352
from itertools import accumulate


# エラトステネスの篩（素数）
def sieve(n):
    is_prime = [True for _ in range(n)]
    is_prime[0] = False

    for i in range(2, n+1):
        if is_prime[i-1]:
            j = 2 * i
            while j <= n:
                is_prime[j-1] = False
                j += i
    table = [i for i in range(1, n+1) if is_prime[i-1]]
    return [False] + is_prime, table


Q = int(input())
L = [0]*Q
R = [0]*Q

for i in range(Q):
    L[i], R[i] = list(map(int, input().split()))

max_R = max(R)
is_prime, table = sieve(max_R)

check = [0]*(max_R + 1)
for i in range(0, max_R + 1):
    if (i % 2 == 1):
        if (is_prime[i] and is_prime[(i+1)//2]):
            check[i] = 1

# 累積和
check = [0] + check
check = list(accumulate(check))

for i in range(Q):
    print(check[R[i] + 1] - check[L[i]])


Measured memory_bytes: 16792
#include <bits/stdc++.h>
using namespace std;
using Graph = vector<vector<int>>;
 
typedef long long ll;
typedef long double ld;
 
#define REP(i,a,n) for(int (i)=(a); (i)<(int)(n); (i)++)
#define rep(i,n) REP(i,0,n)
#define vec vector 

const ll large_P = 1e9 + 7;


int main(){
  int H, A;
  cin >> H >> A;
  
  if(H%A == 0){
    cout << H/A;
  }else{
    cout << H/A + 1;
  }
}

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

int main(void)
{
    int n;
    cin >> n;
    vector<int> a(n);
    for (int i=0;i<n;i++){
        cin >> a.at(i);
    }
    int nin = 1e9;
    for (int i=-100;i<=100;i++){
        int sum =0;
        for (int j=0;j<n;j++){
            sum+=pow(a.at(j)-i,2);
        }
        nin = min(nin,sum);
    }
    cout << nin << endl;
    return 0;
}

Measured memory_bytes: 256
S = input()
S_front = S[:2]
S_back = S[2:]

if 0 < int(S_front) < 13:
	if 0 < int(S_back) < 13:
		print("AMBIGUOUS")
	else:
		print("MMYY")
else:
	if 0 < int(S_back) < 13:
		print("YYMM")
	else:
		print("NA")

Measured memory_bytes: 9052
#include<bits/stdc++.h>
using namespace std;
const int maxn=(1e5+10);
int n,id,dist[2][maxn];
vector<int> edge[maxn];
void dfs(int ind,int par=-1)
{
	if(~par)
		dist[id][ind]=dist[id][par]+1;
	for(int i=0;i<edge[ind].size();i++)
	{
		int to=edge[ind][i];
		if(to!=par)
			dfs(to,ind);
	}
}
int main()
{
	cin>>n;
	for(int i=0;i<n-1;i++)
	{
		int a,b;
		cin>>a>>b;
		--a,--b;
		edge[a].push_back(b);
		edge[b].push_back(a);
	}
	id=0;
	dfs(0);
	id=1;
	dfs(n-1);
	int cnt=0;
	for(int i=0;i<n;i++)
		cnt+=(dist[0][i]<=dist[1][i]?1:0);
	puts(cnt>=(n+2)/2?"Fennec":"Snuke");
	return 0;
}

Measured memory_bytes: 11136
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define all(x) (x).begin(),(x).end()
const ll INF = 1LL << 60;

int main(){
    string s;
    cin >> s;
    for(int i=0; i<s.size(); i++){
        if(i%2==0){ //奇数文字目
            if(s[i]!='R' && s[i]!='U' && s[i]!='D'){
                cout << "No" << endl;
                return 0;
            }
        }
        if(i%2==1){
            if(s[i]!='L' && s[i]!='U' && s[i]!='D'){
                cout << "No" << endl;
                return 0;
            }
        }
    }
    cout << "Yes" << endl;
    return 0;
}

Measured memory_bytes: 3624
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		// ここにコードを挿入
		Scanner sc = new Scanner(System.in);
		int x = sc.nextInt();
		int a = sc.nextInt();
		if(x<a) {
			System.out.println(0);
		}else if(a<=x) {
			System.out.println(10);
		}
		
	}

}

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


int main() {

   ios_base :: sync_with_stdio(false); cin.tie(0); cout.tie(0);
   int n; string str; cin >> n >> str;
   int ans =0 ;
   for(int i = 1; i < n - 1; i++) ans += str[i] == 'B' && str[i - 1] == 'A' && str[i + 1] == 'C';
   	cout << ans << endl;
    	
}

Measured memory_bytes: 256
import math
A,B=map(int,input().split())
cal,cal2=0,0
ans=[]

for i in range(1200):
    cal=math.floor(i*0.08)
    cal2=math.floor(i*0.1)

    if cal==A and cal2==B:
        ans.append(i)


if len(ans)>0:
    print(min(ans))
else :
    print(-1)


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

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

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

using namespace std;

using ll = long long;
using ull = unsigned long long;
using pii = pair<int, int>;

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

const int dx[] = {1, 0, -1, 0}, dy[] = {0, -1, 0, 1};
int N;
const int MAX_N = 51;
vector<int> times;
bool dp[2][1 << 24];
int main() {
  cin >> N;
  times.resize(N);
  for (auto &val : times){
    cin >> val;
  }
  sort(times.begin(), times.end());
  if (times[0] == 0){
    cout << 0 << endl;
    return 0;
  }

  memset(dp, false, sizeof(dp));
  dp[0][1] = true;
  for (int i = 0; i < N; i++){
    for (int bit = 0; bit < (1 << 24); bit++){
      if (dp[i%2][bit]){
        int t1 = times[i];
        int t2 = 24 - times[i];
        if (((bit >> t1)&1) == 0){
            dp[(i + 1) % 2][bit | (1 << t1)] = true;
        }
        if (((bit >> t2)&1) == 0){
            dp[(i + 1) % 2][bit | (1 << t2)] = true;
        }
      }
    }

    for (int bit = 0; bit < (1 << 24); bit++){
      dp[i%2][bit] = false;
    }
  }
  int result = 0;
  for (int bit = 0; bit < (1 << 24); bit++){
    if (dp[N % 2][bit] == 0)continue;
    int res = INF;
    for (int i = 0; i <= 24; i++){
      for (int j = i + 1; j <= 24; j++){
        if (((bit >> i)&1) and ((bit >> j) &1)){
          res = min(res, min(j - i, 24 - (j - i)));
        }
      }
    }
    if (res == INF)continue;
    result = max(result, res);
  }
  cout << result << endl;
  return 0;
}


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

int main() {
    int N, K;
    cin >> N >> K;
    
    int num = 1;
    for (int i = 0; i < N; i++) {
        if (num < K) {
            num *= 2;
        } else {
            num += K;
        }
    }

    cout << num << endl;
}

Measured memory_bytes: 256
# m-2n >=0 -> 残ったmを4つずつでひとつのセットが作れる
# m-2n < 0 -> m/2個ぶんだけ作れる
n, m = gets.chomp.split.map(&:to_i)

if m-2*n>=0
  x = m-2*n
  puts n+x/4
else
  puts m/2
end

Measured memory_bytes: 1788
#include <bits/stdc++.h>
using namespace std;
int n;
list<int>List1;
int main(void)
{
    ios::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    cin>>n;

    int temp;
    if(!(n&1))
    {
        for(int i=1;i<=n;i++)
        {
            cin>>temp;
            if(!(i&1))
            {
                List1.push_front(temp);
            }
            else
            {
                List1.push_back(temp);
            }
        }
    }
    else
    {
        for(int i=1;i<=n;i++)
        {
            cin>>temp;
            if(i&1)
            {
                List1.push_front(temp);
            }
            else
            {
                List1.push_back(temp);
            }
        }
    }
    int cnt=0;
    for(auto i:List1)
    {
        if(cnt==0)
        {
            cout <<i;
            cnt++;
        }
        else
        {
            cout <<" "<<i;
        }
    }
    return 0;
}


Measured memory_bytes: 8448
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()
}

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

fn main() {
    let input = read_vec::<usize>();
    println!("{} {} {}", input[2], input[0], input[1]);
}

Measured memory_bytes: 4352
package main

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

var sc = bufio.NewScanner(os.Stdin)

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

func main() {
	sc.Split(bufio.ScanWords)
	n, _ := strconv.Atoi(stringLineScan())
	m, _ := strconv.Atoi(stringLineScan())
	x := make([]int, 0)
	for i := 1; float64(i) < math.Pow(float64(m), 0.5); i++ {
		if m%i == 0 {
			x = append(x, i)
			x = append(x, m/i)
		}
	}
	ans := 1
	for _, i := range x {
		if m/i >= n && i > ans {
			ans = i
		}
	}
	fmt.Println(ans)
}


Measured memory_bytes: 640
int main(){
  int a;
  scanf("%d",&a);
  long int b[1000000],c=0,d=0,e=0,f=a-1;
  for(int i=0;i<a;i++){
    scanf("%ld",&b[i]);
  }
  for(int i=0;i<a;i++){
    if(c<d){
      c+=b[e];
      e++;
    }else{
      d+=b[f];
      f--;
    }
  }
  if(c<d)c=d-c;
  else c-=d;
  printf("%ld\n",c);
  return 0;
}

Measured memory_bytes: 3584
#pragma GCC optimize("Ofast")
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned long long; 
using pii =  pair<int, int>;
using pll =  pair<long long, long long>;
#define rep(i, n) for(int i = 0; i < (n); ++i)
#define all(x) (x).begin(),(x).end()
constexpr char ln =  '\n';
constexpr long long MOD = 1000000007LL;
//constexpr long long MOD = 998244353LL;
template<class T, class U> inline bool chmax(T &a, U b) { if (a < b) { a = b; return true;} return false; }
template<class T, class U> inline bool chmin(T &a, U b) { if (a > b) { a = b; return true;} return false; }
const ll INF = (ll)1e18 + 1;
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

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

    ll n; cin >> n;
    ll mn=INF;
    
    for(ll i=1; i*i<=n; i++){
        if(n%i==0){
            ll a = i;
            ll b = n/i;
            chmin(mn, a-1 + b-1);
        }
    }

    cout << mn << ln;
    return 0;
}

Measured memory_bytes: 256