akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
//#include <string>
#include <vector>
#include <math.h>
#include <algorithm>

int main()
{
	int N = 0, M = 0;
	std::cin >> N >> M;

	std::vector<int> b(N + 1, true);
	for (int i = 0; i < M; i++)
	{
		int a = 0;
		std::cin >> a;
		b[a] = false;
	}

	std::vector<long long int> f(N + 1, 0);
	f[0] = 1;
	const long long int c = 1e9 + 7;

	for (int i = 1; i <= N; i++)
	{
		if (b[i])
		{
			for (int j = std::max(0, i - 2); j <= i - 1; j++)
			{
				f[i] += f[j];
				f[i] %= c;
			}
		}
	}

	std::cout << f[N] << std::endl;

	return 0;
}

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

using namespace std;

using ll = long long;

int main(void) {
    int n, k;
    cin >> n >> k;
    vector<int> x(n), y(n);
    vector<int> xary, yary;
    for (int i = 0; i < n; ++i) {
        cin >> x[i] >> y[i];
        xary.push_back(x[i]);
        yary.push_back(y[i]);
    }

    sort(begin(xary), end(xary));
    sort(begin(yary), end(yary));

    ll ans = 1LL * (xary[n - 1] - xary[0]) * (yary[n - 1] - yary[0]);

    for (int xi = 0; xi < n; ++xi) {
        for (int xj = xi + 1; xj < n; ++xj) {
            for (int yi = 0; yi < n; ++yi) {
                for (int yj = yi + 1; yj < n; ++yj) {
                    int num = 0;
                    ll lx = xary[xi], rx = xary[xj];
                    ll by = yary[yi], uy = yary[yj];

                    for (int i = 0; i < n; ++i) {
                        if (lx <= x[i] and x[i] <= rx and by <= y[i] and y[i] <= uy) {
                            num++;
                        }
                    }

                    if (num >= k) {
                        ans = min(ans, 1LL * (rx - lx) * (uy - by));
                    }
                }
            }
        }
    }

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

Measured memory_bytes: 256
// https://atcoder.jp/contests/dp/tasks/dp_e
#include <bits/stdc++.h>
using namespace std;
#define ll long long int
typedef vector<ll> vi;
typedef vector<vi> vii;
#define rep(i, k, n) for (ll i = k; i < (int)(n); i++)

int main()
{
    ll n, w;
    ll ans = 0;
    cin >> n >> w;
    vi ws(n + 1);
    vi vs(n + 1);
    ll totalVal = 0;
    rep(i, 1, n + 1)
    {
        cin >> ws[i] >> vs[i];
        totalVal += vs[i];
    }

    vii dp(n + 1, vi(totalVal + 1));
    // dp[i][j] denotes the least weight to get a value of  j from the first i objects
    dp[0][0] = 0;
    int INF = w + 1;
    rep(V, 1, totalVal + 1) dp[0][V] = INF; //arbitary large num thats impossible

    rep(N, 1, n + 1)
    {
        rep(V, 0, totalVal + 1)
        {
            dp[N][V] = (V < vs[N]) ? dp[N - 1][V] : min(dp[N - 1][V], dp[N - 1][V - vs[N]] + ws[N]);
            if (dp[N][V] <= w)
            {
                ans = max(ans, (ll)V);
            }
        }
    }

    cout << ans << endl;
}

Measured memory_bytes: 83028
#include <iostream>
#include <algorithm>
#include <vector>
#include <stdio.h>
using namespace std;

int main(){
  int n;
  scanf("%d", &n);
  vector<int> hoge(n);
  
  int a;
  for (int i = 0; i < n; i++){
    scanf("%d", &a);
    hoge[a - 1] = i + 1;
  }
  for (int i = 0; i < n; i++){
    if (i == n - 1){
      cout << hoge[i] << "\n";
    }else{
      cout << hoge[i] << " ";
    }
  }
}

Measured memory_bytes: 1152
<?php

class Caluculate {

    public function getAnswer() {
        $n = trim(fgets(STDIN));
        $count = 0;

        for ($i = 0; $i < $n; $i++) {
            $num = (int) fgets(STDIN);
            if ($this->isPrime($num)) $count++;
        }

        echo $count . PHP_EOL;
    }
}

class CheckPrimeNumber extends Caluculate {

    public function isPrime($num) {

        if ($num == 2) {
            return true;
        } elseif ( $num < 2 or $num % 2 == 0) {
            return false;
        } else {
            $start = 3;
            while ($start <= sqrt($num)) {
                if ($num % $start == 0) {
                    return false;
                }
                $start += 2;
            }
            return true;
        }
    }
}

$rate = new CheckPrimeNumber();
$rate->getAnswer();



Measured memory_bytes: 9316
#include<bits/stdc++.h>
using namespace std;
#define bitCount(num)  __builtin_popcount(num)
#define pb push_back
#define ll long long
#define bye return 0;
#define f(i,a,b) for( long long i=a;i<b;i++)
#define testCases long long t;cin>>t; while(t--)
#define fast ios_base::sync_with_stdio(false);cin.tie(NULL);
#define newLine <<"\n"

int main()
{
    fast
    int x,y;
    cin>>x>>y;
    float a=0.0000f;
    float b=0.0000f;
    b=(y-2*x)/2;
    a=(4*x-y)/2;
    // cout<<a<<endl;
    // cout<<b<<endl;
    if(a>=0 && b>=0 && a+b==x && 2*a+4*b==y || 2*b+4*a==y)
    cout<<"Yes\n";
    else cout<<"No\n";
    bye
}

Measured memory_bytes: 3660
#include <bits/stdc++.h>
#define rep(i, a, b) for(int i = a; i < (b); ++i)
#define trav(a, x) for(auto& a : x)
#define all(x) x.begin(), x.end()
#define endl "\n"
#define speed() ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define sz(x) (int)(x).size()
#define _USE_MATH_DEFINES
using namespace std;
typedef long long int lli;
typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;

const int MAX = 100;

int main() {
    speed();
    int N, A[MAX], D, X;
    cin >> N;
    cin >> D >> X;
    rep(i, 0, N) cin >> A[i];
    int ans = X;
    rep(i, 0, N) {
        int temp = ((D-1) / A[i]) + 1;
        ans += temp;
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <vector>
#include <math.h>
#include <stdio.h>
#include <algorithm>
#include <utility>
#include <functional>
#define rep(i,n) for(int i=0;i<(n);i++)
#define psortsecond(A,N) sort(A,A+N,[](const pii &a, const pii &b){return a.second<b.second;});
#define psortfirst(A,N) sort(A,A+N,[](const pii &a, const pii &b){return a.first<b.first;});
#define All(x) (x).begin(),(x).end()
using namespace std;
using pii  = pair<int,int>;
long long gcd(long long a, long long b){return (b == 0 ? a : gcd(b, a%b));}
long long lcm(long long a, long long b){return a*b/gcd(a,b);}
typedef long long ll;
#define MOD 1000000007
#define EPS 10e-8

int main() {
    ll A[4];
    rep(i,2){
        cin >> A[i];
    }
    // sort(A,A+3);
    cout << (A[0]>A[1] ? A[0]-1 : A[0]) << endl;
}

Measured memory_bytes: 256
import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.LinkedList;
import java.util.PriorityQueue;
import java.util.StringTokenizer;
import java.util.TreeMap;
import java.util.TreeSet;
import java.util.Map.Entry;
 
public class Main {
	public static void main(String[] args) throws IOException {
		MScanner sc = new MScanner(System.in);
		PrintWriter pw=new PrintWriter(System.out);
		int n=sc.nextInt();
		double ans=0.0;
		for(int i=0;i<n;i++) {
			ans+=(1.0/sc.nextDouble());
		}
		pw.printf("%.9f",1/ans);
		pw.flush();
 
	}
    static class MScanner {
		StringTokenizer st;
		BufferedReader br;
 
		public MScanner(InputStream system) {
			br = new BufferedReader(new InputStreamReader(system));
		}
 
		public MScanner(String file) throws Exception {
			br = new BufferedReader(new FileReader(file));
		}
 
		public String next() throws IOException {
			while (st == null || !st.hasMoreTokens())
				st = new StringTokenizer(br.readLine());
			return st.nextToken();
		}
 
		public String nextLine() throws IOException {
			return br.readLine();
		}
 
		public int nextInt() throws IOException {
			return Integer.parseInt(next());
		}
 
		public double nextDouble() throws IOException {
			return Double.parseDouble(next());
		}
 
		public char nextChar() throws IOException {
			return next().charAt(0);
		}
 
		public Long nextLong() throws IOException {
			return Long.parseLong(next());
		}
 
		public boolean ready() throws IOException {
			return br.ready();
		}
 
		public void waitForInput() throws InterruptedException {
			Thread.sleep(3000);
		}
	}
}

Measured memory_bytes: 20948
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Vol0_24
{
    class Program
    {
        static void Main(string[] args)
        {
            string sInput = "";
            // ??\??????????????????
            do
            {
                sInput = Console.ReadLine();
                if (sInput != null && sInput != "")
                {
                    double dSpeed = double.Parse(sInput);

                    int N = getN(getY(getTime(dSpeed)));

                    Console.WriteLine("{0}",N);
                }
            } while (sInput != null && sInput != "");
        }

        // ??????????????§????§???°????±?????????????
        static double getTime(double dSpeed)
        {
            double t = dSpeed / 9.8;

            return t;
        }

        // ?????¢????±?????????????
        static double getY(double t)
        {
            double y = 4.9 * t * t;   // ?????¨?????\

            return y;
        }

        // ?????¢???????????°???????????????
        static int getN( double y )
        {
            int N = 0;
            N = (int)( (y + 5) / 5 + 1);

            return N;
        }



    }
}

Measured memory_bytes: 9200
#include <stdio.h>
#define MAX 100000
#define BIG 1000000000

typedef struct{
  char name;
  int num;
} P;

//安定なソートのマージソートと比較する
void merge(P *,int,int,int);
void mergeSort(P *,int,int);
int parttion(P *,int ,int);
void quicksort(P *,int ,int);


int main(){
   int i,n,t;
   char C[10];
   P A[MAX],B[MAX];
   int s=1;

   scanf("%d",&n);
   for(i=0;i<n;i++){
       scanf("%s %d",C,&t);
       A[i].name=B[i].name=C[0];
       A[i].num=B[i].num=t;

   }

  mergeSort(B,0,n);
  quicksort(A,0,n-1);

  for(i=0;i<n;i++){
      if(A[i].name!=B[i].name) s=0;
  }

   if(s==1) printf("Stable\n");
   else printf("Not stable\n");
  for(i=0;i<n;i++){
    printf("%c %d\n",A[i].name,A[i].num);
  }

  return 0;
}

int partition(P *A,int p,int r){

    int i,j;
    P x,temp1,temp2;

    x=A[r];
    i=p-1;
    for(j=p;j<=r-1;j++){
        if(A[j].num<=x.num){       
            i=i+1;
            temp1=A[i];
            A[i]=A[j];
            A[j]=temp1;
        }
    }
    temp2=A[i+1];
    A[i+1]=A[r];
    A[r]=temp2;

    return i+1;

}

void merge(P *B,int left,int mid,int right){
int n1,n2,i,j,k;
  n1=mid-left;
  n2=right-mid;
  P L[n1+1];
  P R[n2+1];
  
  for(i=0;i<=n1-1;i++){
    L[i]=B[left+i];
  }
  for(j=0;j<=n2-1;j++){
    R[j]=B[mid+j];
  }
  L[n1].num=BIG;
  R[n2].num=BIG;
  i=0;
  j=0;
  for(k=left;k<=right-1;k++){
   if(L[i].num<=R[j].num){
      B[k]=L[i];
      i++;
    }
    else{
      B[k]=R[j];
      j++;
    }
  }
}

void mergeSort(P *B,int left,int right){

 int mid;
    if(left+1<right){
        mid=(left+right)/2;
        mergeSort(B,left,mid);
        mergeSort(B,mid,right);
        merge(B,left,mid,right);
    }
}
void quicksort(P *A,int p,int r){
    int q;
    if(p<r){
        q=partition(A,p,r);
        quicksort(A,p,q-1);
        quicksort(A,q+1,r);
    }

}



Measured memory_bytes: 4072
{-# LANGUAGE OverloadedStrings #-}
import Control.Monad
import Data.Array
import Data.Char
import Data.List
import Data.Maybe
import Data.Tuple
import qualified Data.ByteString.Char8 as BS

main :: IO ()
main = do
  [n, m] <- getIntList
  edges <- accumArray (||) False ((1, 1), (n, n)) . flip zip (repeat True) <$> replicateM m getIntTuple
  let paths = map ((\ns -> zip ns (tail ns)) . (1:)) $ permutations [2..n]
  let check p = edges!p || edges!(swap p)
  print . length . filter id . map (all check) $ paths

-- IO
readInt :: BS.ByteString -> Maybe (Int, BS.ByteString)
readInt = BS.readInt . BS.dropWhile isSpace

getInt :: IO Int
getInt = fst . fromJust . BS.readInt <$> BS.getLine

getIntList :: IO [Int]
getIntList = unfoldr readInt <$> BS.getLine

getIntTuple :: IO (Int, Int)
getIntTuple = do
  (a, s) <- fromJust . readInt <$> BS.getLine
  let (b, _) = fromJust . readInt $ s
  return (a, b)

Measured memory_bytes: 1020
import math
import collections

n = int(input())

factorial = 1
divisor = []
ans = 1


# 素数を求める関数
def get_prime(num):
    if num <= 1:
        return
    for i in range(2, num+1):
        while num % i == 0:
            divisor.append(i)
            num //= i


# 約数の数 = (素数xの個数+1)(素数yの個数+1)(素数zの個数+1)...
# 方針：入力値を素因数分解し、各素因数の個数を求める

# n-iの素因数を求める
for j in range(2, n+1):
    get_prime(j)

# print(divisor)

# 各素因数の組み合わせ数を求める
count = collections.Counter(divisor)

for k in count.most_common():
    temp = list(k)[1]
    ans = ans * (temp + 1)

ans = ans % (10 ** 9 + 7)

print(ans)

Measured memory_bytes: 9408
import sys
input = sys.stdin.readline
from collections import deque
n,m = map(int,input().split())
ab = [list(map(int,input().split())) for i in range(m)]
graph = [[] for i in range(n+1)]
for a,b in ab:
  graph[a].append(b)
  graph[b].append(a)
q = deque()
q.append(1)
ans = [0 for i in range(n+1)]
ans[1] = -1
while q:
  x = q.popleft()
  for y in graph[x]:
    if ans[y] == 0:
      ans[y] = x
      q.append(y)
print("Yes")
print(*ans[2:],sep="\n")

Measured memory_bytes: 121200
import java.io.*;
class Main{
  public static void main(String[] args)throws IOException{
    BufferedReader  br=new BufferedReader(new InputStreamReader(System.in));
    String str=br.readLine();
    String[] nm=str.split(" ");
    int n=Integer.parseInt(nm[0]);
    int m=Integer.parseInt(nm[1]);
    int[][] a=new int[n][m];
    int[] b=new int[m];
    int[] c=new int[n];
    for(int i=0; i<n; i++){
      String str2=br.readLine();
      String[] arr=str2.split(" ");
      for(int j=0; j<m; j++){
        a[i][j]=Integer.parseInt(arr[j]);
      }
    }
    for(int k=0; k<m; k++){
      String str3=br.readLine();
      b[k]=Integer.parseInt(str3);
    }
    for(int x=0;x<n;x++){
      for(int y=0;y<m;y++){
        int tmp= a[x][y]*b[y];
        c[x] += tmp;
      }
      System.out.println(c[x]);
    }
    br.close();
}
}

Measured memory_bytes: 27332
n, m = map(int, input().split())
h = list(map(int, input().split()))
ab = [list(map(int, input().split())) for _ in range(m)]
#print(h)
#print(ab)

l = [1 for _ in range(n)]
for i in ab:
  if h[i[0]-1] > h[i[1]-1]:
    l[i[1]-1] = 0
  elif h[i[1]-1] > h[i[0]-1]:
    l[i[0]-1] = 0
  else:
    l[i[1]-1] = 0
    l[i[0]-1] = 0

print(sum(l))

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

#define N 100000

typedef struct{
  int par, left_child, right_sibling, depth, status;
}Node;

Node tree[N];
int n, nchild[N];
char root[N];

void calc_depth(int p, int d){
  tree[p].depth = d;
  if(tree[p].right_sibling != -1) calc_depth(tree[p].right_sibling, d);
  if(tree[p].left_child != -1) calc_depth(tree[p].left_child, d+1);
}

void print_node(int p, int cnt, int size){
  if(cnt + 1 == size) printf("%d", p);
  else{
    printf("%d, ", p);
    print_node(tree[p].right_sibling, cnt + 1, size);
  }
}

main(){
  int i, j, r;
  scanf("%d", &n);
  memset(root, 1, n);
  for(i=0;i<n;i++) tree[i].left_child = tree[i].right_sibling = -1;
  for(i=0;i<n;i++){
    int idx;
    scanf("%d", &idx);
    scanf("%d", &nchild[idx]);
    if(nchild[idx] == 0) tree[idx].status = 1;
    else tree[idx].status = 2;
    for(j=0;j<nchild[idx];j++){
      int in, pre;
      scanf("%d", &in);
      tree[in].par = idx;
      root[in] = 0;
      if(j == 0) tree[idx].left_child = in;
      else tree[pre].right_sibling = in;
      pre = in;
    }
  }
  for(i=0;i<n;i++) if(root[i]) r = i;
  tree[r].par = -1;
  tree[r].status = 0;
  calc_depth(r, 0);
  for(i=0;i<n;i++){
    printf("node %d: parent = %d, depth = %d, ", i, tree[i].par, tree[i].depth);
    if(tree[i].status == 0) printf("%s, [", "root");
    else if(tree[i].status == 1) printf("%s, [", "leaf");
    else if(tree[i].status == 2) printf("%s, [", "internal node");
    if(tree[i].left_child != -1) print_node(tree[i].left_child, 0, nchild[i]);
    printf("]\n");
  }
  return 0;
}

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

using namespace std;
using ll =long long;
using db = double;

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

#define che(a,string) cout<<"//"<<string <<"=="<<(a)<<"//" <<endl;
#define SORT(a) sort((a).begin(),(a).end())
#define rSORT(a) reverse((a).begin(),(a).end())
#define For(i, a, b)    for(int i = (a) ; i < (b) ; ++i)
#define rep(i, n)       For(i, 0, n)
#define leftunique(v) SORT(v);(v).erase(unique((v).begin(),(v).end()),(v).end())
//leftuniqueは配列から同じ要素のものを取り除く 例 4 6 2 1 3 4 1 2 なら 1 2 3 4 6 になる
bool IsInt(double a){int b = a/1;if(a==b){return true;}else {return false;}}
bool coY() {cout <<"Yes"<<endl;}
bool coN(){cout <<"No"<<endl;}
const int mod = 1e9 + 7;

ll ans;
//ここから書き始める
int main()
{
	cout << setprecision(10);
	int CafelatteAtAllthingsBecomeAC;
	cin >> CafelatteAtAllthingsBecomeAC;
	vector<int> sakakitohru(CafelatteAtAllthingsBecomeAC);
	rep(gagen,CafelatteAtAllthingsBecomeAC) cin >>sakakitohru[gagen];
	
	vector<int> onigawara(CafelatteAtAllthingsBecomeAC);
	rep(gagen,CafelatteAtAllthingsBecomeAC) cin >> onigawara[gagen];

	ll const_expr = 0 ;
	rep(gagen,CafelatteAtAllthingsBecomeAC){
		if(sakakitohru[gagen]>=onigawara[gagen]){
			const_expr += sakakitohru[gagen] - onigawara[gagen];
		}
	}
	cout << const_expr << endl;

}


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

using namespace std;
typedef long long ll;

int main(){
  ll N;
  string S;
  cin >> N;
  cin >> S;
  ll a[N],b[N];
  b[0]=0;
  if(S[0]=='E'){
    a[0]=1;
    b[0]=0;
  }else{
    a[0]=0;
    b[0]=1;
  }
  for(int i=1;i<N;i++){
    if(S[i]=='E') {
      a[i]=a[i-1]+1;
      b[i]=b[i-1];
    }
    else {
      a[i]=a[i-1];
      b[i]=b[i-1]+1;
    }
  }
  ll ans=a[N-1]-a[0];
  for(int i=0;i<N;i++){
    if(ans>a[N-1]-a[i]+b[i-1]) ans=a[N-1]-a[i]+b[i-1];
  }
  cout << ans << endl;
}


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


##{0,9}の組み合わせなし
x1=8**n  ##{0}も{9}も一切ない
x2=(9**n-8**n)*2  ##{0}もしくは{9}がない




##{0,9}関係なし全組み合わせ
y=10**n


answer=y-(x1+x2)
ans=answer%(10**9+7)

print(ans)

Measured memory_bytes: 11264
import java.util.Scanner;

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

		String s = sc.next();
		String a = "";
		String b = "";
		boolean end = false;
		s = s.substring(0, s.length() - 2);
		for (int i = s.length() - 1; i > 0; i--) {
			if (s.length() % 2 == 0) {
				a = s.substring(0, (s.length() - 1) / 2);
				b = s.substring((s.length() - 1) / 2 + 1, s.length() - 1);
				if (a.equals(b)) {
					System.out.println(s.length());
					end = true;
					break;
				}
			}
			s = s.substring(0, s.length() - 2);
		}
		if (end == false) {
			System.out.println(0);
		}
	}
}

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

typedef long long ll;
typedef pair<int, int> pii;

#define rep(i, n) for (int i = 0; i < (n); i++)
#define repp(i, s, e) for (int i = (s); i < (e); i++)
#define all(x) x.begin(), x.end()

#define endl "\n"

void use_cio() {
    ios_base::sync_with_stdio(0);
    cin.tie(0);
}

template <class L, class R>
ostream &operator<<(ostream &os, pair<L, R> P) {
    return os << "(" << P.first << "," << P.second << ")";
}
template <class T>
ostream &operator<<(ostream &os, vector<T> V) {
    os << "[";
    for (auto x : V) os << x << ", ";
    return os << "]";
}
//--------------------------------------------------//
ll k, a, b;
int main() {
    use_cio();
    cin >> k >> a >> b;
    if (b <= a + 2)
        return !(cout << k + 1 << endl);
    else {
        if (k + 1 <= a)
            cout << k + 1 << endl;
        else {
            k -= a - 1;
            cout << a + (b - a) * (k / 2) + (k % 2) << endl;
        }
    }
}


Measured memory_bytes: 256
import itertools

n,k= map(int, input().split())
a= list(map(int, input().split()))
if k>=50:
    ans=[n]*n
    print(*ans)
    exit()

ans=[0]*(n+1)
# ims
for i in range(k):
    ansx=[0]*(n+1)
    for j in range(n):
        if i==0:
            ansx[max(j - a[j], 0)] += 1
            ansx[min(n, j + a[j] + 1)] -= 1
        else:
            ansx[max(j - ans[j], 0)] += 1
            ansx[min(n, j + ans[j] + 1)] -= 1

    ansx = list(itertools.accumulate(ansx))
    ans=ansx


print(*ans[:n])

Measured memory_bytes: 179108
#include<stdio.h>
int main(void){
    int y,m,d;
    scanf("%d/%d/%d",&y,&m,&d);
    if(y>2019){
        printf("TBD\n");
    }else if(y=2019){
        if(m>4){
         printf("TBD\n");   
        }else if(m=4){
            if(d>30){
                printf("TBD\n");
            }else{
                printf("Heisei\n");
            }
        }else{
            printf("Heisei\n");
        }
    }else{
        printf("Heisei\n");
    }
    return 0;
}

Measured memory_bytes: 128
n,*L=map(int,open(0).read().split())
T,V=L[:n],L[n:]
s=sum(T)
a=[0]
for t,v1,v2 in zip(T,V,V[1:]+[0]):
	a+=[v1]*(2*t-1)+[min(v1,v2)]
for i in range(2*s):
	a[i+1]=min(a[i+1],a[i]+.5)
for i in range(2*s,0,-1):
	a[i-1]=min(a[i-1],a[i]+.5)
print(sum(a)/2)

Measured memory_bytes: 3496
#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); ++i)
using namespace std;
using ll = long long;
using P = pair<int,int>;
int main() {
    string s; cin >> s;
    int n = s.size();
    cout << s[0] << n-2 << s[n-1];
}


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

int main() {
	long N, Y;
	cin >> N >> Y;
	long x, y, z, p;
	x = y = z = -1;
	p = Y / 1000;
	for (long i = 0; i <= N; i++)
	{
		for (long t = 0; t <= N - i; t++)
		{
			if (9 * i + 4 * t == p-N)
			{
				x = i;
				y = t;
				z = N - i - t;
			}
		}
	}



	cout << x << " " << y << " " << z;

	return 0;
}

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

vector<bool> Eratos(1299710,true);

int main()
{
	int N,min,max;
	for (int i = 2; i < 1142;) {
		for (int j = i * 2; j <= 1299710; j += i) {
			if (j % i == 0) {
				Eratos[j] = false;
			}
		}
		for (i++;!Eratos[i];i++);
	}
	while (cin >> N, N) {
		for (min = N; !Eratos[min]; min--);
		for (max = N; !Eratos[max]; max++);
		cout << max - min << endl;
	}
	return 0;
}

Measured memory_bytes: 1272
chars = gets.chomp.chars

ans = Array.new(chars.length) { 0 }

cnt = 0

chars.each_with_index do |c, i|
  if c == 'R'
    cnt += 1
  else
    ans[i] += cnt / 2
    ans[i - 1] += (cnt + 1) / 2
    cnt = 0
  end
end

ans.reverse!

cnt = 0

chars.reverse.each_with_index do |c, i|
  if c == 'L'
    cnt += 1
  else
    ans[i] += cnt / 2
    ans[i - 1] += (cnt + 1) / 2
    cnt = 0
  end
end

ans.reverse!

puts ans.join(' ')

Measured memory_bytes: 11516
#include <iostream>
#include <string>
#include <vector>
#include <list>
#include <map>
#include <queue>
#include <stack>
#include <algorithm>
#include <fstream>
#include <sstream>
#include <iomanip>
#define ll long long

using namespace std;

long long MOD = 1000000007;

template<typename T>
void cout_vec(vector<T> &vec){
    for(int i=0; i<vec.size(); i++){
        if (i!=0){
            cout << ' ';
        }
        cout << vec[i];
    }
    cout << endl;
}

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

    vector<int> vec(N+1);
    for(int i=0; i<N; i++){
        cin >> vec[i];
    }

    for(int i=0; i<K; i++){
        vector<int> nw(N+1,0);
        for(int j=0; j<N; j++){
            nw[max(0,j-vec[j])]++;
            nw[min(N,j+vec[j]+1)]--;
        }
        ll sum_=0;
        for(int k=0; k<N; k++){
            nw[k+1]+=nw[k];
            sum_+=(ll)nw[k];
        }
        vec.swap(nw);
        if(sum_==(ll)N*N){
            //cout << i << endl;
            break;
        }
        //cout << vec[0] << endl;
    }
    vec.pop_back();
    cout_vec(vec);
}

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

using namespace std;

typedef long long ll;
typedef pair<ll, ll> P;

#define MOD 1000000007
#define REP(i, N) for (int i = 0; i < N; ++i)
#define REP1(i, N) for (int i = 1; i <= N; ++i)
#define RREP(i, N) for (int i = N - 1; i >= 0; --i)
#define ALL(a) a.begin(), a.end()

struct UnionFind {
  vector<int> par;
  vector<int> sz;
  UnionFind(int n) { init(n); }

  void init(int n) {
    par.resize(n);
    sz.resize(n);
    REP(i, n) {
      par[i] = i;
      sz[i] = 1;
    }
  }

  int find(int x) {
    if (par[x] == x)
      return x;
    else
      return par[x] = find(par[x]);
  }

  void unite(int x, int y) {
    x = find(x);
    y = find(y);
    if (x == y) return;
    if (sz[x] < sz[y]) {
      par[x] = y;
      sz[y] += sz[x];
    } else {
      par[y] = x;
      sz[x] += sz[y];
    }
  }

  bool same(int x, int y) { return find(x) == find(y); }

  int size(int x) { return sz[find(x)]; }
};

int main() {
  int n, m;
  cin >> n >> m;
  int p[n];
  REP(i, n) {
    cin >> p[i];
    p[i]--;
  }
  UnionFind uf(n);
  REP(i, m) {
    int x, y;
    cin >> x >> y;
    x--, y--;
    uf.unite(x, y);
  }
  int ans = 0;
  REP(i, n) {
    if (uf.same(i, p[i])) ans++;
  }
  cout << ans << endl;
  return 0;
}

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

string S;
int N, K;
vector<string> V;

int main(){
    cin >> S >> K;
    N = S.size();
    for(int i = 1; i <= K; i++){
        for(int j = 0; j + i <= N; j++){
            V.push_back(S.substr(j,i));
        }
    }
    sort(V.begin(),V.end());
    V.resize(unique(V.begin(),V.end())-V.begin());
    cout << V[K-1] << '\n';
}

Measured memory_bytes: 1660
#include <bits/stdc++.h>
using namespace std;
using ll=long long;
using vin=vector<int>;
using vll=vector<long long>;
using vstr=vector<string>;
#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++)
#define _GLIBCXX_DEBUG
int main()
{
    int a,b;
    cin>>a>>b;
    int sum=1;
    int ans=0;
    while(sum<b){
        sum+=a-1;
        ans++;
    }
    cout<<ans<<endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;
using namespace std;
 
#define pb push_back
#define f first
#define s second
#define lb lower_bound
#define ub upper_bound
 
typedef long long ll;
typedef vector<int> vi;
typedef unsigned long ul;
typedef vector<ll> vl;
typedef pair<int,int> pi;
typedef vector<pi> vpi;
typedef set<int> si;
typedef multiset<int> mi;
 
const ll INF = 1e18;
const int MOD = 1e9+7;
 
int main() {
	
	cin.tie(NULL);
	ios_base::sync_with_stdio(false);

	//ofstream cout ("name.out");
	//ifstream cin ("name.in");

	ll n,d, cnt=0;
	cin>>n>>d;

	for(int i=0; i<n; ++i) {
		ll x,y;
		cin>>x>>y;
		if(pow(x,2)+pow(y,2)<=pow(d,2)) ++cnt;
	}

	cout<<cnt<<"\n";

	return 0;
}



Measured memory_bytes: 3604
#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<queue>
#include<map>
#include<math.h>
#include<iomanip>
#include<set>
#include<numeric>
#include<cstring>
#include<cstdio>
#include<functional>
#include<bitset>
#include<limits.h>
#include<cassert>
#include<iterator>
#include<complex>
#include<stack>
#include<sstream>
using namespace std;
typedef  long long int lint;
typedef pair<int, int> P;
typedef pair<lint, lint> LLP;
typedef pair<char, char>CP;
#define rep(i, n) for (int i = 0; i < n; i++)
#define repr(i, n) for (int i = n; i >= 0; i--)
#define sort(v) sort((v).begin(), (v).end())
#define reverse(v) reverse((v).begin(), (v).end())
#define upper(v,hoge) upper_bound(v.begin(),v.end(),hoge)
#define lower(v,hoge) lower_bound(v.begin(),v.end(),hoge)
#define llower(v,hoge) *lower_bound(v.begin(), v.end(), hoge)
#define lupper(v,hoge) *upper_bound(v.begin(), v.end(), hoge)

const lint MOD = pow(10, 9) + 7;

lint gcd(lint a, lint b) {
	//aとbの最大公約数を返す
	if (a < b)swap(a, b);
	if (a % b == 0)return b;
	return gcd(a % b, b);
}

lint lcm(lint a, lint b) {
	//aとbの最小公倍数を返す
	return a / gcd(a, b) * b;
}

/*
vector<char>al(26);
al = {'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z'};
vector<char>AL(26);
AL = {'A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z'};
vector<char>NUM(10);
	NUM = { '0','1','2' ,'3' ,'4' ,'5' ,'6' ,'7' ,'8' ,'9' };
*/


int main() {
	int M, D;
	cin >> M >> D;
	int cnt = 0;
	for (int i = 0; i <= M; i++) {
		for (int j = 0; j <= D; j++) {
			if (j / 10 >= 2 && j % 10 >= 2 && (j / 10) * (j % 10) == i) {
				//cout << i << ' ' << j << endl;
				cnt++;
			}
		}
	}
	cout << cnt << endl;
}


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

struct datum{
  datum(){};
  datum(bool type,double rrr,int cost){
    t=type;
    r=rrr;
    c=cost;
  }
  bool t;
  double r;
  int c;
};


int m;
int years;
vector<datum> data;

void init(){
  data.clear();
}

int input(){
  cin>>m>>years;
  int tmp;
  cin>>tmp;
  for(int i=0;i<tmp;i++){
    bool t;double r;int c;
    cin>>t>>r>>c;
    data.push_back(datum(t,r,c));
  }
  return 1;
}



int cul(int m,int years,datum d){
  int res=m;
  int add=0;
  for(int i=0;i<years;i++){
    int a,b;
    if(d.t){
      a = res;
      b = res*d.r;
      res = a + b - d.c;
    }else{
      a = res;
      b = res * d.r;
      res = a - d.c;
      add += b;
    }
  }
  res+=add;
  return res;
}

int solve(){
  int res=-100;
  for(int i=0;i<data.size();i++){
    int tmp=cul(m,years,data[i]);
    res=max(res,tmp);
  }
  return res;
}

int main(){
  int c;
  cin>>c;
  for(int i=0;i<c;i++){
    init(),input();
    cout<<solve()<<endl;;
  }
}

Measured memory_bytes: 1240
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner scan = new Scanner(new BufferedReader(new InputStreamReader(System.in)));
        long W = scan.nextLong();
        long H = scan.nextLong();
        long x = scan.nextLong();
        long y = scan.nextLong();
        double area = ((double) W * H) / 2;
        int multiple = W == 2 * x && H == 2 * y ? 1 : 0;
        System.out.println(String.format("%.10f",area) + " " + multiple);
    }
}

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

