akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;
#define rep(i, N) for(int i=0; i<N; i++)
typedef long long ll;

void dfs(vector<ll> &z, ll nz, ll y){
    if(2*nz > y){
        return;
    }else{
        z.push_back(2*nz);
        dfs(z, 2*nz, y);
    }
}

int main() {
    ll x, y;
    cin >> x >> y;

    vector<ll> z;
    z.push_back(x);
    dfs(z, x, y);

    cout << z.size() << endl;
}


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

#define MorsheD ios_base::sync_with_stdio(false),cin.tie(NULL),cout.tie(NULL)
typedef long long ll;

const int sz = 1e5 + 5;
int ara[sz], dp[sz];

int solve(int src, int dest) {
    if (src == dest - 1) {
        return 0;
    }

    if (dp[src] != -1) {
        return dp[src];
    }

    int left = abs(ara[src] - ara[src + 1]) + solve(src + 1, dest);
    int right = INT_MAX;

    if (src + 2 < dest) {
        right = abs(ara[src] - ara[src + 2]) + solve(src + 2, dest);
    }

    return dp[src] = min(left, right);
}

int main(){
    // ===================
    MorsheD;
    // freopen("in.txt", "r", stdin);
    // freopen("out.txt", "w", stdout);
    // ===================

    int n;
    cin >> n;

    memset(dp, -1, sizeof(dp));

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

    cout << solve(0, n) << "\n";

    return 0;
}


Measured memory_bytes: 10600
#include <stdio.h>
int main(void){
   int a,b;
   
   scanf("%d %d\n", &a, &b);

   if (a < b)  printf("a < b\n");
   if (a > b)  printf("a > b\n");
   if (a == b) printf("a == b\n");
   
   return 0;
}



Measured memory_bytes: 2100
#include <iostream>
#include <vector>
#include <algorithm>

using int64 = long long;

int64 calc(std::vector<int64> &A, int b)
{
    int N = A.size();
    int64 sum = 0;
    for (int i = 0; i < N; i++) {
        sum += abs(A[i] - (b + i + 1));
    }
    return sum;
}

int main()
{
    int N;
    std::cin >> N;

    std::vector<int64> A(N);
  	std::vector<int> B(N);
    for (int i = 0; i < N; i++) {
        std::cin >> A[i];
      	B[i] = A[i] - (i + 1);
    }
  
  	std::sort(B.begin(), B.end()); 
    std::cout << calc(A, B[N / 2]) << std::endl;
    return 0;
}


Measured memory_bytes: 2560
//----------BHAVIK DIWANI(PICT_COMP)---------------
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#define test ll t; cin>>t; while(t--)
#define fastio ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define mod 1000000007
#define ll long long
#define int long long
#define ull unsigned long long
#define MAX 1000005
#define pb push_back
#define mkp make_pair
#define vi vector<int>
#define pii pair<int,int>
#define endl '\n'
#define vs vector<string>
#define mii map<int,int>
#define msi map<string,int>
#define vpii vector< pair<int, int > >
#define vpsi vector< pair< string ,int > >
#define forci(p,q) for(int i=p;i<q;i++)
ll gcd(ll a,ll b){ if(b==0) return a;    return gcd(b,a%b);}
ll lcm(ll a,ll b) { return (a/gcd(a,b)*b);}
ull power(ull a, ull b) {a %= mod;  ull res = 1;  while (b > 0) { if (b & 1) res = res * a % mod;  a = a * a % mod;  b >>= 1; }  return res%mod; }
ll modmul(ll x, ll y){return (x*y)%mod;}
ll modadd(ll x, ll y){return (x+y)%mod;}
ll modsub(ll x, ll y){return (x-y+mod)%mod;}
ll fact[1000007]={0};
void facto() {fact[0]=1;fact[1]=1;for(int i=2;i<1000007;i++)fact[i]=(fact[i-1]*i)%mod;}
ll ncr(ll n,ll r) {ll res=1; res=fact[n]; res=(res*(power(fact[r],mod-2)))%mod; res=(res*(power(fact[n-r],mod-2)))%mod; return res;}
ll npr(ll n,ll r) {ll res=1; res=fact[n]; res=(res*(power(fact[n-r],mod-2)))%mod; return res;}
inline long long toint(const std::string &s) {std::stringstream ss; ss << s; long long x; ss >> x; return x;}
inline std::string tostring(long long number) {std::stringstream ss; ss << number; return ss.str();}
inline std::string tobin(long long x) {return std::bitset<63>(x).to_string();}
/*bool prime[MAX];
ull sieve(){memset(prime,true,sizeof(prime));for(ull p=2;p*p<MAX;p++){if(prime[p]==true){for(ull i=2*p;i<MAX;i+=p){prime[i]=false;}}}prime[0]=0;prime[1]=0;
}*/
/*int inv[1000001]={0};
void findinverse(){inv[1] = 1;for(int i = 2; i <=1e6 ; ++i)	inv[i] = (mod - (mod/i) * inv[mod%i] % mod) % mod;}
*/
using namespace std;
using namespace __gnu_pbds;
typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> orderedSet;
typedef tree<int, null_type, less_equal<int>, rb_tree_tag, tree_order_statistics_node_update> orderedMultiset;
int solve()
{
	int n;
	cin>>n;
	int a[n];
	multiset<pair<int,int> > g;
	forci(0,n){
		cin>>a[i];
		g.insert({a[i],i});
	}
	forci(0,n){
		g.erase({a[i],i});
		int mx=(*(g.rbegin())).first;
		cout<<mx<<endl;
		g.insert({a[i],i});
	}
	return 0;
}
signed main()
{
	fastio;
//	test
		solve();
}




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

using namespace std;
#define ll long long
#define ld long double

int main()
{
    ios_base::sync_with_stdio(0),cin.tie(NULL),cout.tie(NULL);
    int m1, d1, m2, d2;
    cin >> m1 >> d1 >> m2 >> d2;
    if(m2 != m1) cout << 1 << endl;
    else cout << 0 << endl;
    return 0;
}


Measured memory_bytes: 256
_a = gets.to_i
b = gets.split.map(&:to_i)
d = -1
e = 1
f = 0

if b.include?(0)
  puts f
  exit
end

b.each do |i|
  e = e * i
  if e > 10**18
    puts d
    exit
  end
end

puts e

Measured memory_bytes: 21680
#include <iostream>
#include <map>
#include <set>
#include <queue>
#include <vector>
#include <string>
#include <algorithm>
#include <utility>
#include <functional>

using namespace std;

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

int N,S;
int A[3010];
int dp[3010][6010];
const int MOD = 998244353;

