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

#include <iostream>
#define pb push_back
#define sort_incr(v) sort(v.begin(),v.end());
#define sort_decr(v) {sort(v.begin(),v.end()); reverse(v.begin(),v.end());}
#define take_input(v,n) for(ll i=0,temp;i<n;i++){cin>>temp;v.pb(temp);}
#define fastio {ios_base::sync_with_stdio(false);    cin.tie(NULL);}
#define ALL(v) v.begin(),v.end()

typedef long long ll;
using namespace std; 



////*********           REMOVE DUPLICATES FROM VECTOR       **********///////


vector<int>  remove_duplicate_elements(vector<int> v)
{
    vector<int>::iterator ip;
    ip = unique(v.begin(), v.end()); 
    v.resize(std::distance(v.begin(), ip)); 
    return v;
}


//// **************                CONVERT STRING TO UNIQUE CHARACTERS              **************////                  
string make_unique_string(string s)
{
    string s1="";
    for(int i=0;i<s.length();i++)
    {
        bool flag=true;
        for(int j=0;j<s1.length();j++)
        {
            if(s1[j]==s[i])
            {flag=false;break;}
        }
        
        if(flag)
        s1=s1+s[i];
        
    }
    return s1;
}

//////// Three Element Vector 
struct vec_thre
{
    int first ,second,third;
};


/////// Comparing on sorting a vector


bool comp(vec_thre a , vec_thre b)
{
    if (a.first != b.first ) 
        return a.first < b.first; 
    if (a.second != b.second) 
            return a.second < b.second; 
}

/////////Sorting vector on the basis of second Element of vector 

bool sortbysec(const pair<int,int> &a, 
              const pair<int,int> &b) 
{ 
    return (a.second < b.second); 
} 


// Driver function to sort the vector elements by  first element of pair in descending order, 
//if first is same than second is consdidered 
bool sortinrev(const pair<int,int> &a,  
               const pair<int,int> &b) 
{ 
    
        if(a.first!=b.first)
       return (a.first > b.first);
       
       return (a.second>b.second);

} 


int main() 
{
    char c;
    cin>>c;
    if(tolower(c)==c)
    {
        std::cout << "a" << std::endl;
    }
    else{
        cout<<"A";
    }
    
    
    return 0; 
} 























Measured memory_bytes: 3592
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  string S;
  cin >> S;
  if((S.at(2) == S.at(3))&&(S.at(4) == S.at(5))){
    cout << "Yes" << endl;
  }else{
    cout << "No" << endl;
  }
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int main(){
    int k,n;
    cin >> k >> n;
    vector<int> a(n);
    for(auto &x: a) cin >> x;
    int ans = k - (a[0] + k - a[n-1]);
    for(int i=0;i<n-1;i++){
        ans = min(ans, k - (a[i+1] - a[i]));
    }
    cout << ans << endl;
}

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

int main() {
  string w; cin >>w;
  vector<int> check(26);

  rep(i,0,w.size()) {
    check[int(w[i]-'a')]++;
  }

  bool flag=true;
  rep(i,0,26) {
    if (check[i]%2) {
      flag=false;
      break;
    }
  }

  cout <<(flag ? "Yes":"No") <<endl;
  return 0;
}


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

int n, m;
vector<int> edge[11];

int slv(int now, int f);

int main(){
  ios_base::sync_with_stdio(false);

  cin >> n >> m;
  for(int i=0;i<m;i++){
    int a, b;
    cin >> a >> b;
    edge[a].push_back(b);
    edge[b].push_back(a);
  }

  cout << slv(1, 0) << endl;

  return 0;
}

int slv(int now, int f){
  
  //cout << now << " " << f << endl;

  if(f & (1 << (now-1)))return 0;

  f = f | (1 << (now-1));
  
  if(f == (1 << (n)) - 1){
    return 1;
  }
  
  int ret = 0;
  for(int i=0;i<edge[now].size();i++){
    ret += slv(edge[now][i], f);
  }

  return ret;
}


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

ans = 0
for n in range(1,int(N/2)+1):
    if 2*n+1 > N:
        break
    for i in range(1,int(N**(1/2)/2)+1):
        for j in range(i+1,int(N**(1/2)/2)+1):
            for k in range(j+1,int(N**(1/2)/2)+1):
                if 2*n+1 == (2*i+1)*(2*j+1)*(2*k+1):
                    ans += 1

print(ans)


Measured memory_bytes: 9360
#include<stdio.h>
int a[12000];
int main()
{
	int i,j,k,n,max=0,sum=0;
	scanf("%d",&n);
	for(i=0;i<n;i++)
	{
		scanf("%d",&a[i]);
		if(a[i]>=max)
		{
			max=a[i];
			j=i;
		}
		sum+=a[i];
	}
	sum-=a[j]/2;
	printf("%d\n",sum);
	return 0;
}

Measured memory_bytes: 128
#include<iostream>
#include<string>
#include<cstring>
#include<algorithm>

using namespace std;

int main(){
    int N,H;
    cin>>N>>H;
    int a[100005],b[100005];
    for(int i=0;i<N;i++){
        cin>>a[i]>>b[i];
    }
    sort(a,a+N);
    sort(b,b+N);
    int ex=a[N-1];
    int cnt=0;
    for(int i=N-1;i>=0;i--){
        if(b[i]<ex){
            break;
        }
        else{
            H-=b[i];
            cnt++;
            if(H<=0){
                cout<<cnt;
                return 0;
            }
        }
    }
    if(H%ex==0){
        cnt+=(H/ex);
    }
    else{
        cnt+=(H/ex)+1;
    }
    cout<<cnt;
}


Measured memory_bytes: 1024
#include<bits/stdc++.h>
using namespace std;
int main()
{
 int n,a,i;
  cin>>n>>a;
  if(n%a==0)
  {
    cout<<n/a<<endl;
  }
  else
  {
   cout<<n/a+1<<endl;
  }
  return 0;
}

Measured memory_bytes: 256
a, b, c = gets.split(" ").map{|x| x.to_i}
puts 0.5 * a * b * Math::sin(c * Math::PI / 180.0)
puts a + b + Math::sqrt(a ** 2 + b ** 2 - 2 * a * b * Math::cos(c * Math::PI / 180.0))
puts b * Math::sin(c * Math::PI / 180.0)

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

int main()
{
  int D,T,S;
  cin>>D>>T>>S;
  
  if(D <= T * S)
  {
    cout<<"Yes"<<endl;
  }
  else
  {
    cout<<"No"<<endl;
  }
  
  return 0;
}