using ll = long long;

const int INF = 1001001001;
const ll INF_LL = 1001001001001001001LL;

int main(void){
  int x; cin >> x;
  
  if(x==7 || x==5 || x==3) cout << "YES" << endl;
  else cout << "NO" << endl;
  
  return 0;
}


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

using namespace std;

using ll = long long;

constexpr char newl = '\n';

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

    ll a, b, c, d;
    cin >> a >> b >> c >> d;
    cout << max({a * c, a * d, b * c, b * d}) << newl;

    return 0;
}

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

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

Measured memory_bytes: 3632
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main(){
	int n;
	cin>>n;
	int a[n]={};
	for(int i=0; i<n; i++){
		cin>>a[i];
	}
	ll k[n]={};
	k[n-1]=a[n-1];
	for(int i=n-1; i>0; i--){
		k[i-1]=(k[i]+a[i-1])%1000000007;
	}
	ll ans=0;
	for(int i=0; i<n-1; i++){
		ans+=(a[i]*k[i+1])%1000000007;
		ans=ans%1000000007;
	}
	cout<<ans<<endl;
}
		
	

Measured memory_bytes: 5920
#include <iostream>
#include <set>
#include <vector>
#include <string>
#include <algorithm>
#include <iterator>
#include <map>
#include <utility>
#include <list>
#include <climits>
#include <bitset>

