akhauriyash/Code-Regression huggingface dataset:
#include<iostream>
#include<queue>
#include<vector>
using namespace std;
typedef long long ll;

int main(){
  int N,K,Q;
  cin >> N >> K >> Q;

  int count[200000] = {};
  for(int i=0; i<Q; i++){
    int a;
    cin >> a;
    int b = count[a-1];
    count[a-1] = b + 1;
  }

  for (int i=0; i<N; i++){
    if((Q-count[i]) < K) {cout << "Yes" << endl;}
    else {cout << "No" << endl;}
  }



  return 0;
}

Measured memory_bytes: 1408
import java.util.*;
import java.io.*;

public class Main {

    public static void main(String[] args) throws Exception {
        // Your code here!
        Scanner in = new Scanner(new BufferedReader(new InputStreamReader(System.in)));
        
        int S = in.nextInt();
        int W = in.nextInt();
     
        System.out.println(W >= S ? "unsafe": "safe");
    }
    

        
}


Measured memory_bytes: 35760
#include <iostream>
#include <vector>
#include <map>
#include <queue>
using namespace std;

inline int upb(int n)
{
  /*
  int ret=0;
  while(n>0) ret++, n/=2;
  return ret;
  */
  return 32-__builtin_clz(n);
}

int main()
{
  vector<bool> close(1<<(5*5), false);
  vector<int> cls;

  for (int n; cin>>n, !(n==0); ){

    vector<vector<int> > pats(n*n+1);
    vector<vector<int> > tmp(n, vector<int>(n, 0));

    for (int i=0; i<n; i++){
      for (int j=0; j<n; j++){
	for (int k=i; k<n; k++){
	  for (int l=j; l<n; l++){
	    for (int a=i; a<=k; a++)
	      for (int b=j; b<=l; b++)
		tmp[a][b]=1;
	    int bd=0;
	    for (int a=0; a<n; a++){
	      for (int b=0; b<n; b++){
		bd=(bd<<1)|tmp[a][b];
	      }
	    }
	    pats[upb(bd)].push_back(bd);
	    for (int a=i; a<=k; a++)
	      for (int b=j; b<=l; b++)
		tmp[a][b]=0;
	  }
	}
      }
    }

    int bd=0;
    for (int i=0; i<n; i++){
      for (int j=0; j<n; j++){
	int t; cin>>t;
	bd=(bd<<1)|t;
      }
    }

    queue<int> mm;
    mm.push(bd);
    close[bd]=true;
    cls.push_back(bd);
    while(!mm.empty()){
      int dep=mm.front()>>25;
      int cbd=mm.front()&0x1ffffff;
      mm.pop();
      int ub=upb(cbd);
      for (int i=0; i<pats[ub].size(); i++){
	int nbd=cbd^pats[ub][i];
	if (nbd==0){
	  for (int i=0; i<=dep; i++)
	    cout<<"myon";
	  cout<<endl;
	  goto _exit;
	}
	//cout<<"*** "<<nbd<<endl;
	if (close[nbd]) continue;
	close[nbd]=true;
	cls.push_back(nbd);
	mm.push(((dep+1)<<25)|nbd);
      }
    }
  _exit:;
    for (int i=0; i<cls.size(); i++)
      close[cls[i]]=false;
    cls.clear();
  }
  return 0;
}

Measured memory_bytes: 6220
from heapq import heappush, heappop, heapify
from collections import deque, defaultdict, Counter
import itertools
from itertools import permutations, combinations, accumulate, product
import sys
import bisect
import string
import math
import time


def I(): return int(input())


def S(): return input()


def MI(): return map(int, input().split())


def MS(): return map(str, input().split())


def LI(): return [int(i) for i in input().split()]


def LI_(): return [int(i)-1 for i in input().split()]


def StoI(): return [ord(i)-97 for i in input()]


def ItoS(nn): return chr(nn+97)


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


def debug(table, *args):
    ret = []
    for name, val in table.items():
        if val in args:
            ret.append('{}: {}'.format(name, val))
    print(' | '.join(ret), file=sys.stderr)


yn = {False: 'No', True: 'Yes'}
YN = {False: 'NO', True: 'YES'}
MOD = 10**9+7
inf = float('inf')
IINF = 10**10
l_alp = string.ascii_lowercase
u_alp = string.ascii_uppercase
ts = time.time()
sys.setrecursionlimit(10**6)
nums = ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10']

show_flg = False
# show_flg = True


def main():
    S, W = MI()

    if W >= S:
        print('unsafe')
    else:
        print('safe')


if __name__ == '__main__':
    main()


Measured memory_bytes: 68360
N =int(input())
x = N % 10
if x == 2 or x == 4 or x == 5 or x == 7 or x == 9:
  print("hon")
elif x == 0 or x == 1 or x == 6 or x == 8:
  print("pon")
else:
  print("bon")

Measured memory_bytes: 61592
import java.util.Scanner;

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

		if ((A+B)%2 == 0) {
			System.out.println((A+B)/2);
		} else {
			System.out.println("IMPOSSIBLE ");
		}
	}
}


Measured memory_bytes: 21844
import sys
X=input()
n=len(X)
if n%2==0:
    print("No")
    sys.exit()
ans="No"
def check(s): 
    return s == s[::-1] 
ans="No"
if check(X):
    if check(X[0:int((n-1)/2)]):
        if check(X[int(((n+3)/2)-1):]):
            ans="Yes"
print(ans)

Measured memory_bytes: 9168
N = int(input()) - 1
K = 26
j = 0
for i in range(1, 100):
    if N >= K ** i:
        N -= K ** i
        j = i
S = ""
for i in range(j + 1)[::-1]:
    k = N // (K ** i)
    N %= K ** i
    S += chr(97 + k)
print(S)

Measured memory_bytes: 9172
Imports System.Console
Imports System.Math  
Module Program
 	Sub Main()
	    Dim N As Integer = Console.ReadLine()
        Console.Error.WriteLine(N)
        
'	    Dim A(2,N) As Integer
	    Dim A(,) As Integer = New Integer(2,N) {}
        For i As Integer = 0 To 1
            Dim tmp As String() = Console.ReadLine().Split(" ")
            Console.Error.WriteLine(tmp(0))
            For j As Integer = 0 To N-1
                A(i,j) = tmp(j)
                Console.Error.WriteLine(A(i,j))
            Next
        Next

	    Dim cumsum(,) As Integer = New Integer(2,N) {}
        For i As Integer = 0 To 1
            For j As Integer = 0 To N-1
                Dim c As Integer = 0
                If j-1>=0 Then
                    c = cumsum(i,j-1)
                End If
'                cumsum(i,j) = A(i,j) + IIF(j-1>=0, cumsum(i,j-1), 0)
                cumsum(i,j) = A(i,j) + c
            Next
        Next

        Dim max As Integer = 0
        For j As Integer = 0 To N-1
            Dim row0 As Integer = cumsum(0,j)
            Dim r As Integer = 0
            If j-1>=0 Then
                r = cumsum(1,j-1)
            End If
            Dim row1 As Integer = cumsum(1,N - 1) - r
            max = Math.Max(max, row0 + row1)
        Next
        Console.WriteLine(max)
    End Sub