Measured memory_bytes: 3608
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define F first
#define S second
#define pii pair<int, int>
#define eb emplace_back
#define all(v) v.begin(), v.end()
#define rep(i, n) for (int i = 0; i < n; ++i)
#define rep3(i, l, n) for (int i = l; i < n; ++i)
#define chmax(a, b) a = max(a, b)
#define chmin(a, b) a = min(a, b)
#define out(a) cout << a << endl
#define outa(a, n) rep(_, n) cout << a[_] << " "; cout << endl
#define SZ(v) (int)v.size()
#define inf (int)(1e9+7)

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    int n;
    cin >> n;
    int a[n];
    int sum = 0;
    rep(i, n) { cin >> a[i]; sum += a[i] - 1; }
    out(sum);
    
}
/*
 mで全探索する場合、mの上限は100000でないことに注意
 */


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

using namespace std;

int main(){
    int n,y=0,x=0;
    cin>>n;
   string s;
   cin>>s;
   for(int i=0;i<n;i++){
  if(s[i]=='I')
    x++;
    else
    x--;
  if(x>y)
    y=x;
   }
   cout<<y<<endl;
    return 0;
}


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

namespace AtTest.ABC_144
{
    class E
    {
        static void Main(string[] args)
        {
            var sw = new System.IO.StreamWriter(OpenStandardOutput()) { AutoFlush = false };
            SetOut(sw);

            Method(args);

            Out.Flush();
        }

        static void Method(string[] args)
        {
            long[] nk = ReadLongs();
            long n = nk[0];
            long k = nk[1];
            long[] array = ReadLongs();
            long[] fs = ReadLongs();
            Array.Sort(array);
            Array.Sort(fs);
            long bottom = -1;
            long top = long.MaxValue / 4;
            while (bottom + 1 < top)
            {
                long mid = (bottom + top + 1) / 2;
                long cnt = 0;
                for(int i = 0; i < n; i++)
                {
                    long val = array[i] * fs[n - i - 1];
                    if (val > mid)
                    {
                        long delta = (val - mid) / fs[n - i - 1];
                        if ((val - mid) % fs[n - i - 1] > 0) delta++;
                        cnt += delta;
                    }
                }
                if (cnt <= k) top = mid;
                else bottom = mid;
            }
            WriteLine(top);
        }

        private static string Read() { return ReadLine(); }
        private static char[] ReadChars() { return Array.ConvertAll(Read().Split(), a => a[0]); }
        private static int ReadInt() { return int.Parse(Read()); }
        private static long ReadLong() { return long.Parse(Read()); }
        private static double ReadDouble() { return double.Parse(Read()); }
        private static int[] ReadInts() { return Array.ConvertAll(Read().Split(), int.Parse); }
        private static long[] ReadLongs() { return Array.ConvertAll(Read().Split(), long.Parse); }
        private static double[] ReadDoubles() { return Array.ConvertAll(Read().Split(), double.Parse); }
    }
}


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

#define i_cin(X) scanf("%d", &X)
#define i_cin2(X,Y) scanf("%d %d",&X,&Y)
#define i_cin3(X,Y,Z) scanf("%d %d %d",&X,&Y,&Z)
#define l_cin(X) scanf("%ld",&X)
#define l_cin2(X,Y) scanf("%ld %ld",&X,&Y)
#define s_cin(X) scanf("%s",&X)

#define  i_cout(X) printf("%d\n",X)
#define  f_cout(X) printf("%g\n",X)
#define  i_cout2(X,Y) printf("%d %d\n",X,Y)
#define  l_cout(X) printf("%ld\n",X)
#define  s_cout(X) printf("%s\n",X)
#define  ll_cout(X) printf("%lld\n",X)

typedef long long int lli;
#define rept(x, s, n) for (int x = s; x < n; x++)

#define Yes_RTN s_cout("Yes");return 0
#define No_RTN  s_cout("No");return 0
#define YES_RTN s_cout("YES");return 0
#define NO_RTN  s_cout("NO");return 0


int i_cins(int n, int* A);
int l_cins2(int n, long* A,long* B);
int s_dsort(const void* a, const void* b);
int s_asort(const void* a, const void* b);


int main(void) {

	int    N,K;

	i_cin2(N,K);
	
	if ((N+1)/2 >= K) { YES_RTN; }
	NO_RTN;
	}
	
//降順
int s_dsort(const void* a, const void* b) {
	return(*(int*)b - *(int*)a);
}
int s_asort(const void* a, const void* b) {
	return(*(int*)a -*(int*)b);
}
//
int l_cins2(int n, long* a, long* b) {
	int i;
	rept(i, 0, n) {
		l_cin2(*(a + i), *(b + i));
	}
	return 0;
}
int i_cins(int n, int* a) {
	int i;
	rept(i, 0, n) {
		i_cin(*(a + i));
	}

	return 0;
}


Measured memory_bytes: 128
#include<bits/stdc++.h>
using namespace std;
#define rep(i,j,n) for(int i=(int)(j);i<(int)(n);i++)
#define REP(i,j,n) for(int i=(int)(j);i<=(int)(n);i++)
#define MOD 1000000007
#define int long long
#define ALL(a) (a).begin(),(a).end()
#define vi vector<int>
#define vii vector<vi>
#define pii pair<int,int>
#define priq priority_queue<int>
#define disup(A,key) distance(A.begin(),upper_bound(ALL(A),(int)(key)))
#define dislow(A,key) distance(A.begin(),lower_bound(ALL(A),(int)(key)))
#define tii tuple<int,int,int>
#define Priq priority_queue<int,vi,greater<int>>
#define pb push_back
#define mp make_pair
#define INF (1ll<<60)
signed main(){
  int N; cin>>N;
  vi A(N),B(N);
  rep(i,0,N) cin>>A[i];
  rep(i,0,N) B[A[i]-1]=i;
  vi C(N),D(N);
  C[0]=1;
  D[0]=1000000000;
  rep(i,1,N){
    if(B[i]<B[i-1]){
      C[i]=C[i-1]+1;
      D[i]=C[i-1]+D[i-1]+B[i]-B[i-1]-C[i];
    }
    else{
      D[i]=D[i-1]-1;
      C[i]=C[i-1]+D[i-1]+B[i]-B[i-1]-D[i];
    }
  }
  rep(i,0,N) cout<<C[i]<<" ";
  cout<<endl;
  rep(i,0,N) cout<<D[i]<<" ";
  cout<<endl;
  }



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

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

typedef long long ll;