using namespace std;

#define rep(i, n) for(int i = 0; i < n; i++)
#define repi(i, n) for(auto i = (n).begin(); i != (n).end(); i++)
#define in_arr(type, a, n) copy_n(istream_iterator<type>(cin), n, (a).begin());
#define ll long long int

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


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define _GLIBCXX_DEBUG //これつけるとA[N]でもいいらしい
//for文のマクロ
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define big 1000000007
#define all(a) sort((a).begin(), (a).end()) //ソートのマクロ
#define Re(a) reverse((a).begin(), (a).end())
int main(){
    int n;
    cin>>n;
    int max = -1;
    int ans = -1;
    for(int i=1;i<=n;i++){
        int tmp = i;
        int div = 0;
        while(tmp%2==0){
            tmp = tmp/2;
            div++;
        }
        if(div>max){
            max = div;
            ans = i;
        }
    }
    cout<<ans<<endl;
}

Measured memory_bytes: 256
#include <iostream>

using namespace std;

const int N = 1e5 + 7;

long long d[N];

int abs(int val) {
    return max(val, -val);
}

int main()
{
    int n, tw, val, cst;
    cin >> n >> tw;
    for (int i = 1; i < N; ++i)
        d[i] = 1e18;
    for (int i = 0; i < n; ++i) {
        cin >> cst >> val;
        for (int j = N - 1; j >=val; --j)///dp[i] = greutate minima pentru i valoare
            d[j] = min(d[j], d[j - val] + cst);
    }
    val = 1, cst = 0;
    int ans;

    for (int j = 0; j < N; ++j)///dp[i] = greutate minima pentru i valoare
        if (d[j] <= tw)///aici poti si bs da-s lenes
            ans = j;
    cout << ans;
    return 0;
}


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