End Module


Measured memory_bytes: 13268
#include<cstdio>
#include<cstdlib>
#include<algorithm>
#include<iostream>
#include<queue>
#include<vector>
#include <bitset>
using namespace std;
#define MAX 300000
typedef long long ll;



int main(){
  bool flag=true;
  int N,S[1100]={1};
  vector<int> V;

  for(int i=0;i<1100;i++){
    S[i]=1;
  }
  cin>>N;
  for(int i=2;i<=N;i++,flag=true){
    for(int j=0;j<V.size();j++){
      int temp=i;
      while(temp%V[j]==0){
        S[V[j]]++;
        temp/=V[j];
        flag=false;
      }
    }
    if(flag){
      S[i]++;
      V.push_back(i);
    }
  }
  ll ans=1;
  for(int i=2;i<=N;i++){
    ans*=S[i];
    ans%=1000000007;
  }
  cout<<ans<<endl;
}


Measured memory_bytes: 256
import java.util.*;

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

		int n = sc.nextInt();
		while(n-- > 0){
			int m = sc.nextInt();
			String s = sc.next();

			System.out.println(solve(m,s,-1,false));
		}
	}

	private static int solve(int m,String s,int idx,boolean used){
		if(s.indexOf("G") == -1) return s.length();
		if(s.indexOf("B") == -1) return 0;

		int nidx = (idx + m) % s.length();
		int res = Integer.MIN_VALUE;
		String ns = s.substring(0,nidx)+s.substring(nidx+1);

		res = Math.max(res,solve(m,ns,nidx-1,used));

		if(!used && s.charAt(nidx) == 'B'){
			nidx = (nidx + 1) % s.length();
			ns = s.substring(0,nidx)+s.substring(nidx+1);
			res = Math.max(res,solve(m,ns,nidx-1,true));
		}

		return res;
	}
}

Measured memory_bytes: 15000
#pragma warning(disable:4996)
#pragma comment(linker, "/STACK:336777216")
#pragma GCC optimize("Ofast")

#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#include <functional>

using namespace std;
using namespace __gnu_pbds;

typedef long long ll;
#define int long long int
typedef complex<long double> cd;
const long double pi=acos(-1);
typedef double db;
typedef long double ldb;
typedef pair <int, int> pii;
typedef pair <db, db> pdd;
typedef vector<int> vi;
typedef vector<vector<int> > matrix;

#define m1 make_pair
#define pb push_back
#define flush fflush(stdout)
#define IOS std::ios::sync_with_stdio(false); cin.tie(NULL);cout.tie(NULL);
#define reset(x,v) memset(x,v,sizeof(x))

#define fi first
#define se second
#define endl "\n"
#define debug(x) (cerr << #x << ": " << x << "\n")
#define setbits(x) __builtin_popcount(x)
#define setbitsll(x) __builtin_popcountll(x)
#define all(x) x.begin(),x.end()
#define pii pair<int,int>

inline ll gcd(ll a,ll b){if(a==0) return b;return gcd(b%a,a);}
inline ll power(ll a,ll n,ll m){if(n==0)return 1;ll p=power(a,n/2,m);p=(p%m*p%m)%m;if(n%2) return (p%m*a%m)%m;else return p;}
const ll MOD =998244353;
const ll hell=1000000007;
const int INF = 1e17;
const ll LL_INF = 0x3f3f3f3f3f3f3f3f;
typedef tree<int, null_type, less<int>, rb_tree_tag,
tree_order_statistics_node_update>
ordered_set;

auto seed = chrono::high_resolution_clock::now().time_since_epoch().count();
std::mt19937 rng(seed);

const int N=200005;



void solve()
{
   
    int k,a,b;
    cin>>k>>a>>b;
    int z=b/k;
    z=z-(a-1)/k;
    if(z)
    {
        cout<<"OK";
    }
    else
        cout<<"NG";
    cout<<endl;
    
}

int32_t main()
{
    IOS;
   // FILE *fin = freopen("in.txt","r",stdin);
    //FILE *fout = freopen("out.txt","w",stdout);

    int t;
    t=1;
    //cin>>t;
    while(t--)
    {
        
        solve();
    }
    return 0;
}


Measured memory_bytes: 3656
#include<iostream>
#include<iomanip>
#include<queue>
#include<string>
#include<stack>
#include<cstdio>
#include<cstdlib>
#include<cmath>
#include<cstring>
#include<cassert>
#include<ctime>
#include<algorithm>
#include<utility>
#include<map>
#include<set>
#include<vector>
#include<functional>

using namespace std;

typedef  long long           ll;
typedef  unsigned            ui;
typedef  unsigned long long  ull;
typedef  pair<int,int>       i_i;
typedef  pair<ll,int>        ll_i;
typedef  pair<ll,ll>         ll_ll;
typedef  pair<double,int>    d_i;
typedef  pair<double,double> d_d;

#ifdef DEBUG
#define dprintf      printf
#define dputs        puts
#define dout(x)      cout<<#x" = "<<(x)<<endl
#define darray(x,n)  {int i;rep(i,n)cout<<#x"["<<i<<"] = "<<*((x)+i)<<endl;}
#define dloop(i,s,g) for(int (i)=(s);(i)<(g);(i)++)
#define drep(i,n)    for(int (i)=0;(i)<(n);(i)++)
#define dstop()      scanf("%*c")
#else
#define dprintf      (1)?0:printf
#define dputs        (1)?0:puts
#define dout(x)
#define darray(x,n)
#define dloop(i,s,g) if(int i=0){}else
#define drep(i,n)    if(int i=0){}else
#define dstop()
#endif

#define F    first
#define S    second
#define pb   push_back
#define mp   make_pair

#define loop(i,s,g) for((i)=(s);(i)<(g);(i)++)
#define rep(i,n)    for((i)=0;(i)<(n);(i)++)
#define all(x)      (x.begin(),x.end())
#define in(T,...) T __VA_ARGS__; impl(__VA_ARGS__)
#define array(T,id,n) T id[(n)]; for(int i=0;i<(n);i++)cin>>id[i]
#define putv(n)     cout<<(n)<<endl

//#define int long long
#ifndef int
#define INF __INT32_MAX__
#else
#define INF __INT64_MAX__
#endif

void impl(){};
template <typename T,typename... TS >
void impl(T &head,TS &... tail)
{
  cin>>head;
  impl(tail ...);
}

signed main(void)
{
  in(int,n,l);
  string s[200];
  int i;
  rep(i,n)
    cin>>s[i];
  sort(s,s+n);
  rep(i,n)
    cout<<s[i];
  puts("");
  return 0;
}


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

int main()
{
  int i , N , yello = 0 ;
  cin >> N ;
  char A[N] ;
  
  for(i=0;i<N;i++){
	cin >> A[i] ;
    if(A[i] == 'Y')
      yello++;
  }
  
  if(!(yello==0))
    cout << "Four" ;
  else
    cout << "Three" ;
    
return 0;
}

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