signed main()
{
	cin >> N >> S;
	rep1(i, N) cin >> A[i];

	rep(i, N+1) dp[i][0] = 1;

	for (int i = 1; i <= N; ++i) {
		for (int j = 0; j <= S; ++j) {
			dp[i][j] += dp[i-1][j];
			if (j + A[i] <= S*2) {
				//printf("dp[%lld][%lld] += dp[%lld][%lld]\n", i, j+A[i],i-1,j);
				dp[i][j + A[i]] += dp[i-1][j];
			}
			dp[i][j] %= MOD;
		}
	}
	int ans = 0;

	rep(i, N+1) {
		ans += dp[i][S];
		ans %= MOD;
	}

	//rep(i, N+1) {
	//	rep(j, 2*S+1) {
	//		printf("dp[%lld][%lld] = %lld\n", i,j,dp[i][j]);
	//	}
	//	printf("\n");
	//}

	cout << ans << endl;
}


Measured memory_bytes: 140928
a,b, k = map(int, input().split())
if k >= a:
    k -= a
    a = 0
else:
    a-=k
    k = 0
    print(a,b)
    exit()
if k >= b:
    k -= b
    b = 0
else:
    b -= k
    k = 0
print(a,b)

Measured memory_bytes: 3060
#include <iostream>
#include <algorithm>
#include <vector>
#include <set>
#include <queue>
#include <map>
#include <string.h>
#include <math.h>
#include <stdio.h>
#include <deque>
#include <bits/stdc++.h>
//#include "testlib.h"
using namespace std;
#define ll long long
#define pii pair<int,int>
#define qi ios::sync_with_stdio(0)

bool debug=true;

/*    *************************************
	  * Written in New Computer           *
	  * The following code belongs to     *
	  * XiaoGeNintendo of HellHoleStudios *
	  *************************************
*/
template<typename T1,typename T2>ostream& operator<<(ostream& os,pair<T1,T2> ptt){
	os<<ptt.first<<","<<ptt.second;
	return os;
}
template<typename T>ostream& operator<<(ostream& os,vector<T> vt){
	os<<"{";
	for(int i=0;i<vt.size();i++){
		os<<vt[i]<<" ";
	}
	os<<"}";
	return os;
}

int n,m;
pii a[500005];

int fa[500005];

int find(int v){
//	cout<<v<<endl;
	if(v<0 || v>m){
		return 0;
	}
	if(fa[v]==v){
		return v;
	}
	return fa[v]=find(fa[v]);
}

void Union(int a,int b){
	a=find(a);
	b=find(b);
	if(a>b){
		fa[a]=b;
	}else{
		fa[b]=a;
	}
}

int main(int argc,char* argv[]){
	qi;
	cin>>n>>m;
	for(int i=0;i<n;i++){
		cin>>a[i].second>>a[i].first;
		a[i].second=m-a[i].second+1;
	}
	
	sort(a,a+n);
	reverse(a,a+n);
	
	for(int i=1;i<=500000;i++){
		fa[i]=i;
	}
	
	int ret=0;
	
	for(int i=0;i<n;i++){
		
		int k=find(a[i].second);
//		cout<<a[i].first<<" "<<a[i].second<<" "<<k<<endl;
		if(k!=0){
			Union(k-1,k);
			ret+=a[i].first;
		}
	}
	
	cout<<ret;
	return 0;
}



Measured memory_bytes: 4352
#include <bits/stdc++.h>
#define rep(i, N) for (int i=0; i<(int)N; i++)
#define rep1(i, N) for (int i=1; i<(int)N; i++)

using namespace std;

int x;

bool isnot_prime_number(int x) {
  int sqrt_x = (int)ceil(sqrt(x));
  bool ret = false;
  for(int i=2; i<= sqrt_x; i++) {
    if(x%i == 0) {
      ret = true;
      break;
    }
  }
  if (x==2) ret=false;
  return ret;
}
 