using namespace std;

int main()
{
long long n, k,ans=0 ;
cin >> n >> k ; int a[n] ;
for (int i=1;i<=n;i++)
cin >> a[i] ;
sort(a+1,a+n+1) ;
for (int i=1;i<=n-k;i++)
ans+=a[i] ;
cout << ans << endl ;
}


Measured memory_bytes: 1024
use std::vec::Vec;

fn read<T: std::str::FromStr>() -> T {
    let mut s = String::new();
    std::io::stdin().read_line(&mut s).ok();
    s.trim().parse().ok().unwrap()
}

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

fn main() {
    let (r, g, b, n) = {
      let v: Vec<u64> = read_vec();
      (v[0], v[1], v[2], v[3])
    };
    let mut res: u64 = 0;
    for i in 0..3001 {
      for j in 0..3001 {
        let bt: u64 = n - r * i - g * j;
        if bt % b == 0 {
          let nb: u64 = bt / b;
          if 0 <= nb && nb <= 3000 {
            res += 1;
          }
        }
      }
    }

    println!("{}", res);
}


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

using namespace std;

int N, K;
vector<int> CardsInfo;
vector<int> KOfCards;
set<int> Number;

void judge() {
	int num;
	stringstream ss;
	vector<int> temp(KOfCards);

	sort(temp.begin(), temp.end());
	do {
		for (int i = 0; i < K; ++i) {
			ss << temp[i];
		}
		ss >> num;
		ss.clear();
		//cout << "=" << num << endl;
		Number.insert(num);
	} while (next_permutation(temp.begin(), temp.end()));
	//cout << "curTotal:" << Number.size() << endl;
}