int main() {
  int N;
  cin >> N;
  vector<int> A(N);
  vector<int> B(N-1);
  for (int i = 0; i < N-1; i++) cin >> B[i];
  A[0] = B[0];
  A[N-1] = B[N-2];
  for (int i = 1; i < N-1; i++) A[i] = min(B[i], B[i-1]);
  int sum = 0;
  for (int i = 0; i < N; i++) sum += A[i];
  cout << sum;
}


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

typedef long long ll;
const double EPS = 1e-9;
typedef vector<ll> vecl;
typedef pair<ll, ll> pairl;

template<typename T, typename U>
using mapv = map<T,vector<U>>;

#define ALL(v) v.begin(), v.end()
#define REP(i, x, n) for(int i = x; i < n; i++)
#define rep(i, n) REP(i, 0, n)
template<class T, class C> void chmax(T& a, C b){ a>b?:a=b; }
template<class T, class C> void chmin(T& a, C b){ a<b?:a=b; }

#define MOD097 1000000007

///// For Debug

#define repi(itr, ds) for (auto itr = ds.begin(); itr != ds.end(); itr++)
// vector
template <typename T>
istream &operator>>(istream &is, vector<T> &vec) {
    for (T &x : vec) is >> x;
    return is;
}
// pair
template <typename T, typename U>
ostream &operator<<(ostream &os, pair<T, U> &pair_var) {
    os << "(" << pair_var.first << ", " << pair_var.second << ")";
    return os;
}
// vector
template <typename T>
ostream &operator<<(ostream &os, const vector<T> &vec) {
    os << "{";
    for (int i = 0; i < vec.size(); i++) {
        os << vec[i] << (i + 1 == vec.size() ? "" : ", ");
    }
    os << "}";
    return os;
}
// map
template <typename T, typename U>
ostream &operator<<(ostream &os, map<T, U> &map_var) {
    os << "{";
    repi(itr, map_var) {
        os << *itr;
        itr++;
        if (itr != map_var.end()) os << ", ";
        itr--;
    }
    os << "}";
    return os;
}
// set
template <typename T>
ostream &operator<<(ostream &os, set<T> &set_var) {
    os << "{";
    repi(itr, set_var) {
        os << *itr;
        itr++;
        if (itr != set_var.end()) os << ", ";
        itr--;
    }
    os << "}";
    return os;
}
 
#define DUMPOUT cerr
 
void dump_func() {
    DUMPOUT << endl;
}
template <class Head, class... Tail>
void dump_func(Head &&head, Tail &&... tail) {
    DUMPOUT << head;
    if (sizeof...(Tail) > 0) {
        DUMPOUT << ", ";
    }
    dump_func(std::move(tail)...);
}

// 提出時はコメントアウト
// #define LOCAL
#define DEBUG_

#ifndef LOCAL
#undef DEBUG_
#endif

#ifdef DEBUG_

#define DEB
#define dump(...)                                                              \
    DUMPOUT << "  " << string(#__VA_ARGS__) << ": "                            \
            << "[" << to_string(__LINE__) << ":" << __FUNCTION__ << "]"        \
            << endl                                                            \
            << "    ",                                                         \
        dump_func(__VA_ARGS__)
#else
#define DEB if (false)
#define dump(...)

#endif

//////////

int main() {
    #ifdef LOCAL
    ifstream in("../../Atcoder/input.txt");
    cin.rdbuf(in.rdbuf());
    #endif

    ll N,K;
    cin >> N >> K;
    vecl H(N);
    rep(i,N) {
        cin>>H[i];
    }

    vecl dp(N+K+10,1e18);

    dp[0] = 0;
    rep(i,N) {
        rep(k,K) {
            chmin(dp[i+k+1],dp[i]+abs(H[i]-H[i+k+1]));
        }
    }

    cout << dp[N-1] << endl;

    return 0;
}


Measured memory_bytes: 4760
#include "bits/stdc++.h"
using namespace std;
typedef long long ll;

int main(){

    for(double q;cin>>q;){
        if(q<0)break;
        double x = q / 2;
        while(1){
            if(abs(x*x*x-q) < 0.00001 * q)break;
            double xx = x - (x * x * x - q) / (3 * x * x);
            x = xx;
        }
        printf("%.10f\n", x);
    }

    return 0;
}


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

void insertionSort(int *,int);

int main(){

  int i,k,n,cnt=0;
  int a[1000];

  scanf("%d",&n);
  if(n<0 || n>100){
    printf("nは範囲外\n");
    exit(1);
  }
  for(i=0;i<n;i++)
    if(scanf("%d",&a[i])==EOF) break;
  
  if(n>1000){
    printf("Aは範囲外\n");
    exit(2);
  }
  
  for(k=0;k<n-1;k++)
      printf("%d ",a[k]);
    printf("%d\n",a[k]);

  insertionSort(&a[0],n);
  
    
  return 0;

}

void insertionSort(int *a,int n)
{
  int i,j,k,v;
  
  for(i=1;i<n;i++){
    v = a[i];
    j = i-1;
    while(j>=0 && a[j] > v){
      a[j+1] = a[j];
      j--;
    }
    a[j+1] = v;

    for(k=0;k<n-1;k++)
      printf("%d ",a[k]);
    printf("%d\n",a[k]);
    
  }
}





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

using namespace std;

#define pb push_back
#define mp make_pair
#define fs first
#define fst first
#define sc second
#define snd second
#define sz(X) (int)(X).size()
#define forn(i, n) for (int i = 0; i < int(n); i++)
#define fornr(i, n) for (int i = int(n) - 1; i >= 0; i--)
#define forab(i, a, b) for(int i = int(a); i < int(b); i++)
#define all(X) X.begin(), X.end()

typedef long long ll;
typedef pair<int, int> pii;
typedef unsigned int uint;
typedef unsigned long long ull;
typedef double dbl;
typedef long double ld;
typedef vector<int> vi;

const int N = 40;
const int LOG = 21;
const int INF = 1e9;
const int MOD = 1e9 + 7;
const ll LLMOD = 998244353;
const ll LLINF = 1e18;

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    string s;
    cin >> s;
    int n = sz(s);
    vi ans(n);
    vi pos(n);
    int lastr = 0;
    forn(i, n) {
        if (s[i] == 'L') pos[i] = lastr;
        else lastr = i;
    }
    int lastl = n - 1;
    fornr(i, n) {
        if (s[i] == 'R') pos[i] = lastl;
        else lastl = i;
    }
    forn(i, n) {
        int len = abs(i - pos[i]);
        if (len % 2) {
            if (s[i] == 'L') ans[pos[i] + 1]++;
            else ans[pos[i] - 1]++;
        } else ans[pos[i]]++;
    }
    for (int x : ans)cout << x << " ";
    cout << "\n";
    return 0;
}

Measured memory_bytes: 1488
#include<iostream>
#include<cmath>
using namespace std;
int main(){
	string a,b;
	cin>>a>>b;
	int zh(string s);
	
	int n=zh(a+b);
	
	if(int(sqrt(n))*int(sqrt(n))==n)
	{
		cout<<"Yes";
		return 0;
	}
	else
		cout<<"No";
	return 0;
}

int zh(string s)
{
	int temp=0;
	
	for(int i=0;i<s.size();i++)
		temp=temp*10+(s[i]-'0');
	
	return temp;
}

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