void solve(long long N, std::vector<long long> H){
  vector< vector<int> > array(N, vector<int>(2, 0));

  array[0][0] = 1; // 下げない場合
  array[0][1] = 1; // 下げた場合

  for(ll i=0; i<N-1; i++){
    array[i+1][0] = 0;
    array[i+1][1] = 0;

    if(array[i][0]){ // i を下げない場合
      if(H[i]-0 <= H[i+1]){
        array[i+1][0] = 1;
      }
      if(H[i]-0 <= H[i+1]-1){
        array[i+1][1] = 1;
      }
    }
    if(array[i][1]){ // i を下げる場合
      if(H[i]-1 <= H[i+1]){
        array[i+1][0] = 1;
      }
      if(H[i]-1 <= H[i+1]-1){
        array[i+1][1] = 1;
      }
    }
  }

  if(array[N-1][0] || array[N-1][1] ){
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
}

// Generated by 1.1.5 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
int main(){
    long long N;
    scanf("%lld",&N);
    std::vector<long long> H(N);
    for(ll i = 0 ; i < N ; i++){
        scanf("%lld",&H[i]);
    }
    solve(N, std::move(H));
    return 0;
}


Measured memory_bytes: 6528
//本番コードの書き直し版
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
typedef long long int ll;
typedef pair<int, int> P;

int n;
vector<string> s(0);

void dfs(string t, char mc){
  if(t.size() == n){
    printf("%s\n", t.c_str());
    return;
  }
  for(char i = 'a'; i <= mc + 1; i++){
    dfs(t + i, max(mc, i));
  }
  return;
}

int main(){
  cin >> n;
  dfs("a", 'a');
  return 0;
}

Measured memory_bytes: 1536
#include <iostream>
using namespace std;
int main(void){
    
    int n,a[100] = {0};
    cin >> n;
    for(int i = 0; i < n; i++){
        cin >> a[i];
    }
    cout << a[n-1];
    for(int i = 1; i < n; i++){
        int j = n-1 - i ;
        cout <<  " " << a[j]  ; 
    }    
    cout << endl;
    
}




Measured memory_bytes: 3092
#include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <cmath>
#include <fstream>
#include <vector>
#include <string>
#include <algorithm>
using namespace std;
int main(void){
    int n,k;
    cin>>n>>k;
    int p[n];
    for(int i=0;i<n;i++){
        cin>>p[i];
    }
    sort(p,p+n);
    int sum=0;
    for(int i=0;i<k;i++){
        sum+=p[i];
    }
    cout<<sum<<endl;
}


Measured memory_bytes: 3564
use std::io::Read;

fn main() {
    let (k, x) = {
        let mut buf = String::new();
        std::io::stdin().read_line(&mut buf).unwrap();
        let mut iter = buf.split_whitespace();
        (
            iter.next().unwrap().parse::<i32>().unwrap(),
            iter.next().unwrap().parse::<i32>().unwrap(),
        )
    };
    println!("{}", if 500 * k >= x { "Yes" } else { "No" });
}


Measured memory_bytes: 4352
#include<iostream>
#include<algorithm>
#include<vector>
#include<set>
typedef long long ll;

using namespace std;
#define N 100010
typedef pair<ll,pair<ll,ll> >P;
P x[N];ll n;
int main(){
  cin>>n;
  for(int i=0;i<n;i++){
    cin>>x[i].second.first>>x[i].second.second;
    x[i].first=x[i].second.first+x[i].second.second;
  }
  sort(x,x+n,greater<P>());
  ll ans=0;
  for(int i=0;i<n;i++){
    if(i%2==0){
      ans+=x[i].second.first;
    }
    else{
      ans-=x[i].second.second;
    }
  }
  cout<<ans<<endl;
    return 0;
}


Measured memory_bytes: 2560
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
#define rep(i, n) for (ll i = 0; i < (ll)(n); i++)
#define rep2(i, s, n) for (ll i = (s); i < (ll)(n); i++)
#define repd(i, n) for (ll i = (ll)(n)-1; i >= 0; i--)
const ll INF = 1LL << 60;
const int INF32 = 1 << 29;
const ll MOD = 1000000007;
using Graph = vector<vector<int>>; // グラフ型
using pint = pair<int, int>;

int main()
{
    int K, S;
    cin >> K >> S;
    int ans = 0;
    rep(X, K + 1)
    {
        rep(Y, K + 1)
        {
            int Z = S - X - Y;
            if (Z >= 0 && Z <= K)
            {
                ans++;
            }
        }
    }
    cout << ans << endl;
}

Measured memory_bytes: 256
S = input()
K = int(input())
N = len(S)

# うまいこと全列挙のする方法がわからなかったがこうやれば良いのか...
tmp = set()
for i in range(min(N,K)):
    for j in range(N-i):
        tmp.add(S[j:j+i+1])

tmp = list(tmp)
tmp.sort()
print(tmp[K-1])

Measured memory_bytes: 4464
#define _USE_MATH_DEFINES
#include <bits/stdc++.h>
using namespace std;
signed main() { 
  ios::sync_with_stdio(false); cin.tie(0);
  int n;
  cin >> n;
  string s;
  cin >> s;
  int ans = 0;
  for (int i = 0; i < n; i++) if (s.substr(i, 3) == "ABC") ans++;
  cout << ans << '\n';
  return 0;
}

Measured memory_bytes: 256
#include<stdio.h>
#include<algorithm>
using namespace std;
int main()
{   int n,l,i,m,a,b,e;
	while(~scanf("%d%d%d",&a,&b,&e))
	{  
	    int c[3];
	    
		c[0]=a;
		c[1]=b;
		c[2]=e;
		sort(c,c+3);
		if(c[0]==5&&c[1]==5&&c[2]==7)
		printf("YES\n");
		else
		printf("NO\n");	
	}
}

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



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

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

using namespace std;

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

	int dp[3][100001]={};
	rep(i,n){
		int a,b,c; scanf("%d%d%d",&a,&b,&c);
		dp[0][i+1]=max(dp[1][i],dp[2][i])+a;
		dp[1][i+1]=max(dp[0][i],dp[2][i])+b;
		dp[2][i+1]=max(dp[0][i],dp[1][i])+c;
	}
	printf("%d\n",max({dp[0][n],dp[1][n],dp[2][n]}));

	return 0;
}


Measured memory_bytes: 1408
#include <cstdio>
#include <algorithm>
using namespace std;

typedef long long int LLI;

LLI cnt[5001];

int main() {
  for (int i=0; i<=1000; i++) {
    for (int j=0; j<=1000; j++) {
      cnt[i+j]++;
    }
  }

  while (1) {
    int n;
    if (scanf("%d", &n) != 1) return 0;

    LLI ans = 0;
    for (int i=0; i<=min(n, 2000); i++) {
      ans += cnt[i]*cnt[n-i];
    }
    printf("%lld\n", ans);
  }
}

Measured memory_bytes: 2756
n, x = map(int, input().split())
l = list(map(int, input().split()))

pre_coordinate = 0
ans = 1

for i in range(1, n+1):
    coordinate = pre_coordinate + l[i-1]
    if coordinate > x:
        break
    pre_coordinate = coordinate
    ans += 1

print(ans)


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

using namespace std;
typedef long long ll;

#define MOD (long long)(1e9+7)
#define INF (1LL<<60)
#define rep(i,n) for(ll i = 0; i < (n); i++)
#define rep1(i,n) for(ll i = 1; i <= (n); i++)

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


// 最大公約数
ll gcd(ll a, ll b)
{
  if(b == 0) return a;
  return gcd(b, a % b);
}