void findCombination(int index, int k) {
	
	if (k == K) {
	    /*for (auto p : KOfCards) {
			cout << p << " ";
		}
		cout << endl;*/
		judge();
		return;
	}
	if (index >= N) {
		return;
	}

	KOfCards.push_back(CardsInfo[index]);
	findCombination(index + 1, k + 1);
	KOfCards.pop_back();
	findCombination(index + 1, k);
}


int main() {
	int num;

	while (cin >> N >> K, N) {
		CardsInfo.clear();
		for (int i = 0; i < N; ++i) {
			cin >> num;
			CardsInfo.push_back(num);
		}
		Number.clear();
		findCombination(0, 0);
		cout << Number.size() << endl;
	}

	return 0;
}


Measured memory_bytes: 3244
#include <bits/stdc++.h>
#define rep(i, a, n) for(int i = a; i < n; i++)
#define int long long
using namespace std;
typedef pair<int, int> P;
const int mod = 1000000007;
const int INF = 1e18;

signed main(){
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    int n;
    cin >> n;
    vector<int> a(n), b(n), c(n - 1);
    rep(i, 0, n) cin >> a[i], a[i]--;
    rep(i, 0, n) cin >> b[i];
    rep(i, 0, n - 1) cin >> c[i];
    int ans = 0;
    rep(i, 0, n){
        ans += b[i];
    }
    rep(i, 0, n - 1){
        if(a[i] + 1 == a[i + 1]){
            ans += c[a[i]];
        }
    }
    cout << ans << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using ll = long long;
using namespace std;
#define rep(i,n) for(int i=0, i##_len=(int)(n); i<i##_len; i++)
#define reps(i,n) for(int i=1 , i##_len=(int)(n);i<=i##_len;i++)
#define rrep(i,n) for(int i=((int)(n)-1);i>=0;i--)
#define rreps(i,n) for(int i=((int)(n));i>0;i--)
#define repi(i,x) for(auto i=(x).begin(),i##_fin=(x).end();i!=i##_fin;i++)
#define all(x) (x).begin(), (x).end()
#define F first
#define S second
#define mp make_pair
#define pb push_back
#define solve(a) ((a)?"Yes":"No")
typedef vector<int> Vi;
typedef vector<Vi> VVi;
typedef pair<int , int> Pi;
typedef vector<Pi> VPi;
typedef vector<long long> V;
typedef vector<V> VV;
typedef pair<long long , long long> P;
typedef vector<P> VP;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1;} return 0;}
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1;} return 0;}
const long long INFLL = 1LL<<60;
const int INF = 1<<30;
const double PI=acos(-1);
int main(){
	int n,m;
	bool is=false;
	cin >>n>>m;
	vector<string>a(n),b(m);
	rep(i,n){
		cin>>a[i];
	}
	rep(i,m){
		cin>>b[i];
	}
	bool can=true;
	for(int i=0;i<=n-m;i++){
	
		for(int j=0;j<=n-m;j++){
			can = true;
		//	clog << i << " " << j << endl;
			rep(I,m){
				
			can&=(equal(b[I].begin(),b[I].end(),(a[i+I].begin())+j));
			//clog<<I<<" "<<can<<endl;
			}
			if (can)
			{
				is = true;
			}
		}
	
	}
	cout<<solve(is)<<endl;
}