int main(){
  int N;
  cin >> N;
  vector<int> D(N);
  for(int i = 0; i < N; ++i)
    cin >> D[i];
  sort(D.begin(), D.end());
  cout << D[N/2]-D[N/2-1] << endl;
}


Measured memory_bytes: 640
#include <bits/stdc++.h>
using namespace std;
#define ll          long long
#define mp	    make_pair
#define pb          push_back
#define pii         pair<int,int>
#define vi          vector<int>
#define vii         vector<pii>
#define mi          map<int,int>
#define mii         map<pii,int>
#define all(a)      (a).begin(),(a).end()
#define x           first
#define y           second
#define sz(x)       (int)x.size()
#define endl        '\n'
#define MOD        1000000007
#define lbnd        lower_bound
#define ubnd        upper_bound
#define bs          binary_search
#define gcd(a,b)    __gcd((a),(b))
#define lcm(a,b)    ((a)*(b)) / gcd((a),(b))
#define rep(i,a,b)  for(int i=a;i<b;i++)
#define N	 100

void solve(){
	ll a, b, k;
	cin>>a>>b>>k;
	set<int>s;
	rep(i,a,a+k){if(i>b)break; s.insert(i);}
	while(k--) {s.insert(b); b--;if(b<a)break;}
	for(auto it = s.begin(); it !=s.end(); it++) cout<<*it<<endl;
}
signed main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    int t;
    t =1;
//     cin>>t;
    while(t--){
        solve();
    }
    return 0;
}



Measured memory_bytes: 256
#include<stdio.h>
int main(void)
{
	int n;
	scanf("%d",&n);
	while(n!=-1){
		if(n<=10){
			printf("%d\n",4280-1150);
		}
		else if(n<=20){
			printf("%d\n",4280-(1150+125*(n-10)));
		}
		else if(n<=30){
			printf("%d\n",4280-(1150+1250+140*(n-20)));
		}
		else {
			printf("%d\n",4280-(1150+1250+1400+160*(n-30)));
		}
		scanf("%d",&n);
	}
	return 0;
}

Measured memory_bytes: 1028
#include<bits/stdc++.h>
using namespace std;
int main()
{
int a,b,c,d,e;
cin>>a>>b>>c>>d>>e;
vector<int> v;
if(a%10!=0)
{
v.push_back(10-a%10);
}
else if(a%10==0)
{
    v.push_back(0);
}
if(b%10!=0)
{
v.push_back(10-b%10);
}
else if(b%10==0)
{
    v.push_back(0);
}
if(c%10!=0)
{
v.push_back(10-c%10);
}
else if(c%10==0)
{
    v.push_back(0);
}
if(d%10!=0)
{
v.push_back(10-d%10);
}
else if(d%10==0)
{
    v.push_back(0);
}
if(e%10!=0)
{
v.push_back(10-e%10);
}
else if(e%10==0)
{
    v.push_back(0);
}

sort(v.begin(),v.end());
int sum=a+b+c+d+e;
int x=0;
for(int i=0;i<v.size()-1;i++)
{
    x=x+v[i];
}
cout<<sum+x;

}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep2(i, s, n) for (int i = (s); i < (int)(n); i++)
typedef long long ll;
#define all(x) (x).begin(),(x).end()
int INF = 100000000;

int main() {
  vector<vector<int>> c(3, vector<int>(3));
  rep(i, 3) {
    rep(j, 3) {
      cin >> c[i][j]; 
    }
  }
  bool flag = false;
  rep(i, c[0][0]+1) {
    int a1, a2, a3, b1, b2, b3;
    a1 = i;
    b1 = c[0][0] - i;
    a2 = c[1][0] - b1;
    a3 = c[2][0] - b1;
    b2 = c[0][1] - a1;
    b3 = c[0][2] - a1;
    if (a1 + b1 == c[0][0] && a1 + b2 == c[0][1] && a1 + b3 == c[0][2]) {
      if (a2 + b1 == c[1][0] && a2 + b2 == c[1][1] && a2 + b3 == c[1][2]) {
        if (a3 + b1 == c[2][0] && a3 + b2 == c[2][1] && a3 + b3 == c[2][2]) {
          flag = true;
        }
      }
    }
    if (flag) {
      cout << "Yes" << endl;
      return 0;
    }
  }
  cout << "No" << endl;
}

Measured memory_bytes: 256
#include<iostream>
#include<vector>
#include<algorithm>
#include<cctype>
#include<utility>
#include<string>

#define REP(n) for(int i = 0;i < n;i++)
#define LLREP(n) for(long long int  i = 0;i < n;i++)
typedef long long int ll;
using namespace std;
#define MAX_A 100000

int main(){

    int n,l;
    cin >> n >> l;
    vector<string> s(n);
    REP(n){
        cin >> s[i];
    }
    sort(s.begin(),s.end());

    REP(n){
        cout << s[i];
    }
    cout << endl;

    return 0;
}

Measured memory_bytes: 256
import numpy as np
A, B, C, X, Y = list(map(int, input().split()))

min_money = A*X + B*Y

status = np.array([X,Y,0])
delta_status = np.array([-1,-1,2])
block_status = np.array([0,0,0])
values = np.array([A,B,C])

for _ in range(max(X,Y)):
    status += delta_status
    status = np.max(np.array([status,block_status]), axis=0)
    
    tmp_money = sum(status * values)
    min_money = min(tmp_money,min_money)
print(min_money)

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

// 型定義
typedef long long ll;
typedef pair<ll, ll> P;

// forループ
#define REP(i,n) for(ll i=0; i<(ll)(n); ++i)

// 定数宣言
const int INF = 1e9;
const int MOD = 1e9+7;
const ll LINF = 1e18;

// グラフ表現
using Graph = vector<vector<int>>;

// グラフの辺表現
using Edge = map<pair<int,int>,int>;

// n次元配列の初期化。第２引数の型のサイズごとに初期化していく。
template<typename A, size_t N, typename T>
void Fill(A (&array)[N], const T &val){
    std::fill( (T*)array, (T*)(array+N), val );
}

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

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