// mod m におけるa の逆元
ll modinv(ll a, ll m) {
  ll b = m, u = 1, v = 0;
  while (b) {
    ll t = a / b;
    a -= t * b; swap(a, b);
    u -= t * v; swap(u, v);
  }
  u %= m;
  if (u < 0) u += m;
  return u;
}

// 素因数分解
vector<pair<ll, ll>> prim;
void pf(ll n)
{
  ll s = sqrt(n);
  ll r = 0;
  for(ll i = 2; i <= s; i++) {
    if((n % i) == 0) {
      r = 0;
      do {
	r++;
	n = n / i;
      } while((n % i) == 0);
      prim.push_back({i, r});
    }
  }
  if(n > s) {
    prim.push_back({n, 1});
  }
}

void solve()
{
  ll N, K; cin >> N >> K;
  vector<ll> a(N); rep(i, N) cin >> a[i];

  rep(j, K) {
    vector<ll> im(N+1, 0);
    rep(i, N) {
      ll st = max(i - a[i], 0LL);
      ll ed = min(i + a[i] + 1, N);
      im[st] ++;
      im[ed] --;
    }
    vector<ll> b(N,0);
    b[0] = im[0];
    rep1(i, N-1) {
      b[i] = b[i - 1] + im[i];
    }
    bool loop = false;
    rep(l, N) {
      if(a[l] != b[l]) {
	a[l] = b[l];
	loop = true;
      } else {
      }
    }
    if(!loop) break;
  }
  rep(i, N) {
    cout << a[i] << " ";
  }
  cout << endl;
}


int main(void)
{
  // ll t; cin >> t; REP(i, t)
  solve();
}


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

using namespace std;

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

	int n;
	cin >> n;

	string s;
	cin >> s;

	int ans = 1;

	for(int i = 0; i < n - 1; ++i) {
		if(s[i] != s[i + 1]) {
			++ans;
		}
	}

	cout << ans << '\n';

	return 0;
}


Measured memory_bytes: 512
l,r = map(int,input().split())
if(r-l >= 2019):
    print(0)
    exit()

mod = 2019

ans = 2018
for i in range(l,r):
    for j in range(i+1,r+1):
        i %= mod
        j %= mod
        ans = min(ans, (i*j)%mod)

print(ans)

Measured memory_bytes: 40300
#include <bits/stdc++.h>
 
using namespace std;
int main(void)
{
  int n;
  cin >> n;
  
  int count = 0;
  for(int i=357; i<=n; i+=1){
      //cout << i << endl;
      int i3=0, i5=0, i7=0;
      int tmp = i;
      int max_d=0;
      while(tmp>0){
          int r = tmp % 10;
          
          if(r==3) i3++;
          else if(r==5) i5++;
          else if(r==7) i7++;
          else max_d++;
          
          tmp /= 10;
      }
      if(tmp==0 && max_d==0 && i3 && i5 && i7)
        count++;
      else if(max_d != 0)
        i += pow(10, max_d-1) - 1;
        
  }
  cout << count << endl;
  return 0;
}


Measured memory_bytes: 384
a=gets.chomp
b=gets.chomp
c=gets.chomp
s=[a,b,c]

now=0
while true
  if s[now].size==0
    break
  end
  ch=s[now][0]
  s[now].slice!(0)
  now=ch=='a' ? 0 : ch=='b' ? 1 : 2
end

case now
when 0
  puts "A"
when 1
  puts "B"
when 2
  puts "C"
end

Measured memory_bytes: 1788
#include <vector>
#include <algorithm>
#include <map>
#include <unordered_map>
#include <iostream>

using namespace std;

int main() {
    string S;
    cin >> S;
    int ans = 0;
    for(char c: S)
        ans += c == '+' ? 1: -1;
    cout << ans << endl;
    return 0;
}


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

#define REP(i,a,b) for(int i=a;i<b;i++)

int n,g,a,b;
int d[1<<20];
vector<int> m[5][5];

int rec(int g, int t){
  if(t == 5){
    if( (g & 31) )return 1000000;
    return d[g>>5];
  }
  int r = rec(g,t+1);
  for(int i=0;i<m[0][t].size();i++)r = min(r,rec(g^m[0][t][i],t+1)+1);
  return r;
}
    
int main(){
  REP(i,0,5)REP(j,0,5)REP(k,i,5)REP(l,j,5){
    int tmp = 0;
    REP(y,i,k+1)REP(x,j,l+1)tmp |= 1<<(y*5+x);
    m[i][j].push_back(tmp);
  }

  for(int i=0;i<(1<<20);i++)d[i] = -1; d[0] = 0;
  queue<int> q; q.push(0);
  while(q.size()){
    int p = q.front(); q.pop();
    REP(i,0,4)REP(j,0,5)REP(k,0,m[i][j].size()){
      if(m[i][j][k]>=1<<20)continue;
      int nxt = p^m[i][j][k];
      if(d[nxt]<0){
	d[nxt] = d[p] + 1;
	q.push(nxt);
      }
    }
  }

  while(cin >> n,n){
    g = 0;
    REP(i,0,5)REP(j,0,5)
      if(i<n && j<n){
	cin >> b;
	g |= b<<(i*5+j);
      }
    
    if(n<5)a = d[g];
    else a = rec(g,0);
    
    REP(i,0,a)cout << "myon";
    cout << endl;
  }
}

Measured memory_bytes: 7804
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		Scanner scanner = new Scanner(System.in);
		char[] input = scanner.nextLine().toCharArray();
		String result = "No";
		if(input[2] == input[3] && input[4] == input[5]) result = "Yes";
		System.out.println(result);
		scanner.close();
	}

}


Measured memory_bytes: 23124
a=int(input())
b=int(input())

if a==1 and b==2:
  print(3)
elif a==1 and b==3:
  print(2)
elif a==2 and b==1:
  print(3)
elif a==2 and b==3:
  print(1)
elif a==3 and b==1:
  print(2)
elif a==3 and b==2:
  print(1)

Measured memory_bytes: 3060
#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define pa(x,n) for(ll i=0;i<n;i++){cout<<(x[i])<<" \n"[i==n-1];};
#define pb push_back

using ll = long long;
using namespace std;
using pint = pair<int,int>;
using pll = pair<ll,ll>;
const int INFint = 1e9;
const ll INFll = 1e18;
ll MOD=1e9+7;

ll gcd(ll a, ll b) { return __gcd(a,b); } //最大公約数
ll lcm(ll a, ll b) { return a/gcd(a,b)*b; } //最大公倍数

// aのn乗をMODで割りながら計算する
ll modpow(ll a, ll n) {
  long long res = 1;
  while (n > 0) {
    if (n & 1) res = res * a % MOD;
    a = a * a % MOD;
    n >>= 1; // right shift
  }
  return res;
}

// MODを法としたaの逆元を計算する
ll modinv(ll a) {
  return modpow(a, MOD - 2);
}