Measured memory_bytes: 3596
#include <bits/stdc++.h>
using namespace std;
typedef pair<int,int>   II;
typedef vector< II >      VII;
typedef vector<int>     VI;
typedef vector< VI >     VVI;
typedef long long int     LL;
typedef vector<LL>         VL;
typedef unsigned long long int ULL;

#define PB push_back
#define MP make_pair
#define F first
#define S second
#define SZ(a) (int)(a.size())
#define ALL(a) a.begin(),a.end()
#define SET(a,b) memset(a,b,sizeof(a))
#define LET(x,a) __typeof(a) x(a)

#define rep(i, begin, end) for (__typeof(end) i = (begin) - ((begin) > (end)); i != (end) - ((begin) > (end)); i += 1 - 2 * ((begin) > (end)))
//Works for forward as well as backward iteration

#define gu getchar
#define pu putchar
#define si(n) cin>>n
#define dout(n) cout<<n<<"\n"
//# define M_PI           3.14159265358979323846264338327950288

#define DRT() int t; si(t); while(t--)

#define PlUSWRAP(index,n) index = (index+1)%n        //index++; if(index>=n) index=0
#define MINUSWRAP(index,n) index = (index + n -1)%n     //index--; if(index<0) index=n-1
#define ROUNDOFFINT(d) d = (int)((double)d + 0.5)    //Round off d to nearest integer