int main()
{
    cout << fixed << setprecision(15);
    ll N, K;
    cin >> N >> K;

    string S;
    cin >> S;

    vector<ll> A(3*N+10, 0);

    ll count = 0;
    if(S[0] == '0'){
        A[count] = 0;
        count++;
    }
    
    REP(i, N){
        if(i == 0){
            A[count] = 1; 
            continue;
        }
        if(S[i] == S[i-1]){
            A[count]++;
        }
        else{
            count++;
            A[count] = 1;
        }
    }
    count++;
    // cout << count << endl;

    ll total = 0;
    ll ans = INF;

    for(ll i=0; i<2*K+1; i++){
        total += A[i];
        // cout << A[i] << endl;
    }
    ans = total;
    for(ll i=0; i<N; i=i+2){
        total -= A[i];
        total -= A[i+1];
        total += A[i+2*K+1];
        total += A[i+2*K+2];
        ans = max(ans, total);
    }

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

Measured memory_bytes: 2816
a, b, c, d = map(int, input().split())
if a*c > a*d:
    a1 = a*c
else:
    a1 = a*d
if b*c > b*d:
    a2 = b*c
else:
    a2 = b*d
if a1 > a2:
    print(a1)
else:
    print(a2)

Measured memory_bytes: 9168
import heapq

N, M, S, T = map(int, input().split())

INF = 10 ** 15
G1, G2 = [[] for i1 in range(N)], [[] for i2 in range(N)]
used1, used2 = [0 for i3 in range(N)], [0 for i4 in range(N)]
dist1, dist2 = [INF for i5 in range(N)], [INF for i6 in range(N)]


def dijkstra(g, s, d, c):
    d[s], pq = 0, []
    heapq.heappush(pq, (0, s))

    while len(pq) != 0:
        u = heapq.heappop(pq)
        c[u[1]] = 2

        if d[u[1]] < u[0]:
            continue

        for v in g[u[1]]:
            if c[v[0]] != 2:
                if d[u[1]] + v[1] < d[v[0]]:
                    d[v[0]], c[v[0]] = d[u[1]] + v[1], 1
                    heapq.heappush(pq, (d[v[0]], v[0]))


def main():
    for i in range(M):
        u, v, a, b = map(int, input().split())
        G1[u-1].append((v-1, a))
        G1[v-1].append((u-1, a))
        G2[u-1].append((v-1, b))
        G2[v-1].append((u-1, b))

    dijkstra(G1, S-1, dist1, used1)
    dijkstra(G2, T-1, dist2, used2)

    c = [0 for i in range(N)]
    for i in range(N):
        c[i] = dist1[i] + dist2[i]

    cc = [0 for i in range(N)]
    cc[N-1] = c[N-1]
    for i in range(N-2, -1, -1):
        cc[i] = min(cc[i+1], c[i])

    for i in range(N):
        print(10**15-cc[i])


if __name__ == '__main__':
    main()


Measured memory_bytes: 111776
use std::io::*;
use std::str::FromStr;

#[allow(unused_macros)]
macro_rules! scan {
  ($e:expr; $t:ty) => {
    $e.get::<$t>()
  };
  ($e:expr; $($t:ty), *) => {
    ($($e.get::<$t>(),)*)
  }
}

struct Scanner<R: BufRead> {
  reader: R,
  iter: std::vec::IntoIter<String>
}

#[allow(dead_code)]
impl<R: BufRead> Scanner<R> {
  fn new(reader: R) -> Scanner<R> {
    Scanner { reader, iter: vec![String::new()].into_iter() }
  }
  fn new_line(&mut self) {
    let mut line = String::new();
    self.reader.read_line(&mut line).ok();
    self.iter = line.trim().split_whitespace().map(|s| s.to_string()).collect::<Vec<String>>().into_iter();
  }
  fn get<T: FromStr>(&mut self) -> T {
    self.iter.next().unwrap().parse().ok().unwrap()
  }
}

fn main() {
  let cin = stdin();
  let cin = cin.lock();
  let mut scanner = Scanner::new(cin);
  loop {
    scanner.new_line();
    let (n, x) = scan!(scanner; i64, i64);
    let mut ans = 0;
    if n == 0 && x == 0 {
      break;
    }
    for i in 1..n - 1 {
      for j in i..n {
        if i == j {
          continue;
        }
        let tmp = x - (i + j);
        if tmp != i && tmp != j && tmp <= n && tmp > j {
          ans += 1;
        }
      }
    }
    println!("{}", ans);
  }
}



Measured memory_bytes: 5032
// Grid 1
// dp conteset h
#include <bits/stdc++.h>
 
# define C continue;
# define R return
 
# define D double
# define I insert
# define ll long long
# define ld long double
 
# define ull unsigned long long
# define ui unsigned int
 
# define pb push_back
# define pf push_front
 
# define vi vector < int >
# define vc vector < char >
# define vs vector < string >
# define vb vector < bool >
# define vd vector < D >
# define vll vector < ll >
# define vull vector < ull >
# define vld vector < ld >
# define PQ priority_queue
 
# define vvi vector < vector < int > >
# define vvb vector < vector < bool > >
# define vvc vector < vector < char > >
# define vvll vector < vector < ll > >
# define vvd vector < vector < D > >
# define vvld vector < vector < ld > >
 
# define all(v) (v).begin() , (v).end()
# define allrev(v) (v).rbegin() , (v).rend()
# define allcomp(v) v.begin() , v.end() , comp
# define allrevcomp(v) v.rbegin() , v.rend() , comp
 
# define pii pair < int , int >
# define pll pair < ll , ll >
# define pld pair < ld , ld >
# define pDD pair < D , D >
# define pipii pair<int, pii >
# define pcpii pair<char,pii>
 
# define vpld vector < pld >
# define vpii vector < pii >
# define vpll vector < pll >
# define vpDD vector < pDD >
 
# define vvpii vector < vector < pii > >
# define vpipii vector< pipii >
 
# define F first
# define S second
# define mp make_pair
 
# define unm unordered_map
# define unmii unm< int , int >
# define unmll unm< ll , ll >
# define unms unm<string,int>
# define unmci unm<char,int>
 
# define sortvia sort(a.begin(),a.end());
# define sortvib sort(b.begin(),b.end());
# define revsorta sort(a.begin(), a.end(), greater <int>());
# define revsortb sort(b.begin(), b.end(), greater <>());
# define loop(q,n) for(int i=q;i<n;i++)
# define loop2(q,n) for(int j=1;j<n;j++)
# define test int t;cin >> t;while(t--)
# define nextline "\n"
# define tab "\t"
# define space " "
//vector<vector<int> > vec( n , vector<int> (m, 0));
//YES
//NO
//cout
//true
//false
//yes
//no
 
const ll mod9=1e9+7;
const ll maxsize=2e9+1;
// const ll mod =998244353;
const ll mod2=1073741824;
const ll INF=1e18L+5;
const int two_pow_fiv=200008;
using namespace std;

int n,m;
vector<string> grid;
ll dp[1005][1005];
bool allowed(int i,int j){
    if(i>=n or j>=m)return false;
    else if(grid[i][j]=='#')return false;
    return true;
}


int dfs(int a,int b){
    if(dp[a][b]>-1)return dp[a][b];
    // if(a==n-1 and b=m-1)return dp[n-1][m-1];
    // first we try with dp if not then we perform dp
    dp[a][b]=(dfs(a+1,b)%mod9+dfs(a,b+1)%mod9)%mod9;
    return dp[a][b];
}


int main()
{
ios::sync_with_stdio(0);
cin.tie(0);
#ifndef ONLINE_JUDGE
    freopen("input.txt","r",stdin);
    freopen("output.txt","w",stdout);
#endif
    cin>>n>>m;
    grid.resize(n+1);
    string inp;
    loop(0,n){
        cin>>grid[i];
    }
    for(int i=0;i<=n+1;i++){
        for(int j=0;j<=m+1;j++){
            if(!allowed(i,j))dp[i][j]=0;
            else dp[i][j]=-1;
        }
    }
    dp[n-1][m-1]=1;
    cout<<dfs(0,0);

return 0;
}

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

using namespace std;

#define INF int(1e9)
#define ii pair<int, int>
#define vi vector<int>
#define mp make_pair
#define pb push_back
#define x first
#define y second


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

    int n;
    cin >> n;

    vi v(n);

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

    int a = 1;

    for(int i=0; i<n; i++)
        if(v[i]==a)
            a++;
    if(a==1)
        cout << -1 << endl;
    else
        cout << n-(a-1) << endl;


    return 0;
}