vector<int> G[100001],Q[100001];
set<int> group[100000];
vector<bool> seen;
int cnt(0);
int group_num[100001] = {0};
void dfs(int v) {
  group[cnt].insert(v); 
  group_num[v] = cnt;
  seen[v] = true;
  for (auto next_v : G[v]) { 
      if (seen[next_v]) continue;
      dfs(next_v); // 再帰的に探索
  }
}

int main(){
  int N,M,K;
  cin>>N>>M>>K;
	seen.assign(N, false);
  for (int i(0);i<M;i++){
    int a,b;
    cin>>a>>b;
    G[a].push_back(b);
    G[b].push_back(a);
  }
  for (int i(1);i<=N;i++){
    sort(Q[i].begin(),Q[i].end());
  }
  for (int i(1);i<=N;i++){
    if (seen[i]) continue; // v が探索済みだったらスルー
    dfs(i); // v が未探索なら v を始点とした DFS を行う
    cnt++;
  }
  int block[100001] = {0};
  for (int i(0);i<K;i++){
    int a,b;
    cin>>a>>b;
    if (group[group_num[a]].find(b) != group[group_num[a]].end()){
      block[a]++;
      block[b]++;
    }
  }
  int renketu[100001] = {0};
  for (int i(0);i<cnt;i++){
    //for (int j(0);j<int(group[i].size());j++){
    for (auto j:group[i]){
      renketu[j] = int(group[i].size());
    }
  }
  //int block[100000] = {0};
  //for (int i(1);i<=N;i++) cout << renketu[i] <<" ";
  for (int i(1);i<=N;i++){
    cout << renketu[i] - int(G[i].size()) - 1 - block[i]<<" ";
    //cout << renketu[i] - int(G[i].size()) - 1 - int(Q[i].size()) << " ";
  }
  cout << endl;
  return 0;
}



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

using namespace std;

int main(){

    int N, x, i, counter = 0;

    cin >> N >> x;
    //cout << N << " " << x << endl;

    for(i = N; i >= x; i--){
        //cout << i << endl;
        counter++;
    }

    cout << counter << endl;

    return 0;

}


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

struct edge{int to, cost;};
typedef pair<int, int> P; //first is shortest distance, second is number.

vector<edge> G[MAX_V];
ll d[MAX_V];

void dijkstra(int s, int V){
    priority_queue<P, vector<P>, greater<P> > que;
    fill(d, d+V, INF);
    d[s] = 0;
    que.push(P(0, s));

    while(!que.empty()){
        P p = que.top(); que.pop();
        int v = p.second;
        if(d[v] < p.first) continue;
        for(int i = 0; i < G[v].size(); i++){
            edge e = G[v][i];
            if(d[e.to] > d[v] + e.cost){
                d[e.to] = d[v] + e.cost;
                que.push(P(d[e.to], e.to));
            }
        }
    }
}

int main(){
    int V, E, r; cin >> V >> E >> r;
    for(int i = 0; i < E; i++){
        int a, b, c; 
        cin >> a >>b >> c;
        edge e = {b, c};
        G[a].push_back(e);
    }
    dijkstra(r, V);
    for(int i = 0; i < V; i++){
        if(d[i] == INF){
            cout << "INF" << endl;
        }else{
            cout << d[i] << endl;
        }
    }
}


Measured memory_bytes: 34524
import sys
import numpy as np

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(500000)


def count(x):
    cnt = 0
    if x >= 0:
        cnt += N * len(zero)
    cnt += np.searchsorted(A, x // pos, side='right').sum()
    cnt += N * len(neg) - np.searchsorted(A, -(-x // neg), side='left').sum()
    cnt -= np.count_nonzero(A * A <= x)

    return cnt // 2


N, K, *A = map(int, read().split())
A = np.array(A)
A.sort()

neg = A[A < 0]
zero = A[A == 0]
pos = A[A > 0]

r = 10**18
l = -r

while r - l > 1:
    m = (r + l) // 2
    if count(m) >= K:
        r = m
    else:
        l = m

print(r)

Measured memory_bytes: 29428
#include <iostream>
#include <algorithm>
 
using namespace std;
 
int D,x,y,p[100],ans;
string a[100];
 
void solve(int d,int sum,int pos){
  ans = max(ans,sum);
 
  if(pos == x + y || d == 0){
    return;
  }
 
  int size = a[pos].size();
  if(size == 1){
    if(a[pos] == "D" && d > 0){
      solve(d-1,sum+p[pos],pos+1);
    }
  }else{
    if(a[pos] == "DD" && d > 1){
      solve(d-2,sum+p[pos],pos+1);
    } 
  }
 
  solve(d,sum,pos+1);
}
 
int main(){
  cin >> D >> x;
  for(int i = 0 ; i < x ; i++){
    cin >> a[i] >> p[i];
  }
  cin >> y;
  for(int i = x ; i < x + y ; i++){
    cin >> a[i] >> p[i];
  }
 
  solve(D,0,0);
  cout << ans << endl;
 
  return 0;
}

Measured memory_bytes: 1208
#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
#define FOR(i,a,b) for(int i=a;i<b;i++)
#define rep(i,n) FOR(i,0,n)
#define ROF(i,a,b) for(int i=a;i>=b;i--)
#define per(i,a) ROF(i,a,0)
#define pb push_back
using namespace std;
using ll=long long;
using ld=long double;
using ch=char;
typedef pair<ll,ll> P;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef vector<P> vP;
typedef vector<ch> vc;
typedef vector<vc> vvc;
const ll MOD=1000000007;
const ll MOD2=998244353;
const ld PI=acos(-1);
const ll INF=1e18;
struct edge{ll to,cost;};
struct edge2{ll from,to,cost;};

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

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

int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    string s;
    cin >> s;
    ll ans=0;
    ll res=0;
    rep(i,s.size()){
        if(s[i]=='R'){
            res++;
        }
        else{
            res=0;
        }
        chmax(ans,res);
    }
    cout << ans << endl;
}
/*
overflow checked?
corner case checked?
boundary checked?
not TLE in worst case checked?
*/

Measured memory_bytes: 3648
//#include <tourist>
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> p;
const int INF = 1e9;
const ll LINF = ll(1e18);
const int MOD = 1000000007;
const int dx[4] = {0, 1, 0, -1}, dy[4] = {-1, 0, 1, 0};
const int Dx[8] = {0, 1, 1, 1, 0, -1, -1, -1}, Dy[8] = {-1, -1, 0, 1, 1, 1, 0, -1};
#define yes cout << "Yes" << endl
#define YES cout << "YES" << endl
#define no cout << "No" << endl
#define NO cout << "NO" << endl
#define rep(i, n) for (int i = 0; i < n; i++)
#define ALL(v) v.begin(), v.end()
#define debug(v)          \
    cout << #v << ":";    \
    for (auto x : v)      \
    {                     \
        cout << x << ' '; \
    }                     \
    cout << endl;
template <class T>
bool chmax(T &a, const T &b)
{
    if (a < b)
    {
        a = b;
        return 1;
    }
    return 0;
}
template <class T>
bool chmin(T &a, const T &b)
{
    if (b < a)
    {
        a = b;
        return 1;
    }
    return 0;
}
//cout<<fixed<<setprecision(15);有効数字15桁
//-std=c++14
//-std=gnu++17
ll gcd(ll a, ll b) { return b ? gcd(b, a % b) : a; }
ll lcm(ll a, ll b) { return a / gcd(a, b) * b; }
ll n, k;

int main()
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    cin >> n>>k;
    ll ans=0;
    for(ll i=0;i<n-k+1;i++){
        ans+=(k+i)*(n+(n-k-i+1))/2;
        ans%=MOD;
        ans-=((k+i)*(k+i-1)/2)%MOD;
        ans++;
        ans=(ans+MOD)%MOD;
        //cout<<ans<<"\n";
    }
    ans++;
    cout<<ans<<"\n";
}


Measured memory_bytes: 3640
/*||>>>> Praveen Ojha <<<<>>>> 10 June 2019 <<<<>>>> 00:55:52 <<<<||*/
// #pragma GCC optimize("Ofast") //(Very Fast but Inaccurate)
// #pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native") //(Small operations in many loops)
// #pragma GCC optimize("unroll-loops")
// #pragma comment(linker, "/stack:200000000")
#pragma GCC optimize("O3")
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define F first
#define S second
#define mod 1000000007
#define inf 1e18+5
#define sz(x) (int)x.size()
#define PI 3.141592653589793238510
#define all(x) (x).begin(),(x).end()
#define rall(x) (x).rbegin(),(x).rend()
#define __ ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define vi vector<int>
#define vpii vector<pair<int,int> > 
#define vvi vector<vector<int> >
#define PRINT_TIME cerr << "Time elapsed: " << 1.0 * clock() / CLOCKS_PER_SEC << " s." <<endl;
#define sim template < class c
#define ris return * this
#define dor > debug & operator <<
#define eni(x) sim > typename   enable_if<sizeof dud<c>(0) x 1, debug&>::type operator<<(c i) {
sim > struct rge { c b, e; };
sim > rge<c> range(c i, c j) { return rge<c>{i, j}; }
sim > auto dud(c* x) -> decltype(cerr << *x, 0);
sim > char dud(...);
struct debug {
#ifdef LOCAL
~debug() { cerr << endl; }
eni(!=) cerr << boolalpha << i; ris; }
eni(==) ris << range(begin(i), end(i)); }
sim, class b dor(pair < b, c > d) {
  ris << "(" << d.first << ", " << d.second << ")";
}
sim dor(rge<c> d) {
  *this << "[";
  for (auto it = d.b; it != d.e; ++it)
    *this << ", " + 2 * (it == d.b) << *it;
  ris << "]";
}
#else
sim dor(const c&) { ris; }
#endif
};
#define imie(...) " [" << #__VA_ARGS__ ": " << (__VA_ARGS__) << "] "
typedef long double ld;
typedef pair<int,int> pii;
//Read Problems Carefully & Check for corner cases N=0,1 ?
///////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////////