#define FLUSHN while(gu()!='\n')
#define FLUSHS while(gu()!=' ')

#define TRACE

#ifdef TRACE
#define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
template <typename Arg1>
void __f(const char* name, Arg1&& arg1){
    cerr << name << " : " << arg1 << std::endl;
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args){
    const char* comma = strchr(names + 1, ',');cerr.write(names, comma - names) << " : " << arg1<<" | ";__f(comma+1, args...);
}
#else
#define trace(...)
#endif

#define off ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)

// set_name.find_by_order(k) It returns to an iterator to the kth element (counting from zero) in the set in O(logn) time
// set_name.order_of_key(k) It returns to the number of items that are strictly smaller than our item k in O(logn) time.
const int maxn = 1000001;
int freq[maxn];
int visited[maxn];
int main() {
    // #ifndef ONLINE_JUDGE
    // freopen("../input.txt", "r", stdin);
    // freopen("../output.txt", "w", stdout);
    // #endif
    srand(chrono::steady_clock::now().time_since_epoch().count());
    off;
    LL n;
    cin>>n;
    VL arr(n);
    rep(i,0,n){
        cin>>arr[i];
        freq[arr[i]]++;
    }    
    sort(ALL(arr));
    LL ans = 0;
    for(int i = 0;i<n;i++){
        if(!visited[arr[i]] && freq[arr[i]] == 1)
            ans++;
        for(int j = 2*arr[i]; j<= arr[n-1]; j += arr[i]){
            visited[j] = 1;
        }
    }
    cout<<ans;
    return 0;
}

Measured memory_bytes: 12636
#include<bits/stdc++.h>
using namespace std;
#define iso ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
typedef long long ll;
typedef unsigned long long ull;
#define pb push_back
#define clr(x,n) memset((x), n, sizeof(x))
#define mod 1000000007
#define MAX 1000005
/*#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
typedef tree<ll ,null_type,less<ll>,rb_tree_tag,tree_order_statistics_node_update> indexed_tree;*/
ll arr[200005];
int main()
{
    iso;
    string st;
    cin>>st;
    int c = 0, ans = 0;
    for(int i = 0; i < 3; i++)
    {
        if(st[i] == 'R')
            c++;
        else
        {
            ans = max(ans,c);
            c = 0;
        }
    }
    ans = max(ans, c);
    cout<<ans;




    return 0;
}



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

const double pi  = 2 * acos(0.0);
const double eps = 1e-8;

#define REP(i,a,b) for(int i=(a); i<(b);++i)
#define rep(i,n) REP(i,0,n)
#define INF (1<<29)
#define INFLL (1LL<<62)

typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;

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

int main(void) {
  ios_base::sync_with_stdio(false); cin.tie(0);
  string a, b, c;
  cin >> a >> b >> c;
  printf("%c%c%c\n", toupper(a[0]), toupper(b[0]), toupper(c[0]));
  return 0; 
}

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 V[] =new int[N+N];
    int x=0;
    for(int i=0;i<2*N;i++){
      if(i<N){V[i]=sc.nextInt();}
      else{V[i]=V[i-N]-sc.nextInt();
           if(V[i]>0){x=x+V[i];}}}
    System.out.println(x);
  }
}

Measured memory_bytes: 21844
#include<iostream>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<algorithm>
#include<cstdio>
#define ll long long
using namespace std;

const int N=100005;
const int M=2005;
const ll inf=1000000000000000000ll;

struct ST{
	int l,r;
	ll mn1,mn2,tag;
}t[N<<2];
int n;
ll e,T,mn;
int f[N];
ll dp[M][M],x[N];

void update(int k){
	t[k].mn1=min(t[k<<1].mn1,t[k<<1|1].mn1);
	t[k].mn2=min(t[k<<1].mn2,t[k<<1|1].mn2);
}

void build(int k,int l,int r){
	t[k].l=l; t[k].r=r;
	t[k].mn1=t[k].mn2=inf; t[k].tag=0;
	if (l==r) return;
	int mid=(l+r)>>1;
	build(k<<1,l,mid);
	build(k<<1|1,mid+1,r);
}

void add(int k,ll w){
	t[k].tag+=w;
	t[k].mn1+=w;
	t[k].mn2+=w;
}