Measured memory_bytes: 1024
#include<bits/stdc++.h>
#define fast_io ios_base::sync_with_stdio(NULL); cin.tie(NULL);
#define endl '\n'
using namespace std;


int main(){
        fast_io
        int n ,a,b;
        cin>>n>>a>>b;
        cout<<min(n*a,b);
    return 0;
}



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

int main(){
    char S[5];
    cin >> S;

    int front_number, back_number;
    front_number = stoi(S) / 100;
    back_number = stoi(S) % 100;

    if(front_number <= 0 || front_number > 12){     // year
        if(back_number > 0 && back_number <= 12){   // month
            cout << "YYMM" << endl;
        } else{
            cout << "NA" << endl;
        }
    }
    if(front_number > 0 && front_number <= 12){     // month
        if(back_number > 0 && back_number <= 12){
            cout << "AMBIGUOUS" << endl;
        } else{
            cout << "MMYY" << endl;
        }
    }
}

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

int main() {
    int n, m;
    cin >> n >> m;
    vector<vector<int>> light(m,vector<int>(0));
    rep(i, m) {
        int k;
        cin >> k;
        rep(j, k) {
            int s;
            cin >> s;
            light[i].push_back(--s);
        }
    }
    vector<int> p(m);
    rep(i, m) {
        cin >> p[i];
    }
    int c = pow(2,n);
    int ans = c;
    rep(i, c) {
        bitset<10> bit = i;
        rep(j, m) {
            int cnt = 0;
            rep(k, light[j].size()) {
                if (bit.test(light[j][k])) cnt++;
            }
            if (cnt % 2 != p[j]) {
                ans--;
                break;
            }
        }
    }
    cout << ans << endl;
}

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

int main() {
    int N;
    int a[110]; 
    cin >> N;
    for (int i = 0; i < N; ++i) cin >> a[i];

    sort(a, a + N, greater<int>());  //greater<int>() iterater
    int Alice = 0;
    int Bob = 0;
    for (int i = 0; i < N; ++i) {
        if (i % 2 == 0) { 
            Alice += a[i];
        }
        else { 
            Bob += a[i];
        }
    }
    cout << Alice - Bob << endl;
}

Measured memory_bytes: 256
#include <iostream>
#include <utility>
#include <map>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
#include <array>
#include <math.h>
#include <numeric>
#include <sstream>
typedef long long ll;
using namespace std;
int main(int argc, char const *argv[]) {
    int n;
    cin >> n;
    int m;
    cin >> m;
    int k;
    cin >> k;
    for (int i = 0; i <= n; ++i) {
        for (int j = 0; j <= m; ++j) {
            if (i*(m-j)+j*(n-i) == k) {
                cout << "Yes" << std::endl;
                return 0;
            }
        }
    }
    cout << "No" << std::endl;
    return 0;
}

Measured memory_bytes: 256
require 'prime'
require 'set'
a, b = gets.split.map(&:to_i)

mods_a = Set.new
mods_b = Set.new

2.upto( Math.sqrt(a) ) do |i|
  if a % i == 0
    mods_a.add(i)
    a = a / i while a % i == 0
  end
end
if a.prime?
  mods_a.add(a) 
end

2.upto( Math.sqrt(b) ) do |i|
  if b % i == 0
    mods_b.add(i)
    b = b / i while b % i == 0
  end
end
if b.prime?
  mods_b.add(b)
end

puts (mods_a & mods_b).size + 1

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

int main() {
  int A,B,C;
  cin >> A >> B >> C;
  if(A > C && C > B) {
    cout << "Yes" << endl;
  }
  else if(A < C && C < B) {
    cout << "Yes" << endl;
  }
  else {
    cout << "No" << endl;
  }
}

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

using namespace std;
typedef long long ll;
typedef pair<ll, ll> p_ll;

template<class T>
void debug(T itr1, T itr2) { auto now = itr1; while(now<itr2) { cout << *now << " "; now++; } cout << endl; }
#define repr(i,from,to) for (int i=(int)from; i<(int)to; i++)
#define all(vec) vec.begin(), vec.end()
#define rep(i,N) repr(i,0,N)
#define per(i,N) for (int i=(int)N-1; i>=0; i--)

const ll MOD = pow(10,9)+7;
const ll LLINF = pow(2,61)-1;
const int INF = pow(2,30)-1;

vector<ll> fac;
void c_fac(int x=pow(10,6)+10) { fac.resize(x,true); rep(i,x) fac[i] = i ? (fac[i-1]*i)%MOD : 1; }
ll inv(ll a, ll m=MOD) { ll b = m, x = 1, y = 0; while (b!=0) { int d = a/b; a -= b*d; swap(a,b); x -= y*d; swap(x,y); } return (x+m)%m; }
ll nck(ll n, ll k) { return fac[n]*inv(fac[k]*fac[n-k]%MOD)%MOD; }
ll gcd(ll a, ll b) { if (a<b) swap(a,b); return b==0 ? a : gcd(b, a%b); }
ll lcm(ll a, ll b) { return a/gcd(a,b)*b; }


int main() {
  string N; cin >> N;
  int l = N.length()+1;
  int A[l] = {}; repr(i,1,l) A[i] = N[i-1] - '0';
  reverse(A,A+l);
  // debug(A,A+l);

  int result = 0;
  rep(i,l) {
    if (A[i]==10) { A[i+1]++; A[i] = 0; }
    else if (A[i]>=6||(A[i]==5&&A[i+1]>=5)) { A[i+1]++; result += 10-A[i]; }
    else result += A[i];
  }
  cout << result << endl;

  // cout << result << endl;
  return 0;
}