int32_t main(){__
	int n;
	cin>>n;
	vi a(n);
	int sumi=0;
	for(int i=0;i<n;i++){
		cin>>a[i];
		sumi+=a[i];
	}
	int k=0,ans=inf;
	for(int i=0;i<n-1;i++){
		k+=a[i];
		ans=min(ans,abs(sumi-2*k));
	}
	cout<<ans<<"\n";
return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define pi 2*asin(1.0)


//template functions
/////////////////////////
long Comb(long N,long M){// nCm
long ans=1;
for(long i=N;i>N-M;i--){
    ans=ans*i;
}
for(long i=M;i>0;i--){
    ans=ans/i;
}
return ans;
}
long Perm(long N,long M){// nPm
long ans=1;
for(long i=N;i>N-M;i--){
    ans=ans*i;
}
return ans;
}
/////////////////////////



//Answer


int main() {
long N,K;
cin>>N>>K;
int flag=0;
vector<long> A(N);
vector<long> B(N);
for(long i=0;i<N;i++){
cin>>A.at(i);
}
for(long i=0;i<N;i++){
    if(A.at(i)==0){
        long j=i+K;
        while(i<j){
            B.at(i)=0;
            if(A.at(i)==0){
                j=i+K;
            }
            i++;
        }
    }
    B.at(i)=1;

}
for(long i=K;i<N;i++){
    flag=0;
    if(A.at(i-K)>=A.at(i)||B.at(i)==0){
        flag=1;
    }
    if(flag==0){
        cout<<"Yes"<<endl;
    }else{
        cout<<"No"<<endl;
    }

}


}

Measured memory_bytes: 6372
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <map>
#include <unordered_map>
#include <set>
#include <queue>
using namespace std;
#define ALL(x) (x).begin(),(x).end()
#define SZ(x) int((x).size())
#define OUT(x) cout << (x) << endl
typedef long long ll;
typedef vector<int> V;
typedef vector<vector<int>> VV;
typedef pair<int, int> P;
typedef map<string, int> M;
typedef unordered_map<int, int> HM;
typedef set<int> S;
typedef queue<int> Q;

int main(){
    int n,m; cin>>n>>m;
    int l,r; cin>>l>>r;
    for(int i=1; i<m; i++){
        int tmpl,tmpr; cin>>tmpl>>tmpr;
        l = max(l, tmpl);
        r = min(r, tmpr);
    }
    OUT(max(0,r-l+1));
}

Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <array>
#include <algorithm>
#include <vector>
#include <string>
#include <set>
#include <cctype>
#include <map>
#include <stdio.h>
#include <string.h>
#include <math.h>
#include <ctype.h>
#include <queue>


#pragma GCC target("avx2")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")

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

using namespace std;

bool is_integer( float x ){
    return floor(x)==x;
}

bool is_prime(long long N) {
    if (N == 1) return false;
    for (long long i = 2; i * i <= N; ++i) {
        if (N % i == 0) return false;
    }
    return true;
}

//yakusuu rekkyo
vector<long long> enum_divisors(long long N) {
    vector<long long> res;
    for (long long i = 1; i * i <= N; ++i) {
        if (N % i == 0) {
            res.push_back(i);
            // push its partner
            if (N/i != i) res.push_back(N/i);
        }
    }

    sort(res.begin(), res.end());
    return res;
}


vector<pair<long long, long long> > prime_factorize(long long N) {
    vector<pair<long long, long long> > res;
    for (long long a = 2; a * a <= N; ++a) {
        if (N % a != 0) continue;
        long long ex = 0; // exponential

        // divide as much as you can
        while (N % a == 0) {
            ++ex;
            N /= a;
        }

        // push the result
        res.push_back({a, ex});
    }

    // last num (if the lasting n is prime number and not 1)
    if (N != 1) res.push_back({N, 1});
    return res;
}



int main() {
    map<string,int> b,r;
    vector<string> wl;
    int n,m;
    int Max = -1;
    string tmp;
    cin >> n;
    rep(i,n){
        cin >> tmp;
        if(b.count(tmp) == 0 && r.count(tmp) == 0){
            b[tmp] = 0;
            r[tmp] = 0;
            wl.push_back(tmp);
        }
        b[tmp] ++;
    }
    cin >> m;
    rep(i,m){
        cin >> tmp;
        if(b.count(tmp) == 0 && r.count(tmp) == 0){
            b[tmp] = 0;
            r[tmp] = 0;
            wl.push_back(tmp);
        }
        r[tmp] ++;
    }

    rep(i,wl.size()){
        Max = max(Max,b[wl[i]] - r[wl[i]]);
    }

    if(Max < 0) cout << 0;
    else cout << Max;

    return 0;
}











Measured memory_bytes: 3648
#include <algorithm>
#include <iostream>
#include <cstdio>
#include <map>
#include <numeric>
#include <cmath>
#include <set>
#include <sstream>
#include <string>
#include <vector>
#include <queue>
#include <stack>
#include <complex>
#include <string.h>
#include <unordered_set>
#include <unordered_map>
#include <bitset>
#include <iomanip>
#include <sys/time.h>
#include <tuple>
#include <random>
using namespace std;

#define endl '\n'
#define ALL(v) (v).begin(), (v).end()
#define RALL(v) (v).rbegin(), (v).rend()
#define UNIQ(v) (v).erase(unique((v).begin(), (v).end()), (v).end())

typedef long long ll;
typedef long double ld;
typedef pair<int, int> P;
typedef complex<double> comp;
typedef vector< vector<ld> > matrix;
struct pairhash {
public:
    template<typename T, typename U>
    size_t operator()(const pair<T, U> &x) const {
	size_t seed = hash<T>()(x.first);
	return hash<U>()(x.second) + 0x9e3779b9 + (seed<<6) + (seed>>2);
    }
};
const int inf = 1e9 + 9;
const ll mod = 1e9 + 7;
const double eps = 1e-8;
const double pi = acos(-1);

int n;
ll a[100010], b[100010];

ll solve() {
    ll res = 0;
    for (int i = n-1; i >= 0; i--) {
        ll c = (a[i] + res) / b[i];
        while (a[i] + res > b[i]*c) c++;
        res += b[i] * c - (a[i] + res);
    }
    return res;
}

void input() {
    cin >> n;
    for (int i = 0; i < n; i++) cin >> a[i] >> b[i];
}

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout << fixed << setprecision(15);

    input();
    cout << solve() << endl;
}