void pushdown(int k){
	if (t[k].tag){
		add(k<<1,t[k].tag);
		add(k<<1|1,t[k].tag);
		t[k].tag=0;
	}
}

void modifys(int k,int L,int R,ll w){
	if (L<=t[k].l&&t[k].r<=R){
		add(k,w);
		return;
	}
	pushdown(k);
	int mid=(t[k].l+t[k].r)>>1;
	if (L<=mid) modifys(k<<1,L,R,w);
	if (R>mid) modifys(k<<1|1,L,R,w);
	update(k);
}

void modifyp(int k,int p,ll w){
	if (t[k].l==t[k].r){
		t[k].mn1=min(t[k].mn1,w);
		t[k].mn2=min(t[k].mn2,w-2ll*x[p]);
		return;
	}
	pushdown(k);
	int mid=(t[k].l+t[k].r)>>1;
	if (p<=mid) modifyp(k<<1,p,w);
	else modifyp(k<<1|1,p,w);
	update(k);
}

ll query1(int k,int L,int R){
	if (L<=t[k].l&&t[k].r<=R) return t[k].mn1;
	pushdown(k);
	int mid=(t[k].l+t[k].r)>>1;
	if (R<=mid) return query1(k<<1,L,R);
	else if (L>mid) return query1(k<<1|1,L,R);
	else return min(query1(k<<1,L,R),query1(k<<1|1,L,R));
}

ll query2(int k,int L,int R){
	if (L<=t[k].l&&t[k].r<=R) return t[k].mn2;
	pushdown(k);
	int mid=(t[k].l+t[k].r)>>1;
	if (R<=mid) return query2(k<<1,L,R);
	else if (L>mid) return query2(k<<1|1,L,R);
	else return min(query2(k<<1,L,R),query2(k<<1|1,L,R));
}

void init(){
	int i,l,r,mid;
	for (i=1;i<=n;i++){
		l=0; r=i-1;
		while (l<r){
			mid=(l+r+1)>>1;
			if (2*(x[i]-x[mid])>=T) l=mid;
			else r=mid-1;
		}
		f[i]=l;
	}
}

void solve1(){
	int i,j;
	for (i=0;i<=n+1;i++)
		for (j=0;j<=n+1;j++) dp[i][j]=inf;
	dp[1][1]=x[1];
	for (i=1;i<=n;i++)
		for (j=1;j<=i;j++) if (dp[i][j]<inf){
			dp[i+1][i+1]=min(dp[i+1][i+1],dp[i][j]+max(2*(x[i]-x[j]),T)+x[i+1]-x[i]);
			dp[i+1][j]=min(dp[i+1][j],dp[i][j]+x[i+1]-x[i]);
		}
	printf("%lld\n",dp[n+1][n+1]);
}

int main(){
	int i,j;
	scanf("%d%lld%lld",&n,&e,&T);
	for (i=1;i<=n;i++) scanf("%lld",&x[i]);
	init();
	x[n+1]=e;
	//if (n<=2000){solve1();return 0;}
	build(1,1,n+1);
	modifyp(1,1,x[1]);
	for (i=1;i<=n;i++){
		mn=query1(1,f[i]+1,i);
		modifyp(1,i+1,mn+T+x[i+1]-x[i]);
		if (f[i]>0){
			mn=query2(1,1,f[i]);
			modifyp(1,i+1,mn+2ll*x[i]+x[i+1]-x[i]);
		}
		modifys(1,1,i,x[i+1]-x[i]);
	}
	printf("%lld\n",query1(1,n+1,n+1));
	return 0;
}

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

int main(){
  while(true){
    int M, T, P, R;
    cin >> M >> T >> P >> R;

    if(M==0 && T==0 && P==0 && R==0)
      break;

    int CP[50], TT[50], PT[50][10];
    for(int i=0; i<T; i++){
      CP[i] = TT[i] = 0;
      for(int j=0; j<P; j++)
	PT[i][j] = 0;
    }

    for(int i=0; i<R; i++){
      int m, t, p, j;
      cin >> m >> t >> p >> j;

      if(j==0){
	CP[t-1]++;
	TT[t-1] += (m+PT[t-1][p-1]);
      }
      else{
	PT[t-1][p-1] += 20;
      }
    }

    int tnow, tpre = -1;
    bool flg[50];
    for(int i=0; i<T; i++)
      flg[i] = false;

    for(int i=0; i<T; i++){
      tnow = -1;
      for(int j=0; j<T; j++){
	if(flg[j])
	  continue;

	if(tnow==-1){
	  tnow = j;
	}
	else{
	  if(CP[j]>CP[tnow] || (CP[j]==CP[tnow] && TT[j]<=TT[tnow])){
	    tnow = j;
	  }
	}
      }

      if(tpre!=-1){
	if(CP[tnow]==CP[tpre] && TT[tnow]==TT[tpre])
	  cout << '=';
	else
	  cout << ',';
      }
      cout << tnow+1;

      flg[tnow] = true;
      tpre = tnow;
    }
    cout << endl;
  }
  return 0;
}



Measured memory_bytes: 3080
import java.io.*;
import java.util.*;
public class Main {
    public static void main(String [] args)throws Exception {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        StringTokenizer st = new StringTokenizer(br.readLine());
        int n = Integer.parseInt(st.nextToken());
        int t = Integer.parseInt(st.nextToken());
        int min[] = new int[n + 1];
        min[0] = Integer.MAX_VALUE/2;
        int max[] = new int[n + 1];
        int array[] = new int[n + 1];
        int netmax = 0;
        ArrayList<Integer>list = new ArrayList<>();
        st = new StringTokenizer(br.readLine());
        for (int i = 1; i <= n; i++) {
            array[i] = Integer.parseInt(st.nextToken());
            if(array[i] < min[i - 1]){
                min[i] = array[i];
                list.add(i);
            }
            else min[i] = min[i - 1];
            max[i] = array[i] - min[i];
            netmax = Math.max(netmax,max[i]);
        }
        list.add(n + 1);
        int ans = 0;
        //System.out.println(list);
        for(int i = 0;i < list.size() - 1;i++){;
            int start = list.get(i);
            int end = list.get(i + 1) - 1;
            int curmin = min[end];
            int cntmin = 0,cntmax = 0;
            while(array[end] == min[end])--end;
            for(int j = start;j <= end;j++){
                if(array[j] == curmin)++cntmin;
                if(max[j] == netmax)++cntmax;
            }
            //System.out.println(start + " " + end + " " + curmin + " " + netmax + " " + cntmin + " " + cntmax);
            ans += Math.min(cntmin,cntmax);
        }
        System.out.println(ans);
    }
}


Measured memory_bytes: 29648
#include<iostream>
#include<string>
using namespace std ;
int main(){
	string s,t ;
  	cin >> s >> t ;
  	if(s[0] == t[2] && s[2] == t[0] && s[1] == t[1])
      cout << "YES\n" ;
  	else
      cout << "NO\n" ;

}

Measured memory_bytes: 256