Measured memory_bytes: 5252
#include <bits/stdc++.h>
#define rep(i, start, end) for (long long i = start; i < end; ++i)
#define repreverse(i, start, end) for (long long i = start; i >= end; --i)
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define len(x) ((long long)(x).size())
#define lcm(a, b) ((a) / __gcd((a), (b)) * (b))
using namespace std;
using ll = long long;
using ld = long double;
using vll = vector<ll>;
using vllvll = vector<vll>;
using vc = vector<char>;
using pll = pair<ll, ll>;
template<class T> void print(T x,bool cl=1){cout<<(cl?"\x1b[36m":"")<<x<<(cl?"\x1b[39m":"")<<'\n';}
template<class T> void print1d(T x,ll n=-1,bool cl=true){if(n==-1)n=x.size();rep(i,0,n){if(i!=0)cout<<' ';cout<<(cl?"\x1b[36m":"")<<x[i];}cout<<'\n'<<(cl?"\x1b[39m":"");}
template<class T> void print2d(T x,ll r=-1,ll c=-1,bool cl=1){if(r==-1)r=x.size();if(c==-1)c=x[0].size();rep(i,0,r)print1d(x[i],c,cl);}
template<class T, class U> bool haskey(T mp, U key) { return mp.find(key) != mp.end(); }
template<class T, class U> bool isin(T el, U container) { return find(all(container), el) != container.end(); }
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; }
template<class T> bool even(T n) { return ! (n & 1); }
template<class T> bool odd(T n) { return n & 1; }
template<class T> ll rup(T a, T b) { return a % b ? a / b + 1 : a / b; }
template<class T> ld deg2rad(T deg) { return M_PI * deg / 180.0; }
template<class T> ld rad2deg(T rad) { return 180.0 * rad / M_PI; }
const long double pi = M_PI;
const long long big = 1LL << 50;
const long long inf = 1LL << 60;
const long long mod = 1e9 + 7;
ll intpow(ll a, ll n, ll _mod=numeric_limits<ll>::max()) { ll p=1; while (n) { if (n&1) p=p*a%_mod; a=a*a%_mod; n>>=1; } return p; } 
ll modc(ll a, char op, ll b, ll _mod=mod)
{
        a %= _mod; b %= _mod; ll res = 1;
        switch (op) {
        case '+': res = (a + b) % _mod; break;
        case '-': res = (a - b) % _mod; break;
        case '*': res = a * b % _mod; break;
        case '/': res = modc(a, '*', modc(b, '^', _mod-2, _mod), _mod); break;
        case '^': res = intpow(a, b, _mod); break;
        case 'P': rep(i, a-b+1, a+1) res = modc(res, '*', i, _mod); break;
        case 'C': res = modc(modc(a, 'P', b, _mod), '/', modc(b, 'P', b, _mod)); break;
        } 
        if (res < 0) { res += _mod; } return res;
}



int main()
{
        vll a(3);
        cin >> a[0] >> a[1] >> a[2];
        swap(a[0], a[1]);
        swap(a[0], a[2]);
        print1d(a, -1, false);
}


Measured memory_bytes: 3568
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;
using namespace std;

typedef long long ll;
const int N = 1e5 + 10, OO = 0x3f3f3f3f, mod = 1e9 + 7;

#define PI acos(-1)
#define clr(arr, val) memset(arr, val, sizeof(arr))
#define loop(i, n) for (int i = 0; i < int(n); i++)
#define rloop(i, n) for (int i = int(n) - 1; i >= 0; i--)
#define xloop(i, a, b) for (int i = int(a); i <= int(b); i++)
#define ALL(v) ((v).begin()), ((v).end())
#define SZ(v) ((int)((v).size()))
//int dx[] = {1, 0, -1, 0};
//int dy[] = {0, 1, 0, -1}; //4 Direction
//int dx[] = {1, 1, 0, -1, -1, -1, 0, 1};
//int dy[] = {0, 1, 1, 1, 0, -1, -1, -1}; //8 direction
int dx[]={2,1,-1,-2,-2,-1,1,2};int dy[]={1,2,2,1,-1,-2,-2,-1};//Knight Direction
//int dx[6]={2,1,-1,-2,-1,1};int dy[6]={0,1,1,0,-1,-1}; //Hexagonal Direction

//-- "كلٌّ من يسعى لابد يصل .. كلٌّ من يسعى مضمون له الوصول" --//

ll n , x , t;

int main()
{
    //ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
	
	
	string s;
	cin >> s;
	int len = SZ(s);
	ll sum = 0;
	for(int i = 0 ; i < len ; ++i)
		sum += (s[i]-'0');
	
	if(sum%9 == 0)
		cout << "Yes\n";
	else 
		cout << "No\n";
	
	
	
	
    return 0;
}




Measured memory_bytes: 3752
#include <bits/stdc++.h>
#define forn(i,b) for(int i=0 ; i< b ;i++)
#define for1(i,b) for(int i=1 ; i<=b ;i++)
#define reps(i,a,b) for(int i=a ; i< b.length() ;i++)
typedef long long ll;
#define MOD 1000000007

using namespace std;




int main()
{

  float a,incr=0;
  float res;
  cin>>a;
  for (int i = 1; i <=a; i++) {
    if(i&1)incr++;
  }
  cout<<incr/a;

  return 0 ;
}


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

int main() {
  int N;
  int t[110000], x[110000], y[110000];
  cin >> N;
  t[0] = x[0] = y[0] = 0;
  for (int i = 0; i < N; i++) {
    cin >> t[i + 1] >> x[i + 1] >> y[i + 1];
  }
  bool can = true;
  for  (int i = 0; i < N; i++) {
    int dt = t[i + 1] - t[i];
    int dist = abs(x[i + 1] - x[i]) + abs(y[i + 1] - y[i]);
    if (dt < dist) can = false;
    if (dist % 2 != dt % 2) can = false;
  }
  if (can) cout << "Yes" << endl;
  else cout << "No" << endl;
}

Measured memory_bytes: 1408
open Printf
open Scanf

let () =
  let k, s = scanf "%d %d\n" (fun x y -> (x, y)) in
  let mx = min k s in
  let count t = min (max 0 (2*k-t+1)) (t+1) in
  let rec iter x a =
    if x > mx then a
    else
      iter (x+1) (a + count (s-x)) in
  iter 0 0 |> printf "%d\n"


Measured memory_bytes: 2432
#include<stdio.h>
int main(){
int a,b,c=-1000000000,d,i;
scanf("%d\n",&a);
scanf("%d\n",&b);
d=b;
for(i=1;i<a;i++){
scanf("%d\n",&b);
if(c<b-d){
c=b-d;
}
if(d>b){
d=b;
}
}
printf("%d\n",c);
return 0;
}


Measured memory_bytes: 2148
#include <iostream>
#include <string.h>
using namespace std;

int main() {
	int n, k;
	string s;
	cin >> n >> k;
	cin >> s;

	int first = 0;
	for (int i = 0; i < n; i ++) {
		if (s[i] == 'R') {
			if (i != n-1 && s[i+1] == 'R') {
				first ++;
			}
		} else {
			if (i != 0 && s[i-1] == 'L') {
				first ++;
			}
		}
	}

	int sum = first + 2*k;
	if (sum >= n) sum = n-1;
	cout << sum << endl;


	return 0;
}

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

using namespace std;
typedef long long LL;

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

int main(){
  LL A, B;
  cin >> A >> B;
  map<LL,bool> div;
  int ans=0;
  for(LL i=1; i*i<=A; i++){
    if(A%i==0) div[i]=true, div[A/i]=true;
  }
  for(LL i=1; i*i<=B; i++){
    if(B%i==0){
      if(div[i]==true&&is_prime(i)==true) ans++;
      if(B/i!=i&&div[B/i]==true&&is_prime(B/i)==true) ans++;
    }
  }
  cout << ans << endl;
  
  return 0;
}

Measured memory_bytes: 640
import java.util.*;

public class Main {
    public static void main(String[] args){
	Scanner sc = new Scanner(System.in);
	int N = sc.nextInt();
	int count = 0;
	int num;
	for (int i=1; i<=N; i++) {
	    num = sc.nextInt();
	    if (i%2 == 1) {
		if (num%2 == 1) {
		    count++;
		}
	    }
	}
	System.out.print(count);
    }
}