Measured memory_bytes: 1792
import Control.Applicative( (<$>))
import Data.List
import qualified Data.List as L
import Data.ByteString.Char8
import qualified Data.ByteString.Char8 as C8
import Data.Maybe( fromJust)


main = do
    let
	readBS2Int = fst . fromJust . C8.readInt
	readLine2Ints = Prelude.map readBS2Int . C8.words <$>
							C8.getLine
    _n_ <- readLn::IO Int
    ps_ <- readLine2Ints
    let
	chk (one,two) _ []	= (one,two)
	chk (one,two) i [p]
	  | i==p		= (one+1,two)
	  | otherwise		= (one,two)
	chk (one,two) i (p1:tl@(p2:ps))
	  | i==p1 && i+1==p2	= chk (one,two+1) (i+2) ps
	  | i==p1		= chk (one+1,two) (i+2) ps
	  | otherwise		= chk (one,two) (i+1) tl
	
	(one,two) = chk (0,0) 1 ps_

    print $ one + two

Measured memory_bytes: 5116
L, R = map(int, input().split())

ans = 10 ** 9
if R - L >= 673:
    ans = 0
else:
    for i in range(L, R):
        for j in range(L + 1, R + 1):
            work = (i * j) % 2019
            # print(i, j, work, ans)
            ans = min(ans, work)

print(ans)
            
        

Measured memory_bytes: 2940
#include <iostream>
#include <algorithm>
#include <string>
#include <cstdlib>
#include <cmath>
using namespace std;

int main()
{
  int n, boss = 0;
  cin >> n;
  int map[2][n];

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

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

  for (int i = 0; i < n; i++)
  {
    int result = 0;
    for (int j = 0;j <= i; j++)
    {
      result += map[0][j];
    }

    for (int k = i; k < n; k++)
    {
      result += map[1][k];
    }

    if(result > boss) boss = result;
  }

  cout << boss << endl;

}


Measured memory_bytes: 256
#include<iostream>
#include<cstdio>
#include<string>
#include<math.h>
#include<algorithm>
#include<vector>
#include<iomanip>
#include<map>
#include<numeric>
#include<queue>
#include<functional>
#include<cassert>
#include<set>
#define rep(a,b) for(int a=0;a<b;++a)
#define REP(a,b,c,d) for(int a=b;a<c;a+=d)
#define yes cout<<"Yes"<<endl
#define no cout<<"No"<<endl
#define mod 1000000007
using namespace std;
using ll = long long;
using p_i = pair<int, int>;
int main() {
	string s; cin >> s;
	rep(i, s.size()) {
		if (i == 4)cout << " ";
		cout << s[i];
	}
	cout << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define all(v) (v).begin(), (v).end()
#define pb push_back
#define REP(i,n) for(int i=0; i<(n); i++)
#define REP2(i,x,n) for(int i=x; i<(n); i++)
using namespace std;
using ll = long long;
using ld = long double;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
template<class T>using numr=std::numeric_limits<T>;
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }
const int INF = 1e9;
const ll LLINF = 1e16;
const int MOD = 1000000007;
const int MOD2 = 998244353;

template < typename Container, typename Value = typename Container::value_type, std::enable_if_t<!std::is_same< Container, std::string >::value, std::nullptr_t> = nullptr>
std::istream& operator>> (std::istream& is, Container& v)
    { for (auto & x : v) { is >> x; } return is; }

template < typename Container, typename Value = typename Container::value_type, std::enable_if_t<!std::is_same< Container, std::string >::value, std::nullptr_t> = nullptr >
std::ostream& operator<< (std::ostream& os, Container const& v) {
os << "{";
    for (auto it = v.begin(); it != v.end(); it++)
        {os << (it != v.begin() ? "," : "") << *it;}
    return os << "}";
}

int main() {
    std::cin.tie(nullptr);
    std::ios::sync_with_stdio(false);
    int n;
    cin >> n;
    ll mini = 1e9;
    vector<ll> p(n);
    cin >> p;
    ll ans = 0;
    for(int i=0;i<n;i++){
        if(p[i] <= mini) ans++;
        chmin(mini, p[i]);
    }
    cout << ans << endl;
}

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

#define mod 1000000007

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

using namespace std;
typedef long long ll;
const long long INF = 1LL << 60;
 