int main() {
  cin >> x;
  int MAX_N=100010;
  int ans;
  for(int i = x; i < MAX_N; i++) {
    if(!isnot_prime_number(i)) {
      ans = i;
      break;
    }
  }
  
  cout << ans;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
#include <ext/pb_ds/detail/standard_policies.hpp>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
using namespace std;
#define fi first
#define se second
#define fastio ios_base::sync_with_stdio(false); cin.tie(0)
#define loop(i, a, b) for(lli i=a; i<b; i++)
#define loopb(i, a, b) for(lli i=a; i>=b; i--)
#define pb push_back
#define umap unordered_map
typedef long long int lli;
typedef pair<lli, lli> pii;
typedef vector<lli> vll;
typedef pair<lli, pii> ppi;
typedef tree<lli, null_type, less<lli>, rb_tree_tag, tree_order_statistics_node_update> ordered_set;
// use to avoid collision
struct custom_hash {
    static uint64_t splitmix64(uint64_t x) {
        // http://xorshift.di.unimi.it/splitmix64.c
        x += 0x9e3779b97f4a7c15;
        x = (x ^ (x >> 30)) * 0xbf58476d1ce4e5b9;
        x = (x ^ (x >> 27)) * 0x94d049bb133111eb;
        return x ^ (x >> 31);
    }

    size_t operator()(uint64_t x) const {
        static const uint64_t FIXED_RANDOM = chrono::steady_clock::now().time_since_epoch().count();
        return splitmix64(x + FIXED_RANDOM);
    }
};
// for pair in unordered_map
struct hash_pair {
    static uint64_t splitmix64(uint64_t x) {
    // http://xorshift.di.unimi.it/splitmix64.c
    x += 0x9e3779b97f4a7c15;
    x = (x ^ (x >> 30)) * 0xbf58476d1ce4e5b9;
    x = (x ^ (x >> 27)) * 0x94d049bb133111eb;
    return x ^ (x >> 31);
    }
    template <class T1, class T2>
    size_t operator()(const pair<T1, T2>& p) const{
        auto hash1 = hash<T1>{}(p.first);
        auto hash2 = hash<T2>{}(p.second);
        uint64_t x = hash1 ^ hash2;
        static const uint64_t FIXED_RANDOM = chrono::steady_clock::now().time_since_epoch().count();
        return splitmix64(x + FIXED_RANDOM);
    }
};
lli M = 1e9 + 7;
lli power(lli x, lli y){
    lli res = 1;
    x = x ;
    while (y > 0) {
        if (y & 1)
            res = (res*x) ;
        y = y>>1;
        x = (x*x);
    }
    return res;
}
lli dp[2][105][4];
string s;
lli calc(lli e, lli index, lli k){
    lli n = s.length();
    if(index == n && k != 0)
        return 0;
    else if(k < 0)
        return 0;
    else if(k == 0)
        return 1;
    else if(dp[e][index][k] != -1)
        return dp[e][index][k];
    lli ans = 0;
    lli c;
    if(e == 1)
        c = s[index]-'0'+1;
    else
        c = 10;
    loop(i, 0, c){
        lli ne;
        if(e & (s[index]-'0' == i))
            ne = 1;
        else
            ne = 0;
        if(i == 0)
            ans += calc(ne, index+1, k);
        else{
            ans += calc(ne, index+1, k-1);
        }
    }
    dp[e][index][k] = ans;
    return ans;
}
lli solve(){
    cin>>s;
    lli k;
    cin>>k;
    lli n = s.length();
    memset(dp, -1, sizeof(dp));
    lli ans = calc(1, 0, k);
    cout<<ans<<"\n";
    return 0;
}   
int main(){
    fastio;
    lli t;
    // cin>>t;
    t = 1;
    while(t>0){
        t--;
        solve();
    }
    return 0;
}


Measured memory_bytes: 256
#include<iostream>
#include<algorithm>
#include<string>
#include<vector>
#include<queue>
#include<map>
#include<math.h>
#include<numeric>
#include<utility>
#include<unordered_map> //hash map
#include<cmath>

#define rep(i,a,n) for(int (i)=(a);(i)<(n);(i)++)
#define rrep(i,a,n) for(int (i)=(a);(i)>=(n);(i)--)

#define INF 10000007

typedef  long long ll;

using namespace std;


void solve(){
  int a,b;
  cin >> a >> b;
  if(500*a >= b) cout << "Yes" << endl;
  else cout << "No" << endl;
}

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


Measured memory_bytes: 256
#include<iostream>
using namespace std;
 
int main()
{
    // get a integer
    int a;
    cin >> a;
  	int b;
  	int counter = 0;
   	for(int i = 0; i < a; i++){
    	cin >> b;
      	if(b % 2 == 0){
		if(b%3 != 0 && b%5 != 0)
          counter++;
        }
    }
  	if(counter == 0){
    cout << "APPROVED" << endl;
    }else{
      cout << "DENIED" << endl; 
    
    }
 
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
 
#define REP(i, n) for(int i = 0; i < n; i++)
#define REPR(i, n) for(int i = n; i >= 0; i--)
#define FOR(i, m, n) for(int i = m; i < n; i++)
#define ALL(v) v.begin(), v.end()
 
using namespace std;
 
auto main() -> int
{
	string N; cin >> N;
    
    if(N[2] == N[3] && N[4] == N[5]) cout << "Yes" << endl;
    else cout << "No" << endl;

}

Measured memory_bytes: 256
n = STDIN.gets.to_i
a, b = STDIN.gets.split.map(&:to_i)
points = STDIN.gets.split.map(&:to_i)

problem_a = 0
problem_b = 0
problem_c = 0

points.each do |point|
  if point <= a
    problem_a += 1
  elsif point >= a + 1 && point <= b
    problem_b += 1
  else point >= b + 1
    problem_c += 1
  end
end

p [problem_a, problem_b, problem_c].min


Measured memory_bytes: 1788
from math import factorial

n, m = map(int, input().split())
if n > 1 and m > 1:
    print(int(factorial(n)/factorial(2)/factorial(n-2) + factorial(m)/factorial(2)/factorial(m-2)))
elif n > 1:
    print(int(factorial(n)/factorial(2)/factorial(n-2)))
elif m > 1:
    print(int(factorial(m)/factorial(2)/factorial(m-2)))
else:
    print(0)

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

public class Main {

	public static void main(String[] args) throws NumberFormatException, IOException {

		InputStreamReader is = new InputStreamReader(System.in);
		BufferedReader br = new BufferedReader(is);

		String str;
		if((str=br.readLine())!=null){
			String[] sp = str.split(" ");

			int a = Integer.parseInt(sp[0]);
			int b = Integer.parseInt(sp[1]);
			int c = Integer.parseInt(sp[2]);
			int d = Integer.parseInt(sp[3]);

			if(a == b && c == d){
				System.out.println("yes");
			} else if(a == c && b == d){
				System.out.println("yes");
			} else if(a == d && b == c){
				System.out.println("yes");
			} else{
				System.out.println("no");
			}
		}
	}

}

Measured memory_bytes: 24408
class BinaryTree():
    def __init__(self):
        self.root = None

    def insert(self, insert_node):
        p = None
        r = self.root
        while r:
            p = r
            if insert_node.value < r.value:
                r = r.left
            else:
                r = r.right

        if not p:
            self.root = insert_node
        elif insert_node.value < p.value:
            p.left = insert_node
        else:
            p.right = insert_node

class Node():
    def __init__(self, value, left, right):
        self.value = value
        self.left  = left
        self.right = right

    def pre_order_search(self):
        l = self.left
        r = self.right
        print("",self.value, end="")
        if l:
            l.pre_order_search()
        if r:
            r.pre_order_search()

    def in_order_search(self):
        l = self.left
        r = self.right
        if l:
            l.in_order_search()
        print("",self.value, end="")
        if r:
            r.in_order_search()

m = int(input())
tree = BinaryTree()

for i in range(m):
    inp = input().split()
    if inp[0] == "insert":
        tree.insert(Node(int(inp[1]), None, None))
    else:
        tree.root.in_order_search()
        print()
        tree.root.pre_order_search()
        print()

Measured memory_bytes: 107280
import java.util.*;
import java.io.*;
public class Main{
   public static void main(String[] main) throws Exception{
      BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
      StringTokenizer st = new StringTokenizer(br.readLine());
      PrintWriter out = new PrintWriter(System.out);
      int A = Integer.parseInt(st.nextToken());
      int B = Integer.parseInt(st.nextToken());
      int C = Integer.parseInt(st.nextToken());
      int D = Integer.parseInt(st.nextToken());
      long[][] dp = new long[C-A+1][D-B+1];
      int mod = 998244353;
      dp[0][0] = 1;
      for(int i = 1; i <= C-A; i++) {
    	  dp[i][0] = (B*dp[i-1][0])%mod;
      }
      for(int i = 1; i <= D-B; i++){
    	  dp[0][i] = (A*dp[0][i-1])%mod;
      }
      for(int i = 1; i <= C-A; i++) {
    	  for(int j = 1; j <= D-B; j++) {
    		  dp[i][j] = ((A + i)*dp[i][j-1])%mod;
    		  dp[i][j] = ((B + j)*dp[i-1][j] + dp[i][j])%mod;
    		  dp[i][j] = (dp[i][j] - (A+i-1)*(B+j-1)*dp[i-1][j-1])%mod;
    		  dp[i][j] = (dp[i][j] + mod)%mod;
    	  }
      }
      out.println(dp[C-A][D-B]);
      out.close();
   }
}

Measured memory_bytes: 104520
#include <bits/stdc++.h>
using namespace std;
using i64 = long long;
#define rep(i,s,e) for(i64 (i) = (s);(i) < (e);(i)++)
#define all(x) x.begin(),x.end()
#define let auto const

template<typename... Types>
struct dynarr: std::vector<Types...> {
  using std::vector<Types...>::vector;
  using size_type = typename std::vector<Types...>::size_type;
  auto&& operator[](size_type i) { return this->at(i); }
  auto&& operator[](size_type i) const { return this->at(i); }
};

int main() {
  i64 N;
  cin >> N;
  vector<i64> A(N), B(N), C(N);
  rep(i,0,N) cin >> A[i];
  rep(i,0,N) cin >> B[i];
  rep(i,0,N - 1) cin >> C[i];
  i64 now = -100;
  i64 ans = 0;
  rep(i,0,N) {
    i64 a;
    a = A[i] - 1;
    ans += B[a];
    if(now == a - 1) {
      ans += C[a - 1];
    }
    now = a;
  }
  cout << ans << endl;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#ifdef ENABLE_DEBUG
#define dump(a) cerr<<#a<<"="<<a<<endl
#define dumparr(a,n) cerr<<#a<<"["<<n<<"]="<<a[n]<<endl
#else
#define dump(a) 
#define dumparr(a,n) 
#endif
#define FOR(i, a, b) for(int i = a;i < b;i++)
#define For(i, a) FOR(i, 0, a)
#define REV(i, a, b) for(int i = b-1;i >= a;i--)
#define Rev(i, a) REV(i, 0, a)
#define REP(a) For(i, a)

typedef long long int ll;
typedef unsigned long long ull;
typedef unsigned int uint;
typedef pair<ll, ll> pll;
typedef pair<ll,pll> ppll;
typedef vector<ll> vll;

const ll INF=(1LL<<50);

template<class S,class T>
std::ostream& operator<<(std::ostream& os,pair<S,T> a){
  os << "(" << a.first << "," << a.second << ")";
  return os;
}
template<class T>
std::ostream& operator<<(std::ostream& os,vector<T> a){
  os << "[ ";
  REP(a.size()){
    os<< a[i] << " ";
  }
  os<< " ]";
  return os;
}

const string YES = "Yes";
const string NO = "No";

void solve(long long N, std::vector<long long> H){
  vector<bool> f(N,false);
  REP(N-1){
    if(H[i]>H[i+1]){
      for(ll j=i;j>=0&&H[j]>H[j+1];--j){
        if(f[j]==false){
          f[j]=true;
          --H[j];
        }
        if(H[j]>H[j+1]){
          cout<<"No"<<endl;
          return ;
        }
      }
    }
  }
  cout<<"Yes"<<endl;
}

int main(){
    long long N;
    scanf("%lld",&N);
    std::vector<long long> H(N);
    for(int i = 0 ; i < N ; i++){
        scanf("%lld",&H[i]);
    }
    solve(N, std::move(H));
    return 0;
}


Measured memory_bytes: 1024
#include <iostream>
#include <string>
#include <map>
#include <queue>
#include <algorithm>
using namespace std;
map<string,int> m;
string last = "01234567";
int f(){
	int da[] = {-4 , -1 , 1 , 4},a;
	queue<string> q;
	q.push(last);
	m[last] = 0;
	while(!q.empty()){
		string s = q.front(),ts;
		q.pop();
		int i = s.find('0');
		for(int j = 0;j < 4;++j){
			ts = s;
			a = i + da[j];
			if((i == 3 && a == 4) || (i == 4 && a == 3)) continue;
			if(-1 < a && a < 8){
				swap(ts[i],ts[a]);
				if(!m.count(ts)){
					q.push(ts);
					m[ts] = m[s] + 1;
				}
			}
		}
	}
	return 0;
}
int main(){
	string s = "\0";
	int c = 0;
	char a;
	f();
	while(cin >> a){
		s += a;
		++c;
		if(c == 8){
			c = 0;
			cout << m[s] << endl;
			s = "\0";
		}
	}
	return 0;
}

Measured memory_bytes: 0
NM = list(map(int, input().split()))
N = NM[0]
M = NM[1]
vote = list(map(int, input().split()))
vote.sort()
voteSum = 0
for j in vote:
    voteSum += j
if vote[-M]/voteSum >= 1/(4*M):
    print('Yes')
else:
    print('No')

Measured memory_bytes: 3060
#ifdef __GNUC__
#include <bits/stdc++.h>
#endif // __GNUC__

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

    int N;
    std::string S;
    int K;
    std::cin >> N >> S >> K;
    for (auto& i : S) {
        if (i != S[K - 1])i = '*';
    }
    std::cout << S << std::endl;
}   

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

#define INF 1e9
#define llINF 1e18
#define MOD 1e9+7
#define pb push_back
#define mp make_pair 
#define F first
#define S second
#define ll long long
using namespace std;
int main(){
  double n,m,d;cin>>n>>m>>d;
  if(n-d<=0)cout<<0<<endl;
  else if(d==0)
    printf("%.8lf\n",(double)(m-1)/n);
  else{
    printf("%.8lf\n",(double)(((m-1)/n)*(n-1))*((n-d)/(n-1)/n*2));
  }
    
  return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
ll mod = 998244353LL;
const int maxn = 3000010;
ll qpow(ll a,ll x){
    ll ret=1;
    while (x){
        if (x&1)
            ret = ret*a%mod;
        a=a*a%mod;
        x>>=1;
    }
    return ret;
}
ll fac[maxn],inv[maxn];
 
ll init(){
    fac[0]=1;
    for (int i=1;i<maxn;i++)
        fac[i]=fac[i-1]*i%mod;
    inv[maxn-1]=qpow(fac[maxn-1],mod-2);
    for (int i=maxn-2;i>=0;i--)
        inv[i]=inv[i+1]*(i+1)%mod;
    return 0;
}
 
ll c(ll n,ll m){
    if (n<m) return 0;
    return fac[n]*inv[m]%mod*inv[n-m]%mod;
}
int main()
{
    init();
    ll N,A,B,K;
    cin>>N>>A>>B>>K;
    ll ans=0;
    for(int i=0;i<=N;i++){
        if(K-A*i<0) continue;
        if((K-A*i)%B!=0) continue;
        ll y=(K-A*i)/B;
        if(y>N)continue;
        ans=(ans+c(N,i)*c(N,y)+mod)%mod;
    }
    cout<<ans<<endl;
    return 0;

}

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

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

    int count = 0;
    int n = s.size();

    for(int i = 0;i < n/2 ;i++){
        if(s[i] != s[n-i-1]){
            ++count;
        }
    }
    cout << count << endl;
}

Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <iomanip>
#include <ios>
using namespace std;
int main(void){
  string s;
  cin >> s;
  
  int n = s.length();
  
  int ans = 0;
  
  for(int i=0;i<n-1;i++){
    if(s[i] != s[i + 1])
      ans++;
  }
  
  cout << ans << endl;
  
  return 0;
}

  
  

Measured memory_bytes: 512
#include <algorithm>
#include <iostream>
#include <string>
#include <vector>
#define rep(i, n) for (int i = 0; i < (n); ++i)
using namespace std;

int main() {
  int x, y, z, sum = 0;
  cin >> x >> y >> z;
  for (int n = 1; n < 1000000; ++n) {
    if (sum > x) {
      cout << n - 2 << endl;
      break;
    }
    sum = y * n + z * (n + 1);
  }
  return 0;
}


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

#define IOS ios::sync_with_stdio(0);cin.tie(0);cout.tie(0)
#define int long long 
#define f(i,a,b) for(int i=a;i<b;i++)
#define pb push_back
#define mp make_pair
#define vi vector<int>
#define ss second
#define ff first
#define ll long long
#define pii pair<int,int>
#define sz(a) (int)a.size()
#define all(a) a.begin(),a.end()
#define vii vector<pii>
typedef long double ld;
const int N = 1e3+5;
const int INF = 1e9+7;

int32_t main()
{
  IOS;
  int x,y;
  cin >> x >> y;
  cout << x+(y/2) << '\n';
  return 0;
}

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

int main() {
	int N,M,X;
  	cin >> N >> M >> X;
  
  	vector<int> A(M);
  	for(int i = 0; i < M; i++) {
    	cin >> A.at(i);
    }
  
  	int smallx = 0;
  
  	for(int i = 0; i < M; i++) {
    	if(A.at(i) < X) smallx++;
    }
  
  	int largex = M - smallx;
  	cout << min(smallx,largex) << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define f(i,n) for(int i=0;i<n;i++)
#define P pair<int,int>
#define F first
#define S second
#define int long long
#define mod 1000000007
#define mmod 998244353
#define all(v) v.begin(), v.end()
#define INF LLONG_MAX/3
using namespace std;
int mypow(int a, int b, int c) {
	if (b == 0)return 1;
	if (b % 2)return mypow(a, b - 1, c)*a%c;
	int z = mypow(a, b / 2, c);
	return z * z%c;
}
int a, cnt = 0;
string ans;
int k(int z) {
	int x = 0;
	while (z) {
		x++;
		z /= 10;
	}
	return x;
}
void mutu(int x, int y) {
	if (y == 0) {
		cnt++;
		if (a == cnt)ans = (char)(x + '0');
		return;
	}
	for (int i = max((int)0, x - 1); i <= min(x + 1, (int)9); i++) {
		mutu(i, y - 1);
		if (a == cnt) {
			ans = (char)(x + '0') + ans;
			return;
		}
	}
}
signed main() {
	int n, ans = 2;
	cin >> n;
	if (n == 2) {
		cout << 1 << endl;
		return 0;
	}
	for (int i = 2; i*i <= n - 1; i++) {
		if ((n - 1) % i == 0) {
			ans++;
			if (i*i != n - 1)ans++;
		}
	}
	for (int i = 2; i*i <= n; i++) {
		if (n % i == 0) {
			int z = n;
			while (z > 1 && z%i == 0) {
				if (z%i == 0)z /= i;
				else z -= i;
			}
			if (z == 1 || z % i == 1)ans++;
			if (i*i != n) {
				int vi = n / i;
				int z = n;
				while (z > 1 && z%vi == 0) {
					if (z%vi == 0)z /= vi;
					else z -= vi;
				}
				if (z == 1 || z % vi == 1)ans++;
			}
		}
	}
	cout << ans << endl;
}

Measured memory_bytes: 256
n=int(input())
l=input()
ans=[0]*n
wc=0
ec=0
for i in range(n-1):
  if l[i]=="W":
    wc+=1
  ans[i+1]+=wc
  if l[n-1-i]=="E":
    ec+=1
  ans[n-2-i]+=ec

print(min(ans))

Measured memory_bytes: 15256
#include<cstdio>
#include<cmath>
using namespace std;
int main()
{
	int n,k;
	int ans=1;
	scanf("%d%d",&n,&k);
	for(int i=1;i<=n;i++)
	{
		ans=fmin(ans*2,ans+k);
	}
	printf("%d",ans);
	return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <fstream>
#include <vector>
#include <string>
#include <set>
#include <list>
#include <fstream>
#include <map>
#include <queue>
#include <iomanip>
#include <algorithm>
#include <cmath>
using namespace std;

#define ll long long
#define mod 1000000007
#define infinity (ll)1e9+1
#define pdd pair<double,double>
#define pll pair<ll, ll>
#define pii pair<int,int>
#define MP make_pair
#define vi vector<ll>

#define FOR(i,a,b) for(ll i = (a); i < (b); ++i)
#define RFOR(i,b,a) for(ll i = (b) - 1; i >= (a); --i)
#define REPEAT(i) FOR(counter1234,0,i)
#define ALL(a) a.begin(), a.end()

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


	if (b - a == c - b)
		cout << "YES";
	else cout << "NO";




	return 0;
}

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

N,K=map(int,input().split())

ANS=0
for t in range(K,N+2):
    MIN=(0+0+(t-1))*t//2
    MAX=(N+N-(t-1))*t//2

    ANS+=MAX-MIN+1
    ANS%=10**9+7

print(ANS)

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

int main() {
  string s;
  cin >> s;
  
  bool ok = true;
  for(int i = 0; i < s.size(); i++){
    char k = s.at(i);
    if(i % 2){
      if(k == 'R') ok = false;
    }
    else{
      if(k == 'L') ok = false;
    }
  }
  
  if(ok) cout << "Yes" << endl;
  else cout << "No" << endl;
}

Measured memory_bytes: 256
al=[chr(ord('a') + i) for i in range(26)]
from collections import Counter

n=int(input())
S=[0]*n
d=[0]*n
for i in range(n):
  S[i]=input()
  d[i]=dict(Counter(S[i]))
  #print(d[i])
  
maxi=dict()
for str in d[0]:
  maxi[str] = d[0][str]
  for i in range(1,n):
    if str in d[i]:
      maxi[str]= min(maxi[str],d[i][str])
    else:
      maxi[str]=0
      break
#print(maxi)

ans=[]
for str in maxi:
  for i in range(maxi[str]):
    ans.append(str)
ans.sort()
print("".join(ans))

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

int main()
{
    char s[12];
    char num[4] = {0};
    int min = 10000000;
    scanf("%s",s);
    for(int p=2; s[p];p++){
        num[0] = s[p-2];
        num[1] = s[p-1];
        num[2] = s[p-0];
        int x = atoi(num);
        int diff = abs(753 - x);
        if(min > diff){
            min = diff;
        }
    }
    printf("%d\n", min);
    return 0;
}


Measured memory_bytes: 128
/*input
2
*/
#include <iostream>
#include <sstream>
#include <cstdio>
#include <cmath>
#include <cstring>
#include <cctype>
#include <string>
#include <vector>
#include <list>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <algorithm>
#include <functional>
#include <iomanip>

using namespace std; 

int GCD(int x,int y){return y?GCD(y,x%y):x;}
#define DEBUG(x) cout << '>' << #x << ':' << x << endl;
#define rep(i,n) for(int i=0;i<(n);i++)
#define repl(i,a,b) for(int i=(a);i<(b);i++)
#define repm(i,a,b) for(int i=(a);i>(b);i--)
#define rept(v) for(auto it=v.begin();it<v.end();it++)
#define all(v) v.begin(),v.end()
const int INF = 1<<30;
typedef long long ll;
typedef pair<int,int> pii;



bool isPrime(int n) 
{ 
    // Corner cases 
    if (n <= 1) 
        return false; 
    if (n <= 3) 
        return true; 
  
    // This is checked so that we can skip 
    // middle five numbers in below loop 
    if (n % 2 == 0 || n % 3 == 0) 
        return false; 
  
    for (int i = 5; i * i <=n; i = i + 6) 
        if (n % i == 0 || n % (i + 2) == 0) 
            return false; 
  
    return true; 
} 
  


int main() {
	int a;
	cin>>a;
	cout<<int(pow(a,3) + pow(a,2) + a)<<endl;
}



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

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

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

using namespace std;

int main()
{
    int N, mini = 1e9;
    cin >> N;
    vector<int> a(N);
    for (int i = 0; i < N; i++) {
        cin >> a[i];
        mini = min(mini, a[i]);
    }

    for (int i = 1; i <= mini; i++) {
        bool div = 1;
        for (int j = 0; j < N; j++) {
            if (a[j] % i != 0) {
                div = 0;
                break;
            }
        }
        if (div) cout << i << endl;
    }
    return 0;
}

Measured memory_bytes: 3096
#include <bits/stdc++.h>
using namespace std;
#define _GLIBCXX_DEBUG
#define rep(i,n) for(long long i = 0; i < (n); ++i)
#define ll long long
#define P pair<ll,ll>
#define all(v) (v).begin(),(v).end()

const ll mod = 1e9+7;
const ll INF = 1e18;
const double pi = acos(-1.0);

int main(void)
{
    ll h,w;
    cin >> h >> w;
    vector<vector<string>> s(h,vector<string>(w));
    rep(i,h)rep(j,w){
        cin>>s[i][j];
        if(s[i][j]=="snuke"){
            char c = 'A'+j;
            cout << c << i+1 << endl;
            break;
        }
    }
    return 0;
}

Measured memory_bytes: 3596
import java.io.*;
import java.util.*;
public class Main{
    public static void main(String[] args) throws IOException{
        MyReader r = new MyReader();    
        String S = r.s();
        byte[] alf = new byte[26];
        for(char c : S.toCharArray())
            alf[c-'a']++;
        boolean flag = true;
        for(byte a : alf)
            if(a > 1)
                flag = false;
        println(flag ? "yes" : "no");
    }
    static void print(Object o){
        System.out.print(o.toString());
    }
    static void println(Object o){
        System.out.println(o.toString());
    }
    static int Int(String s){
        return Integer.parseInt(s);
    }
    static long Long(String s){
        return Long.parseLong(s);
    }
    static class MyReader extends BufferedReader{
        MyReader(){
            super(new InputStreamReader(System.in));
        }
        String s() throws IOException{
            return readLine();
        }
        String[] ss() throws IOException{
            return s().split(" ");
        }
        int i() throws IOException{
            return Int(s());
        }
        int[] ii() throws IOException{
            String[] ss = ss();
            int size = ss.length;
            int[] ii = new int[size];
            for(int j = 0; j < size; j++) ii[j] = Int(ss[j]);
            return ii;
        }
        long l() throws IOException{
            return Long(s());
        }
        long[] ll() throws IOException{
            String[] ss = ss();
            int size = ss.length;
            long[] ll = new long[size];
            for(int j = 0; j < size; j++) ll[j] = Long(ss[j]);            
            return ll;
        }
    }
}

Measured memory_bytes: 21332
#include<stdio.h>
#include <cmath>
#include<string.h>
#include <iostream>
#include <algorithm>
using namespace std;

int main() {
    string s;
    cin >> s;
    int len = s.size();
    int count = 0;
    for(int i=0;i<len/2;i++){
        if(s[i] != s[len-i-1]) {
            count++;
        }
    }
    cout << count << endl;
}

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

#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep1(i, n) for (int i = 1; i < (int)(n); i++)
#define INF 1000000000000
using ll = long long;

int main(){
  int n,k;
  cin >> n>> k;
  vector<ll> h(n);
  rep(i,n)cin >> h.at(i);
  sort(h.begin(),h.end());
  ll ans = h.at(n-1);
  for(int i = 0; i < n-k+1; i++){
    ans = min(ans,h.at(i+k-1)-h.at(i));
  }
  cout<<ans<<endl;
  return 0;
}

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

vector<string> text;
string buffer;

int main()
{
	string input;
	
	while (true){
		getline(cin, input);
		if (input == "END_OF_TEXT") break;
		text.push_back(input);
	}
	
	int p1 = 0;
	int p2 = 0;
	
	while (true){
		cin >> input;
		if (input == "-") break;
		
		if (input == "a") p2 = 0;
		if (input == "e") p2 = text[p1].size();
		if (input == "p"){
			if (p1 > 0) p1--;
			p2 = 0;
		}
		if (input == "n"){
			if (p1 + 1 < text.size()) p1++;
			p2 = 0;
		}
		if (input == "f"){
			if (p2 < text[p1].size()) p2++;
			else if (p2 == text[p1].size() && p1 + 1 < text.size()){
				p1++;
				p2 = 0;
			}
		}
		if (input == "b"){
			if (p2 > 0) p2--;
			else if (p1 > 0){
				p1--;
				p2 = text[p1].size();
			}
		}
		if (input == "d"){
			if (p2 < text[p1].size()) text[p1].erase(p2, 1);
			else if (p1 + 1 < text.size()){
				text[p1] += text[p1 + 1];
				text.erase(text.begin() + p1 + 1);
			}
		}
		if (input == "k"){
			if (p2 == text[p1].size()){
				if (p1 + 1 < text.size()){
					if (p2 < text[p1].size()) text[p1].erase(p2, 1);
					else if (p1 + 1 < text.size()){
						text[p1] += text[p1 + 1];
						text.erase(text.begin() + p1 + 1);
					}
					buffer = "\n";
				}
			}
			else {
				buffer = string(text[p1], p2, text[p1].size() - p2);
				text[p1].erase(p2);
				p2 = text[p1].size();
			}
		}
		if (input == "y"){
			if (buffer == "") continue;
			if (buffer == "\n"){
				string tmp(text[p1], p2, text[p1].size() - p2);
				text[p1].erase(p2);
				text.insert(text.begin() + p1 + 1, tmp);
				p1++;
				p2 = 0;
			}
			else {
				text[p1].insert(p2, buffer);
				p2 += buffer.size();
			}
		}
	}
	
	for (int i = 0; i < text.size(); i++){
		cout << text[i] << endl;
	}
}

Measured memory_bytes: 1216
class Combination:
    def __init__(self, n_max, mod=10 ** 9 + 7):
        # O(n_max + log(mod))
        self.mod = mod
        f = 1
        self.fac = fac = [f]
        for i in range(1, n_max + 1):
            f = f * i % mod
            fac.append(f)
        f = pow(f, mod - 2, mod)
        self.facinv = facinv = [f]
        for i in range(n_max, 0, -1):
            f = f * i % mod
            facinv.append(f)
        facinv.reverse()

    # "n 要素" は区別できる n 要素
    # "k グループ" はちょうど k グループ

    def __call__(self, n, r):  # self.C と同じ
        return self.fac[n] * self.facinv[r] % self.mod * self.facinv[n - r] % self.mod

    def nCr(self, n, r):
        if not 0 <= r <= n:
            return 0
        return self.fac[n] * self.facinv[r] % self.mod * self.facinv[n - r] % self.mod


def resolve():
    MOD = 10 ** 9 + 7
    H, W, N = map(int, input().split())
    wall = []
    for _ in range(N):
        r, c = map(lambda x: int(x) - 1, input().split())
        wall.append((r, c))
    # 番兵
    wall.append((H - 1, W - 1))
    wall.sort()

    cmb = Combination((H + W) + 1)
    dp = [0] * (N + 1)

    # 壁がない時(0,0)から(x,y)まで移動する場合の数: x+yCx
    # dp[i] =f(r[i]+c[i],c[i])−(i−1番目までの壁に1回以上ぶつかって壁iの位置にたどり着く場合の数)
    for i in range(N + 1):
        r1, c1 = wall[i]
        dp[i] = cmb.nCr(r1 + c1, c1)
        for j in range(0, i):
            dx = r1 - wall[j][0]
            dy = c1 - wall[j][1]
            # dp[j]: 1～j-1 番目の壁を避けてj番目の壁の位置にたどり着く場合の数
            # nCr :  j 番目の壁の位置からi番目の壁の位置まで壁を無視して移動する場合の数
            tmp = dp[j] * cmb.nCr(dx + dy, dy)
            dp[i] = (dp[i] - tmp % MOD + MOD) % MOD

    print(dp[N])


if __name__ == "__main__":
    resolve()

Measured memory_bytes: 97616
#include<bits/stdc++.h>
//#include <ext/pb_ds/assoc_container.hpp>
//#include<ext/pb_ds/tree_policy.hpp>
#include<cstdio>
#include<vector>
#include<stdio.h>
#include<cstring>
#include<algorithm>
#include<string>
#include<iostream>
#include<map>
#include<set>
#include<queue>
#include<set>
#define READ                freopen("in.txt", "r", stdin)
#define WRITE               freopen("out.txt", "w", stdout)
#define INF9                1000000010
#define INF18               1000000000000000010
#define dist(ax,ay,bx,by)   sqrt((ax-bx)*(ax-bx)+(ay-by)*(ay-by))
#define gcd(a,b)            __gcd(a,b)
#define lcm(a,b)            (a*b)/__gcd(a,b)
#define m_p(a,b)            make_pair(a,b)
#define sqr(a)              ((a)*(a))
#define pb                  push_back
#define bpll(a)             __builtin_popcountll(a)
#define MX                  1000000
#define PI                  acos(-1)
#define mod                  1000000007
#define cnt_bin(n)          __builtin_clzll(0ll) - __builtin_clzll(n)

typedef long long lli;
using namespace std;

lli r, c, k;
lli grid[3001][3001];

lli dp[3001][3001][4];

void rset()
{
    for(lli i=0; i<3001; i++)
    {
        for(lli j=0; j<3001; j++)
        {
            dp[i][j][0]=-1;
            dp[i][j][1]=-1;
            dp[i][j][2]=-1;
            dp[i][j][3]=-1;
        }
    }
}

lli func(lli i, lli j, lli taken)
{
    if(i>=r || j>=c) return 0;
    if(dp[i][j][taken]!= -1) return dp[i][j][taken];

    lli ret1 = 0, ret2=0;

    ret1= func(i, j+1, taken);
    if(taken+1<=3) ret1= max(ret1, grid[i][j]+ func(i, j+1, taken+1));



    ret2 = func(i+1, j, 0);
    if(taken+1<=3) ret2= max(ret2, grid[i][j]+ func(i+1, j, 0));

    return dp[i][j][taken]= max(ret1, ret2);
}

int main()
{
    rset();
    scanf("%lld %lld %lld", &r, &c, &k);

    for(lli i=0; i<k; i++)
    {
        lli a, b, x;
        scanf("%lld %lld %lld", &a, &b, &x);

        grid[a-1][b-1]=x;
//        cout<<a<<" "<<b<<" "<<x<<endl;
//        cout<<grid[a][b]<<endl;
    }



    lli ans= func(0, 0, 0);
    cout<<ans<<endl;


    return 0;
}


Measured memory_bytes: 355868
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <cstdio>
#include <cstring>

using namespace std;
int main() {
	int n;
	cin >> n;
	int dp[3][103];
	memset(dp, 0, sizeof(dp));
	int a[3][103];
	for(int i=1; i<3; i++){
		for(int j=1; j<=n; j++){
			cin >> a[i][j];
		}
	}
	for(int j=1; j<=n; j++){
		dp[1][j] = dp[1][j-1] + a[1][j];
	}
	dp[2][1] = dp[1][1] + a[2][1];
	for(int j=2; j<=n; j++){
		dp[2][j] = max(dp[1][j], dp[2][j-1]) + a[2][j];
	}
	cout << dp[2][n] << endl;
	return 0;
}

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

using namespace std;

#define REP(i,n) for(int i=0;i<n;i++)
#define MAX(x) *max_element(ALL(x)) //最大値を求める
#define MIN(x) *min_element(ALL(x)) //最小値を求める

int main(){

  int n, k;

  cin >> n >> k;

  vector<int> p(n);

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

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

  int ans=0;
  REP(i,k){
    ans += p[i];
  }

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


Measured memory_bytes: 3628
import numpy as np

n = int(input())
L = np.array([int(i) for i in input().split()])
LL = np.roll(L, -1)
LL[-1] = pow(10,9)+1
LL = L >= LL

tindex = -1
out = 0
for i in range(n):
  if LL[i] == False:
    if (i-tindex) > out:
      out = i-tindex-1
    tindex = i
print(out)

Measured memory_bytes: 23392
import java.util.*;

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

       int X = sc.nextInt();
       int Y = sc.nextInt();
       char[][] borad = new char [55][55]; 

       for (int i=0; i < X; i++) {
           String s = sc.next();
           for (int j=0; j < Y; j++) {
               borad[i][j] = s.charAt(j); 
           }
       }

       int count = 0; 

       for (int i=1; i <= X; i++) {
           for (int j=1; j <= Y; j++) {
               if (borad[i][j] == '#' && borad[i][j - 1] != '#' && borad[i][j + 1] != '#' 
                                        && borad[i - 1][j] != '#' && borad[i + 1][j] != '#') {
                   count++;
               }
            }
        }

        System.out.println(count == 0 ? "Yes" : "No");
    }
}

Measured memory_bytes: 23252
#include <iostream>
#include <string>
#include <vector>
#include <map>
#include <algorithm>
using namespace std;
long long gcd(long long a, long long b) { return b?gcd(b,a%b):a;}
long long lcm(long long a, long long b) { return a/gcd(a,b)*b;}

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

int main() {
  int h, a;
  cin >> h >> a;
  if (h % a == 0) cout << h / a << endl;
  else cout << (h / a) + 1  << endl;
  return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <sstream>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <ctime>
#include <cstring>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <deque>
#include <map>
#include <set>
#include <bitset>
#include <numeric>
#include <utility>
#include <iomanip>
#include <algorithm>
#include <functional>
using namespace std;
const int INF=1e9;

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

int main(){
    int n, y;
    cin>>n>>y;
    int ans1=-1, ans5=-1, ans10=-1;
    for(int i=0; i<=n; i++){
        for(int j=0; i+j<=n; j++){
            int k=n-i-j;
            if(i*1000+j*5000+k*10000==y){
                ans1=i;
                ans5=j;
                ans10=k;
                break;
            }
        }
    }
    cout<<ans10<<' '<<ans5<<' '<<ans1<<endl;
    
}


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

if n >= 400 and n <= 599:
  print(8)
elif n >= 600 and n <= 799:
  print(7)
elif n >= 800 and n <= 999:
  print(6)
elif n >= 1000 and n <= 1199:
  print(5)
elif n >= 1200 and n <= 1399:
  print(4)
elif n >= 1400 and n <= 1599:
  print(3)
elif n >= 1600 and n <= 1799:
  print(2)
elif n >= 1800 and n <= 1999:
  print(1)

Measured memory_bytes: 61660
#include <bits/stdc++.h>
typedef long long int ll;
typedef long double ld;
using namespace std;
const long long int INF = 1e18;
const long long int mod = 1e9+7;

typedef pair<ll, ll> pairs;
typedef vector<pairs> p;

struct Edge{
    ll to, weight;
    Edge(ll t, ll w) : to(t), weight(w){}
};
using graph = vector<vector<ll>>;
using Graph = vector<vector<Edge>>;


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

ll lcm(ll a, ll b){
    return a / gcd(a, b) * b;
}

ll keta(ll N){
    int tmp{};
    while( N > 0 ){
        tmp += ( N % 10 );
        N /= 10;
    }
    N = tmp;
    return N;
}

// 回文
bool kai(string S){
    bool flag = true;
    for(ll i=0;i<S.size()/2;++i){
        if(S[i] != S[S.size()-i-1]){
            flag = false;
            break;
        }
    }
    return flag;
}
// ---------------------------------------------

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

    ll x = b / c + b / d - b / lcm(c, d);
    x = b - x;
    ll y = a /c + a / d - a / lcm(c, d);
    y = a - y;
    ll ans = x - y;
    cout<<ans<<endl;

    return 0;
}

Measured memory_bytes: 256
#include <algorithm>
#include <cmath>
#include <deque>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <set>
#include <stack>
#include <string>
#include <vector>

#define REP(i, n) for(int i = 0; i < n; ++i)
using namespace std;
using LLONG = long long;
const LLONG MOD = 1000000007;

int main()
{
	// 6->5->6->...で回すのが最善
	LLONG x; cin >> x;
	LLONG ans = (x / 11) * 2;
	if (x % 11 > 0 && x % 11 <= 6)
	{
		ans += 1;
	}
	else if (x % 11 > 6)
	{
		ans += 2;
	}
	cout << ans << endl;
}


Measured memory_bytes: 3612
#include <bits/stdc++.h>
#define fi first
#define se second
using namespace std;
typedef long long ll;
typedef pair<int,int> pa;
int mod=1e9+7;
map<int,int>mp;
int main()
{
    ios::sync_with_stdio(0);cin.tie(0);
    int x,n;
    cin>>x>>n;
    int ans=INT_MAX;
    int y;
    for(int i=1;i<=n;i++){
        cin>>y;
        mp[y]=1;
    }
    int k;
    for(int i=-200;i<=200;i++){
        if(!mp[i]){
            if(ans>abs(x-i)) k=i,ans=abs(x-i);
        }
    }
    cout<<k<<endl;
    return 0;
}


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

using namespace std;

#define all(c) (c).begin(), (c).end()
#define rep(i, n) for (int i = 0; i < (int)(n); i++)

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

string s;
int gx, gy;
bool valid(int x) { return (0 <= x && x < 16004); }
bool ok(int goal, vector<int> vec, bool first=false) {
    vector<int> cur(16004), next(16004);
    cur[8002] = true;

    rep(i, vec.size()) {
        rep(j, 16004) {
            if (valid(j + vec[i])) next[j + vec[i]] |= cur[j];
            if (!first && valid(j - vec[i])) next[j - vec[i]] |= cur[j];
        }
        first = false;
        cur.swap(next);
        next.clear();
        next.resize(16004);
    }
    return cur[goal];
}
int main() {
    cin >> s >> gx >> gy;
    gx += 8002;
    gy += 8002;
    int cnt = 0;
    int cnt_dir = 0;
    vector<int> vec[2];
    rep(i, s.size()) {
        if (s[i] == 'F') {
            cnt++;
        } else {
            vec[cnt_dir % 2].push_back(cnt);
            cnt = 0;
            cnt_dir++;
        }
    }
    if (cnt) vec[cnt_dir % 2].push_back(cnt);
    bool ans = true;
    ans &= ok(gx, vec[0], true);
    ans &= ok(gy, vec[1]);

    if (ans)
        cout << "Yes" << endl;
    else
        cout << "No" << endl;

    return 0;
}


Measured memory_bytes: 488
#include<iostream>
#include<string>
#include<algorithm>
#include<cctype>
#include<vector>
#include<map>
#include<iomanip>
using namespace std;
#define fr first
#define sc second
typedef pair<int,int> Pt;
int main(){
  map<char,Pt> tmp;
  for(int i = 0 ; i < 9 ; i++ ){
    tmp['A' + i] = Pt( i / 3 , i % 3 );
  }

  char s,t,b;
  Pt st,gt,bt;
  int n,d[]={0,1,0,-1};
  while(cin >> n && n){
    double dp[16][4][4] = {{{}}};
    cin >> s >> t >> b;
    st = tmp[s] , gt = tmp[t] , bt = tmp[b];
    dp[0][st.fr][st.sc] = 1.0;
    for(int i = 0 ; i < n ; i++ ){
      for(int x = 0 ; x < 4 ; x++ ){
        for(int y = 0 ; y < 4 ; y++ ){
          for(int j = 0 ; j < 4 ; j++ ){
            int px = x + d[j] , py = y + d[3-j];
            if( px < 0 || px > 2 || py < 0 || py > 2 || bt == Pt(px,py)){
              px = x , py = y;
            }
            dp[i+1][px][py] += dp[i][x][y] / 4.0;
          }
        }
      }
    }
    cout << fixed << setprecision(8) << dp[n][gt.fr][gt.sc] << endl;
  }
}

Measured memory_bytes: 1264