Measured memory_bytes: 35752
#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define ld long double
#define rep(i,n) for(int i = 0; i < (int)(n); i++)
#define repo(i,n) for(int i = 1; i < (int)(n); i++)
#define pb push_back
#define np next_permutation
#define fi first
#define se second
#define all(x) (x).begin(),(x).end()
#define mod 1000000007
#define pi acos(-1.0)
ll gcd(ll x, ll y) { return y ? gcd(y, x % y) : x; }
ll lcm(ll x, ll y) { return x / gcd(x, y) * y; }
//cout << fixed << setprecision (20);   小数点以下2０桁まで
//intの最大値2147483647 ≒ 2×10^9
//long longの最大値9223372036854775807 ≒ 9×10^18
//'0'+=16;        で大文字に
//'大文字'+=32;    で小文字に
//s[i]-'0'でchar文字→int数に;
//string s = to_string(int数);
//int n = stoi(string文字列)
//実行時間制約2秒では２×10^8回くらいまで計算できる


int main() {
  int n;
  cin >> n;
  
  int pro=0;
  vector<int> q(8,0);
  vector<int> p(n);
  rep(i,n){
  cin>>p[i];
    if(p[i]<=399)q[0]++;
    else if(p[i]<=799)q[1]++;
    else if(p[i]<=1199)q[2]++;
    else if(p[i]<=1599)q[3]++;
    else if(p[i]<=1999)q[4]++;
    else if(p[i]<=2399)q[5]++;
    else if(p[i]<=2799)q[6]++;
    else if(p[i]<=3199)q[7]++;
    else pro++;    
  }
  
  int ans=0;
  rep(i,8){
    if(q[i]!=0)ans++;
  }
  
  if(ans==0){
  ans++;
  pro--;
  }
  
  cout << ans << " " << ans+pro << endl;
}


Measured memory_bytes: 256
import java.util.*;
public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int[] arr = new int[n];
		for(int i = 0; i < n; i++){
			arr[i] = sc.nextInt();
		}
		arr[0]--;
		for(int i = 1; i < n; i++){
			arr[i]--;
			if(arr[i] < arr[i-1]) arr[i]++;
			if(arr[i] < arr[i-1]){
				System.out.println("No"); return;
			}
		}
		System.out.println("Yes");
	}

}


Measured memory_bytes: 50376
// Problem : B - Battle
// Contest : AtCoder - AtCoder Beginner Contest 164
// URL : https://atcoder.jp/contests/abc164/tasks/abc164_b
// Memory Limit : 1024 MB
// Time Limit : 2000 ms
// Powered by CP Editor (https://github.com/cpeditor/cpeditor)

#include<bits/stdc++.h>
using namespace std;

#define pb push_back
#define vi vector<int>


int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	int a,b,c,d;
	cin>>a>>b>>c>>d;
	while(true)
	{
		c-=b;
		if(c<=0)
		{
			cout<<"Yes\n";
			return 0;
		}
		a-=d;
		if(a<=0)
		{
			cout<<"No\n";
			return 0;
		}
	}
   	return 0;
}



Measured memory_bytes: 3640
<?php
$str = trim(fgets(STDIN));
$n = strlen($str);
$a = $b = 0;
for($i = 0; $i < $n; $i++){
    if($str[$i] == $i % 2)$a++;
    if($str[$i] == ($i+1) % 2)$b++;
}
echo min($a, $b);

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

const ll INF = 1e15;
int V;
vector<vector<ll>> d(300, vector<ll>(300, INF));

void warshall_floyd() {
    for (int k = 0; k < V; k++) {
        for (int i = 0; i < V; i++) {
            for (int j = 0; j < V; j++) {
                d[i][j] = min(d[i][j], d[i][k] + d[k][j]);
            }
        }
    }
    return;
}

int main() {
    cin >> V;
    vector<vector<ll>> G(V, vector<ll>(V));
    for (int i = 0; i < V; i++) {
        for (int j = 0; j < V; j++) {
            cin >> G[i][j];
            d[i][j] = G[i][j];
        }
    }
    warshall_floyd();
    ll ans = 0;
    for (int i = 0; i < V; i++) {
        for (int j = i + 1; j < V; j++) {
            if (d[i][j] != G[i][j]) {
                cout << -1 << endl;
                return 0;
            }
            ans += d[i][j];
        }
    }
    for (int i = 0; i < V; i++) {
        for (int j = i + 1; j < V; j++) {
            for (int k = 0; k < V; k++) {
                if (i == k || j == k) continue;
                if (d[i][j] == d[i][k] + d[k][j]) {
                    ans -= d[i][j];
                    break;
                }
            }
        }
    }
    cout << ans << endl;
}

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

int main(){
    long long r(0),g(0),b(0);
    long long n;
    cin>>n;
    string s;
    cin>>s;

    for(int i=0;i<n;++i){
        if(s[i]=='R') ++r;
        else if(s[i]=='G') ++g;
        else ++b;
    }

    long long ans=r*g*b;
    for(int i=0;i<n;++i){
        for(int j=i+1;j<n;++j){
            if(s[i]==s[j]) continue;
            int k=2*j-i;
            if(k>=n) break;
            if(s[k]!=s[i]&&s[k]!=s[j]) --ans;
        }
    }

    cout<<ans<<endl;
}

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

int main() {
	string w;
	cin>>w;
	int n=w.length();
	if(w[n-1]=='s'){
	    w=w+"es";
	}
	else{
	    w=w+"s";
	}
	cout<<w;
	return 0;
}


Measured memory_bytes: 3632
import java.util.*;
import java.io.*;

class Main {

	void solve() {
		
		int r = inint(), g = inint();
		out.println(2*g - r);
		
	}

	public static Scanner in = new Scanner(System.in);
	public static PrintWriter out = new PrintWriter(System.out);

	public static void main(String[] args) {
		new Main().solve();
		out.flush();
	}

	public int inint() {
		return in.nextInt();
	}

	public long inlong() {
		return in.nextLong();
	}
	
	public String instr() {
		return in.next();
	}

	public char inchar() {
		return in.next().charAt(0);
	}
	
	public int[] inintar(int num) {
		int[] a = new int[num];
		for (int i=0; i<num; i++) {
			a[i] = in.nextInt();
		}
		return a;
	}

	public char[] incharar() {
		return in.next().toCharArray();
	}

}

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

vector<int> buf;

int main()
{
    int N, h[100], c = 0;
    vector<vector<int>> T(100, vector<int>(100, 0));
    int ans = 0;
    cin >> N;
    for (int i = 0; i < 100; i++)
    {
        h[i] = 0;
    }
    for (int i = 0; i < N; i++)
    {
        cin >> h[i];
    }
    for (int i = 0; i < 100; i++)
    {
        for (int j = 0; j < N; j++)
        {
            if (h[j] > i)
            {
                T[i][j] = 1;
            }
        }
    }
    for (int i = 0; i < 100; i++)
    {
        for (int j = 0; j < N; j++)
        {
            c = 0;
            while (T[i][j] == 1)
            {
                j++;
                c++;
            }
            if (c != 0)
            {
                ans++;
            }
        }
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 256