int main(void){
	
	int N;
	
	cin >> N;
	
	vector<int> a(N);
	
	rep(i, N)
		cin >> a[i];
		
	int ans = 0;
	
	rep(i, N){
		if(a[i] == ans + 1)
			ans++;
	}
	
	if(ans != 0)
		cout << N - ans;
	else
		cout << -1;
	
	return 0;
}

Measured memory_bytes: 1024
#include<iostream>
#include<algorithm>
#include<cstdio>
#include<cstring>
#include<cmath>
#include<map> 
#include<set> 
using namespace std;
#define mid 1000000007
#include <stdio.h>
int book[1006];
int main(){
	int a,b,c,e,sum=0;
	cin>>a>>b;
	while(b--){
		cin>>c;
		while(c--){
			cin>>e;
		if(book[e]!=1){
		sum++;
		book[e]=1;
		}
		}
	}
	cout<<a-sum;
	return 0;
}

Measured memory_bytes: 3636
#pragma GCC optimize(2)
#include<bits/stdc++.h>
#define read(a) scanf("%d", &a)
#define readl(a) scanf("%lld", &a)
#define reads(a) scanf("%s", a)
#define readc(a) scanf("%c", &a)
#define debug(a, b) printf("%s = %d\n", a, b)
#define debug1(a, i, b) printf("%s[%d] = %d", a, i, b)
#define show(a) putchar(a)
#define pb push_back
#define mk make_pair
#define _rand mt19937 RAND(time(0))
#define REP(i,a,n) for(int i=a;i<=n;++i)
#define mem(a) memset(a, 0, sizeof(a))
#define Buff ios::sync_with_stdio(false)
typedef long long ll;
typedef long long LL;
using namespace std;
const int INF = 1e9 + 7;
const int N = 2e5 + 7;
const int M = 5e6 + 7;
set<int> s;
signed main()
{
    Buff;
    int a, b, c;
    cin >> a >> b >> c;
    if(a == b && a != c || (a == c && a != b) || (b == c && a != b))
        cout << "Yes\n";
    else cout << "No\n";
    return 0;
}
/**
    A
**/


Measured memory_bytes: 256
#ifdef LOCAL
#define _GLIBCXX_DEBUG
#endif
#include<bits/stdc++.h>
using namespace std;
#define rep(i,s,t) for(ll i = (ll)(s); i < (ll)(t); i++)
#define rrep(i,s,t) for(ll i = (ll)(s-1);(ll)(t) <= i; i--)
#define all(x) (x).begin(), (x).end()
typedef long long ll;
typedef long double ld;
typedef pair<ll,ll> Pll;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef vector<vvl> vvvl;
constexpr ll INF = numeric_limits<ll>::max()/4;
constexpr ll n_max = 2e5+10;
#define int ll

template <typename A, typename B>
string to_string(pair<A, B> p);
string to_string(const string &s) {return '"' + s + '"';}
string to_string(const char *c) {return to_string((string) c);}
string to_string(bool b) {return (b ? "true" : "false");}
template <size_t N>
string to_string(bitset<N> v){
    string res = "";
    for(size_t i = 0; i < N; i++) res += static_cast<char>('0' + v[i]);
    return res;
}
template <typename A>
string to_string(A v) {
    bool first = true;
    string res = "{";
    for(const auto &x : v) {
        if(!first) res += ", ";
        first = false;
        res += to_string(x);
    }
    res += "}";
    return res;
}
template <typename A, typename B>
string to_string(pair<A, B> p){return "(" + to_string(p.first) + ", " + to_string(p.second) + ")";}

void debug_out() {cerr << endl;}
template<typename Head, typename... Tail>
void debug_out(Head H, Tail... T) {
    cerr << " " << to_string(H);
    debug_out(T...);
}

#ifdef LOCAL
#define debug(...) cerr << "[" << #__VA_ARGS__ << "]:", debug_out(__VA_ARGS__)
#else
#define debug(...) 42
#endif

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

void print() {
    cout << endl;
}

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

template <class T>
void print(vector<T> &vec) {
    for (auto& a : vec) {
        cout << a;
        if (&a != &vec.back()) cout << " ";
    }
    cout << endl;
}

template <class T>
void print(vector<vector<T>> &df) {
    for (auto& vec : df) {
        print(vec);
    }
}

signed main(){
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    ll n,l; cin >> n >> l;
    vector<ll> a(n);
    for(int i = 0; i < n; i++) cin >> a[i];
    vector<ll> ans;
    ll t = -1;
    rep(i,0,n-1){
        if(a[i] + a[i+1] >= l){
            ans.emplace_back(i+1);
            t = i+1;
            break;
        }
    }
    if(t == -1){
        cout << "Impossible" << "\n";
    }
    else{
        cout << "Possible" << "\n";
        rep(i,t+1,n)ans.emplace_back(i);
        rrep(i, t, 1)ans.emplace_back(i);
        reverse(all(ans));
        print(ans);
    }

}

Measured memory_bytes: 5112
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int mod=1e9+7;
int gg=1;
int main(){
	ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
	int m,k;cin>>m>>k;
	if(m==0&&k==0){
		cout<<"0 0";return 0;
	}
	if(m==1&&k==0){
		cout<<"0 0 1 1";return 0;
	}else if(m==1&&k!=0){
		cout<<-1;return 0;
	}
	for(int i=0;i<m;i++){
		gg*=2;
	}
	if(k>=gg){
		cout<<-1;return 0;
	}
	cout<<k<<' ';
	for(int i=0;i<=gg-1;i++){
		if(i==k)continue;
		cout<<i<<' ';
	}cout<<k<<' ';
	for(int i=gg-1;i>=0;i--){
		if(i==k)continue;
		cout<<i<<' ';
	}
	return 0;
}

Measured memory_bytes: 3600
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc=new Scanner(System.in);
		int W=sc.nextInt();
		int H=sc.nextInt();
		int x=sc.nextInt();
		int y=sc.nextInt();
		int r=sc.nextInt();
		if(W>=x+r&&x-r>=0) {
			if(H>=y+r&&y-r>=0) {
				System.out.println("Yes");
			}else {
				System.out.println("No");
			}
		}else {
			System.out.println("No");
		}

	}

}



Measured memory_bytes: 26160
// No sorceries shall prevail. //           
import java.util.*;
import java.io.*;

public class Main {
	
	static long gcd(long a, long b) { 
	      if (b == 0) 
	        return a; 
	      return gcd(b, a % b);  
	    }
	static int gcd(int a, int b) { 
	      if (b == 0) 
	        return a; 
	      return gcd(b, a % b);  
	    }
	
	static long mod = 1000000007;
	
	public static void main(String args[]) {
		Scanner inp=new Scanner(System.in);
		PrintWriter out=new PrintWriter(System.out);
		
		String s=inp.next();
		out.println(s.charAt(0)==s.charAt(1) && s.charAt(1)==s.charAt(2)?"No":"Yes");
		
		out.close();
		inp.close();
	}
}

Measured memory_bytes: 21844