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

int main()
{
    ll N;
    cin >> N;
    if (N == 1)
    {
        cout << 1 << endl;
        return 0;
    }

    for (int i = 1; i <= N; ++i)
    {
        if (N <= (1 * pow(2, i) - 1))
        {
            cout << (ll)(1 * pow(2, i) - 1) << endl;
            return 0;
        }
    }
}


Measured memory_bytes: 4008
import sys
import math
import itertools
import collections
import heapq
import numpy as np

rl = sys.stdin.readline

n, m = map(int, rl().split())
h = list(map(lambda x: -1*int(x), rl().split()))
heapq.heapify(h)
for _ in range(m):
    heapq.heappushpop(h, math.ceil(h[0]/2))
print(-sum(h))

Measured memory_bytes: 23148
#include <iostream>
#include <algorithm>
#include <cstdio>
#include <vector>
#include <cmath>
#include <iomanip>
#include <bitset>
#include <string>
using namespace std;
//cout <<  << endl;
typedef long long int ll;
typedef long double ld;

int main(){
    ll a,b,c;
    cin >> a >> b >> c;
    cout << min(min(a+b,a+c),min(a+b,b+c)) << endl;
}


Measured memory_bytes: 256
#include <iostream>
#include <set>
#include <map>
#include <cmath>
#include <vector>
#include <string>
#include <algorithm>
#include <iomanip>
#include <queue>
#include <deque>
#include <stack>
#include <climits>
#include <math.h>
#include <cassert>
#include <unordered_map>
using namespace std;
#pragma warning(disable : 4996)
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;




int main() {
#ifdef _DEBUG
	freopen("input1.txt", "r", stdin);
	freopen("output2.txt", "w", stdout);
#endif
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	int n, a, b, c;
	cin >> n >> a >> b >> c;
	vector<char> ans;
	vector<string> q(n);
	for (int i = 0; i < n; i++)cin >> q[i];
	for (int i = 0; i < n; i++) {
		string s;
		s = q[i];
		assert(a >= 0 && b >= 0 && c >= 0);
		if (s == "AB") {
			if (a + b == 0) {
				cout << "No";
				return 0;
			}
			if (a == 1 && b == 1 && c == 0) {
				if (i == n - 1 || q[i + 1][0] == 'A') {
					a++;
					b--;
					ans.push_back('A');
				}
				else {
					a--;
					b++;
					ans.push_back('B');
				}
			}
			else {
				if (a >= b) {
					a--;
					b++;
					ans.push_back('B');
				}
				else {
					a++;
					b--;
					ans.push_back('A');
				}
			}
		}
		if (s == "AC") {
			if (a + c == 0) {
				cout << "No";
				return 0;
			}
			if (a == 1 && c == 1 && b == 0) {
				if (i == n - 1 || q[i + 1][0] == 'A') {
					a++;
					c--;
					ans.push_back('A');
				}
				else {
					a--;
					c++;
					ans.push_back('C');
				}
			}
			else {
				if (a >= c) {
					a--;
					c++;
					ans.push_back('C');
				}
				else {
					a++;
					c--;
					ans.push_back('A');
				}
			}
		}
		if (s == "BC") {
			if (b + c == 0) {
				cout << "No";
				return 0;
			}
			if (b == 1 && c == 1 && a == 0) {
				if (i == n - 1 || q[i + 1] == "AB") {
					b++;
					c--;
					ans.push_back('B');
				}
				else {
					b--;
					c++;
					ans.push_back('C');
				}
			}
			else {
				if (b >= c) {
					b--;
					c++;
					ans.push_back('C');
				}
				else {
					b++;
					c--;
					ans.push_back('B');
				}
			}
		}
	}
	cout << "Yes\n";
	for (auto i : ans)cout << i << "\n";
}

Measured memory_bytes: 6536
#include <stdio.h>

int main(void)
{
	int i,n,x[100];
	scanf("%d",&n);
	for(i=0;i<=n-1;i++)
	{
		scanf("%d",&x[i]);
	}
	for(i=n-1;i>=1;i--)
	{
		printf("%d ",x[i]);
	}
	printf("%d\n",x[0]);
	return 0;
}

Measured memory_bytes: 596
"use strict";
var input=require("fs").readFileSync("/dev/stdin","utf8");
var cin=input.split(/ |\n/),cid=0;
function next(){return +cin[cid++];}
function nextstr(){return cin[cid++];}
function nextbig(){return BigInt(cin[cid++]);}
function nexts(n,a){return a?cin.slice(cid,cid+=n):cin.slice(cid,cid+=n).map(a=>+a);}
function nextm(h,w,a){var r=[],i=0;if(a)for(;i<h;i++)r.push(cin.slice(cid,cid+=w));else for(;i<h;i++)r.push(cin.slice(cid,cid+=w).map(a=>+a));return r;}
function xArray(v){var a=arguments,l=a.length,r="Array(a["+--l+"]).fill().map(x=>{return "+v+";})";while(--l)r="Array(a["+l+"]).fill().map(x=>"+r+")";return eval(r);}

var myOut = main();
if(myOut !== undefined)console.log(String(myOut));

function main(){
  var a = nextstr();
  var ans = 1;
  var c = xArray(0,26);
  for(var i = 0; i < a.length; i++){
    var t = a[i].charCodeAt()-97;
    ans += i-c[t];
    c[t]++;
  }
  return ans;
}

Measured memory_bytes: 32884
#include <iostream>
#include <string.h>
#include <stdio.h>
#include <map>
#include <vector>
#include <math.h>
#include <algorithm>
#include <queue>
#include <set>
#include <tuple>
using namespace std;

#define rep(i,a) for(int i=0; i<a; i++)
#define rrep(i,a) for(int i=a; i>=0; i--)
#define rep1(i,a) for(int i=1; i<=a; i++)
#define cout1(a) cout << a << endl;
#define cout2(a,b) cout << a << " " << b << endl;
#define cout3(a,b,c) cout << a << " " << b << " " << c << endl;
#define cout4(a,b,c,d) cout << a << " " << b << " " << c << " " << d << endl;
#define mem(a,n) memset( a, n, sizeof(a))
#define all(a) a.begin(),a.end()

typedef long long ll;
typedef long double ld;
typedef pair<int,int> pii;
typedef vector<int> V;
typedef vector<V> VV;
typedef vector<VV> VVV;
const int INF = 1e9;
const int MOD = 1e9+7;
const ll LLINF = 1e18;
static const double pi = 3.141592653589793;

vector<pii> G[3*200009];
map<pii,int> sid;
int P[200009], Q[200009], C[200009];
int lastid=0;

int getid(int v, int c){
    pii p(v,c);
    if(sid.find(p)!=sid.end()) return sid[p];
    return sid[p] = lastid++;
}

void addEdge(int p, int q, int c){
    int v=getid(p,c), u=getid(q,c);
    G[v].push_back({u,0});
    G[u].push_back({v,0});
}

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    
    int N, M;
    cin>>N>>M;
    rep(i,M){
        cin>>P[i]>>Q[i]>>C[i];
        P[i]--; Q[i]--;
        addEdge(P[i],Q[i],C[i]);
    }
    
    rep(i,M){
        G[getid(P[i],C[i])].push_back({lastid+P[i],1});
        G[getid(Q[i],C[i])].push_back({lastid+Q[i],1});
        G[lastid+P[i]].push_back({getid(P[i],C[i]),1});
        G[lastid+Q[i]].push_back({getid(Q[i],C[i]),1});
    }
    
    vector<int> d(lastid+N,INF);
    d[lastid] = 0;
    priority_queue<pii> que;
    que.push({0,lastid});
    while(!que.empty()){
        pii p = que.top(); que.pop();
        int u=p.second, dist=-p.first;
        if(dist>d[u]) continue;
        for(auto e:G[u]){
            int v=e.first, c=e.second;
            if(d[v]>d[u]+c){
                d[v]=d[u]+c;
                que.push({-d[v],v});
            }
        }
    }
    
    int ans=d[lastid+N-1];
    if(ans==INF) ans=-1;
    else ans/=2;
    cout1(ans);
}

Measured memory_bytes: 65656
N = int(input())
L = [0] * N
for x in range(1,101):
  for y in range(1,101):
    for z in range(1,101):
      n = int(((x + y) ** 2 + (y + z) ** 2 + (z + x) ** 2)/ 2 )
      if n <= N:
        L[n - 1] += 1
print(*L, sep='\n')


Measured memory_bytes: 74484
def findCost(arr, middle):
    cost = 0
    for i in range(len(arr)):
        cost += (arr[i]-middle)*(arr[i]-middle)
    return cost

def answer(arr):
    middle = sum(arr)//len(arr)
    cost1 = findCost(arr, middle)
    cost2 = findCost(arr, middle+1)
    if cost1 < cost2:
        return cost1
    else:
        return cost2

n = int(input())
arr = list(map(int, input().split()))
print(answer(arr))

Measured memory_bytes: 38384
#include<bits/stdc++.h>
using namespace std;
int main()
{
	long long n,a[301][301]={0},p[301][301]={0},ans=0;
	cin>>n;
	for(int i=1;i<=n;i++)
	{
		for(int j=1;j<=n;j++)
		{
			cin>>a[i][j];
		}
	}
	for(int i=1;i<=n;i++)
	{
		for(int j=1;j<=n;j++)
		{
			for(int z=1;z<=n;z++)
			{
				if(i!=z&&i!=j&&j!=z)
				{
					if(a[j][z]>a[i][z]+a[j][i])
					{
						cout<<"-1";
						return 0;
					}
					if(a[j][z]==a[i][z]+a[j][i])
					{
						p[j][z]=1;
					}
				}	
			}
		}
	}
	for(int i=1;i<=n;i++)
	{
		for(int j=1;j<=n;j++)
		{
			if(p[i][j]==0)
			ans+=a[i][j];
		}
	}
	cout<<ans/2;
	return 0;
} 

Measured memory_bytes: 1664
#include "bits/stdc++.h"
using namespace std;
typedef long long ll;
 int main() {
	 string s, t;
	 cin >> s >> t;
	 sort(s.begin(), s.end());
	 sort(t.begin(), t.end(), greater<char>());
	 if (s < t) cout << "Yes" << endl;
	 else cout << "No" << endl;
}

Measured memory_bytes: 256
import java.util.*;
import java.lang.*;

public class Main{
    
    public static void main(String args[]){
        Scanner sc = new Scanner(System.in);
        
        int n = sc.nextInt();
        double[] x = new double[n];
        double[] y = new double[n];
        
        for (int i = 0; i < n; i++) {
            x[i] = sc.nextDouble();
        }
        for (int i = 0; i < n; i++) {
            y[i] = sc.nextDouble();
        }
        
        double d1 = 0, d2 = 0, d3 = 0, di = 0;
        for (int i = 0; i < n; i++) {
            double k = Math.abs(x[i] - y[i]);
            d1 += k;
            d2 += Math.pow(k, 2);
            d3 += Math.pow(k, 3);
            if (di < k) di = k;
        }
        
        d2 = Math.sqrt(d2);
        d3 = Math.pow(d3, 1.0 / 3.0);
        
        System.out.println(d1);
        System.out.println(d2);
        System.out.println(d3);
        System.out.println(di);
    }
}


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

using namespace std;
int main(void){

    int n;
    cin >> n;
    
    vector<long long> a(200);
    for(int i=0; i<n; i++) {
        cin >> a[i];
    }

    long long result = 0;
    for(;;) {
        for(int i=0; i<n; i++) {
            if(a[i]%2 != 0) {
                cout << result << endl;
                return 0;
            }
            else {
                a[i] /= 2;
            }
        }
        result++;
    }    

    return 0;
    
}


Measured memory_bytes: 256
#include <iostream>
#define Y 2019
using namespace std;
int l, r, a[Y];

void solve()
{
    int ans = Y - 1;
    int ceil = min(Y - 1, r - l);
    for (int i = 0; i <= ceil; i++)
    {
        a[i] = (l + i) % Y;
    }
    for (int i = 0; i < ceil; i++)
    {

        for (int j = i + 1; j <= ceil; j++)
        {
            ans = min(ans, (a[i] * a[j]) % 2019);
        }
    }

    cout << ans << endl;
}

int main()
{
    cin >> l >> r;

    solve();
}


Measured memory_bytes: 256
// At Corder.cpp : このファイルには 'main' 関数が含まれています。プログラム実行の開始と終了がそこで行われます。
//

#include <algorithm>
#include <iostream>
using namespace std;
#include <bits/stdc++.h>
#include <vector>
#include <numeric>
#include <math.h>

#define rep(i,n) for (int i = 0; i < (n); ++i)
using ll = long long;
using p = pair<int, int>;//<key,value>

int main() {
int a,b,c,k;
cin>>a>>b>>c>>k;
int m=a+b;
if(k<=a)
cout<<k<<endl;
if(a<k&&k<=m)
cout<<a<<endl;
if(m<k)
	cout<<a-(k-a-b)<<endl;

  return 0;
}

// プログラムの実行: Ctrl + F5 または [デバッグ] > [デバッグなしで開始] メニュー
// プログラムのデバッグ: F5 または [デバッグ] > [デバッグの開始] メニュー

// 作業を開始するためのヒント:
//    1. ソリューション エクスプローラー ウィンドウを使用してファイルを追加/管理します
//   2. チーム エクスプローラー ウィンドウを使用してソース管理に接続します
//   3. 出力ウィンドウを使用して、ビルド出力とその他のメッセージを表示します
//   4. エラー一覧ウィンドウを使用してエラーを表示します
//   5. [プロジェクト] > [新しい項目の追加] と移動して新しいコード ファイルを作成するか、[プロジェクト] > [既存の項目の追加] と移動して既存のコード ファイルをプロジェクトに追加します
//   6. 後ほどこのプロジェクトを再び開く場合、[ファイル] > [開く] > [プロジェクト] と移動して .sln ファイルを選択します


Measured memory_bytes: 3636
#include<stdio.h>
#define INF 1000000
void warshall_floyd(void);
int min(int,int);
int graph[101][101];
int n,c,d;

int main(void){
  int k,i,j,x,e,a,b;

  while(1){
    scanf("%d %d",&n,&k);
    if(n==0 && k==0)break;

    for(i=0;i<=n;i++)
      for(j=0;j<=n;j++)
	graph[i][j]=(i==j?0:INF);

    for(i=0;i<k;i++){
      scanf("%d",&x);
      
      if(x){
	scanf("%d %d %d",&c,&d,&e);
	if(graph[c][d]>e){
	graph[c][d]=graph[d][c]=e;
	warshall_floyd();
	}
      }
      else{
	scanf("%d %d",&a,&b);
	if(graph[a][b]<INF)printf("%d\n",graph[a][b]);
	else printf("-1\n");
      }
    }
  }
  return 0;
}

void warshall_floyd(void){
  int i,j;
  
  for(i=1;i<=n;i++){
    for(j=1;j<=n;j++){
      graph[i][j]=graph[j][i]=min(graph[i][j],graph[i][c]+graph[c][d]+graph[d][j]);
    }
  }
}

int min(int x,int y){
  return (x<y)?x:y;
}

Measured memory_bytes: 0
#[allow(unused_imports)]
use std::cmp::*;

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()
}

pub trait BinarySearch<T> {
    fn lower_bound(&self, &T) -> usize;
}

impl<T: Ord> BinarySearch<T> for [T] {
    fn lower_bound(&self, x: &T) -> usize {
        let mut low = 0;
        let mut high = self.len();

        while low != high {
            let mid = (low + high) / 2;
            match self[mid].cmp(x) {
                Ordering::Less => {
                    low = mid + 1;
                }
                Ordering::Equal | Ordering::Greater => {
                    high = mid;
                }
            }
        }
        low
    }
}

fn main() {
    let v: Vec<usize> = read_vec();
    let (a, b, q) = (v[0], v[1], v[2]);

    let mut jinjas = vec![0u64; a];
    for i in 0..a {
        jinjas[i] = read();
    }

    let mut teras = vec![0u64; b];
    for i in 0..b {
        teras[i] = read();
    }

    let mut xs = vec![0u64; q];
    for i in 0..q {
        xs[i] = read();
    }
    for x in xs {
        let mut cost: u64 = std::u64::MAX;
        let jinja_idx = jinjas.lower_bound(&x);
        let tera_idx = teras.lower_bound(&x);

        if jinja_idx != a && tera_idx != b {
            cost = max(jinjas[jinja_idx] - x, teras[tera_idx] - x);
        }
        if jinja_idx != 0 && tera_idx != 0 {
            cost = min(
                cost,
                max(x - jinjas[jinja_idx - 1], x - teras[tera_idx - 1]),
            );
        }
        if jinja_idx != 0 && tera_idx != b {
            cost = min(cost, 2 * (x - jinjas[jinja_idx - 1]) + teras[tera_idx] - x);
            cost = min(cost, x - jinjas[jinja_idx - 1] + 2 * (teras[tera_idx] - x));
        }
        if jinja_idx != a && tera_idx != 0 {
            cost = min(cost, 2 * (jinjas[jinja_idx] - x) + x - teras[tera_idx - 1]);
            cost = min(cost, jinjas[jinja_idx] - x + 2 * (x - teras[tera_idx - 1]));
        }

        assert!(cost != std::u64::MAX);
        println!("{}", cost);
    }
}


Measured memory_bytes: 7420
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>

#define REP(i, a, b) for (int i = int(a); i < int(b); i++)
#define dump(val) cerr << __LINE__ << ":\t" << #val << " = " << (val) << endl

using namespace std;

typedef long long int lli;

template<typename T>
vector<T> make_v(size_t a, T b) {
    return vector<T>(a, b);
}

template<typename... Ts>
auto make_v(size_t a, Ts... ts) {
    return vector<decltype(make_v(ts...))>(a, make_v(ts...));
}

int main() {
    string S;
    lli K;
    cin >> S >> K;
    int cnt = 0;
    while (cnt < S.size() && S[cnt] == '1') {
        cnt++;
    }
    if (cnt >= K) {
        cout << 1 << endl;
    } else {
        cout << S[cnt] << endl;
    }
    return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <cstdlib>
#include <vector>
#include <algorithm>
using namespace std;
void call(int n);
int main(){
	int n;
	cin >> n;
	call(n);
}

void call(int n){
	int i = 1;
	while(i <= n){//CHECK_NUM
		if(i % 3 == 0 || i % 10 == 3){
			cout << " " << i;
		}else if( i > 30){
			int tmp = i;
			while(tmp > 10){
				tmp /= 10;
				if(tmp % 10 == 3){
					cout << " " << i;
					break;
				}
			}
		}
		i++;
	}
	cout << endl;
}



Measured memory_bytes: 3092
#include<iostream>
#include<string>
#include<algorithm>
#include<iomanip>
#include<cmath>
#include<cstdio>
#include<map>
#include<queue>
#include<assert.h>
#include<stdio.h>
#include<stack>
#include<cstring>
#include<fstream>
using namespace std;
#define goup(i,a,b) for(int i=a;i<b;i++)
#define Goup(i,a,b) for(int i=a;i<=b;i++)
#define godown(i,a,b) for(int i=a;i>b;i--)
#define Godown(i,a,b) for(int i=a;i>=b;i--)
#define Gohead(i,a,b) for(int i=a;i;i=b)
typedef long long ll;
const int MaxDegree = 0x3f3f3f;
const double Mod = 1e9 + 7;
const double PI = acos(-1);
int n;
int main()
{
	int k;
	string s;
	cin >> k;
	cin >> s;
	int n = s.length();
	if (k >= n)
	{
		cout << s << endl;
	}
	else
	{
		for (int i = 0; i < k; i++)
		{
			cout << s[i];
		}
		cout << "..." << endl;
	}
	return 0;
}

Measured memory_bytes: 3592
#if 0

#endif
#include <iostream>
#include <memory>
#include <vector>
#include <string>
#include <algorithm>
#include <assert.h>
#include <complex>
#include <queue>
#define rep(i,n) for(int i=0, i##_len=(n); i<i##_len; ++i)
using namespace std;
using ll = long long;
int A, B, Q;
int main(void){
    cin.tie(0);
    ios::sync_with_stdio(false);

    cin >> A >> B >> Q;

    ll INF = 90000000000;

    vector<ll> s(A), t(B);
    rep(i, A) {
        cin >> s[i];
    }
    rep(i, B) {
        cin >> t[i];
    }
    rep(q, Q) {
        ll x;
        cin >> x;
        decltype(s)::iterator it = std::lower_bound(s.begin(), s.end(), x);
        ll lbs = INF;

        // cout << x << ", " << *it << ", " << *(it-1) << endl;

        if (it != s.end()) {
            lbs = (*it) - x;
        }
        ll ubs = INF;
        if (it != s.begin()) {
            ubs = x - (*(it-1));
        }

        decltype(t)::iterator itt = std::lower_bound(t.begin(), t.end(), x);
        ll lbt = INF;

        // cout << x << ", " << *itt << ", " << *(itt-1) << endl;

        if (itt != t.end()) {
            lbt = (*itt) - x;
        }


        ll ubt = INF;
        if (itt != t.begin()) {
            ubt = x - (*(itt-1));
        }

        // cout << lbs << ", " << ubs << ", " << lbt << "," << ubt << endl;

        vector<ll> cand;
        cand.push_back(max(lbs, lbt));
        cand.push_back(max(ubs, ubt));
        cand.push_back(ubs + lbt + min(ubs, lbt));
        cand.push_back(lbs + ubt + min(lbs, ubt));

        // cout << ubs + lbt + min(ubs, lbt) << endl;

        decltype(cand)::iterator i = std::min_element(cand.begin(), cand.end());
        cout << *i << endl;
    }

    return 0;
}

Measured memory_bytes: 2944
#include <iostream>
#include <string>
#include <algorithm>
#include <stack>
#include <queue>
#include <map>
#include <set>
#include <cmath>
#include <time.h>
#include <stdio.h>
#include <vector>
#define int long long
#define endre getchar();getchar();return 0
int inf = 1000000000;
using namespace std;
int gcd(int x, int y) {
	if (y == 0)return x;
	return gcd(y, x%y);
}
int lcm(int x, int y) {
	return x / gcd(x, y)*y;
}
int mypow(int x, int y) {
	if (y == 0)return 1;
	if (y % 2)return mypow(x, y - 1)*x;
	else return mypow(x, y / 2)*mypow(x, y / 2);
}
int Max(int x, int y) {
	if (x > y)return x;
	else return y;
}
int Min(int x, int y) {
	if (x < y)return x;
	else return y;
}
int kai(int x) {
	int cnt = 1;
	if (x == 0)return 1;
	cnt = kai(x - 1);
	return x * cnt;
}
int prime(int n) {
	for (int i = 2; i*i <= n; i++) {
		if (n%i == 0)return false;
	}
	return n != 1;
}
void prime_factor(int n) {
	int cnt = 1;
	map<int, int>res;
	int m = n;
	for (int i = 2; i <= n; i++) {
		if (prime(i)) {
			while (m%i == 0) {
				++res[i];
				m /= i;
			}
		}
	}
	cout << n << ":" << endl;
	for (int i = 2; i <= n; i++) {
		if (res[i]) {
			cout << i << " " << res[i] << endl;
		}
	}
	cout << endl;
}
/*Library End!*/
double n, t, a, h, ans, cnt=100000000.;

signed main() {
	cin >> n >> t >> a;
	for (int i = 0; i < n; i++) {
		cin >> h;
		if (cnt > abs(a-(t - h * 0.006))) {
			cnt = abs(a - (t - h * 0.006));
			ans = i + 1;
		}
	}
	cout << ans << endl;
	endre;
}


Measured memory_bytes: 256
import java.util.Scanner;
public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int tmp;
		int[] x;
		x = new int[3];
		x[0] = sc.nextInt();
		x[1] = sc.nextInt();
		x[2] = sc.nextInt();
		
		for(int i=0;i<3;i++){
			for(int j=i+1;j<3;j++){
				if(x[i]>x[j]){
					tmp=x[i];
					x[i]=x[j];
					x[j]=tmp;
				}
			}
		}
		System.out.println(x[0]+" "+x[1]+" "+x[2]);
		sc.close();
	}
}



Measured memory_bytes: 26412
#include<iostream>
#include <cstdint>
using namespace std;
template<int MOD> struct Fp {
    long long val;
    constexpr Fp(long long v = 0) noexcept : val(v % MOD) {
        if (val < 0) val += MOD;
    }
    constexpr int getmod() { return MOD; }
    constexpr Fp operator - () const noexcept {
        return val ? MOD - val : 0;
    }
    constexpr Fp operator + (const Fp& r) const noexcept { return Fp(*this) += r; }
    constexpr Fp operator - (const Fp& r) const noexcept { return Fp(*this) -= r; }
    constexpr Fp operator * (const Fp& r) const noexcept { return Fp(*this) *= r; }
    constexpr Fp operator / (const Fp& r) const noexcept { return Fp(*this) /= r; }
    constexpr Fp& operator += (const Fp& r) noexcept {
        val += r.val;
        if (val >= MOD) val -= MOD;
        return *this;
    }
    constexpr Fp& operator -= (const Fp& r) noexcept {
        val -= r.val;
        if (val < 0) val += MOD;
        return *this;
    }
    constexpr Fp& operator *= (const Fp& r) noexcept {
        val = val * r.val % MOD;
        return *this;
    }
    constexpr Fp& operator /= (const Fp& r) noexcept {
        long long a = r.val, b = MOD, u = 1, v = 0;
        while (b) {
            long long t = a / b;
            a -= t * b; swap(a, b);
            u -= t * v; swap(u, v);
        }
        val = val * u % MOD;
        if (val < 0) val += MOD;
        return *this;
    }
    constexpr bool operator == (const Fp& r) const noexcept {
        return this->val == r.val;
    }
    constexpr bool operator != (const Fp& r) const noexcept {
        return this->val != r.val;
    }
    friend constexpr ostream& operator << (ostream &os, const Fp<MOD>& x) noexcept {
        return os << x.val;
    }
    friend constexpr Fp<MOD> modpow(const Fp<MOD> &a, long long n) noexcept {
        if (n == 0) return 1;
        auto t = modpow(a, n / 2);
        t = t * t;
        if (n & 1) t = t * a;
        return t;
    }
};


const int MOD = 1000000007;
using mint = Fp<MOD>;

long long reppow(long long a,long long n) {
	long long ret = 1;
	for (; n > 0; n >>= 1, a = a * a % MOD) {
		if (n % 2 == 1) {
			ret = ret * a % MOD;
		}
	}
	return ret;
}

int main()
{
    long long n,a,b;
    cin >> n >> a >> b;
    mint all=1,ans=0;
    if(n>2){
        all=reppow(2,n)-1;
        long long x=1,y=1;
        mint acomb=0,bcomb=0;
        for(long long i=0;i<a;i++){
            x*=n-i; x%=MOD;
            y*=a-i; y%=MOD;
        }
        acomb=x*reppow(y,1000000005);
        x=1;y=1;
        for(long long i=0;i<b;i++){
            x*=n-i; x%=MOD;
            y*=b-i; y%=MOD;
        }
        bcomb=x*reppow(y,1000000005);
        ans=all-acomb-bcomb;
    }
    
    cout << ans << endl;
    return 0;
}

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


int main()
{
    int A,B,C;
    cin>>A>>B>>C;
    int s = A % B;
    int m = s;
    while(1){
        if (m == C){
            cout << "YES" << endl;
            break;
        }
              m = (m + A) % B;
        if (m == s){
            cout << "NO" << endl;
            break;
        }
    }
}

Measured memory_bytes: 256
import java.util.Scanner;

public class Main {
    final boolean DEBUG = true;

    void run() {
        Scanner scan = new Scanner(System.in);
        String s = scan.next();
        int w = scan.nextInt();
        for (int i = 0; i < s.length(); i += w)
            System.out.print(s.charAt(i));
        System.out.println();
    }

    void runC() {
        Scanner scan = new Scanner(System.in);
        double n = scan.nextInt();
        double m = scan.nextInt();
        double d = scan.nextInt();
        
        if (d == 0)
            System.out.printf("%.10f\n", (m - 1) / n);
        else
            System.out.printf("%.10f\n", (2 * (m - 1) * (n - d)) / (n * n));
    }

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


Measured memory_bytes: 21844
#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++)
#define all(obj) obj.begin(), obj.end()
#define debug(x) cerr << #x << ":" << x << "\n"
#define vdebug(vec) cerr << #vec << ":"; for (auto e : vec) cerr << e << " "; cout << "\n"
#define YN(f) cout << (f ? "YES" : "NO") << endl
#define Yn(f) cout << (f ? "Yes" : "No") << endl
#define yn(f) cout << (f ? "yes" : "no") << endl
using ll = long long;
using vi = vector<int>;
using vvi = vector<vi>;
using pii = pair<int, int>;

int main () {
	int N; cin >> N;	
	set<int> s; int A;
	bool f = true;
	rep(i, N) {
		cin >> A;
		if (s.count(A)) {
			f = false;
			break;
		} else {
			s.insert(A);
		}
	}
	YN(f);
}

Measured memory_bytes: 9600
#include<iostream>
#include<string>
#include<algorithm>
using namespace std;
int main() {
	int a, b, c, d, e;
	cin >> a >> b >> c;
	cin >> d;
	if (a < b)swap(a, b);
	if (a < c)swap(a, c);
	for (int h = 1; h <= d; h++) {
		a = a * 2;
	}
	cout << a + b + c << "\n";
	cin >> e;
}

Measured memory_bytes: 256
def input_int_list():
    return [int(thing) for thing in input().split(" ")]

A,B,M=input_int_list()
a_list=input_int_list()
b_list=input_int_list()
discounts=[input_int_list() for i in range(M)]

min_without_discount=min(a_list)+min(b_list)

set_price_with_discount=[a_list[di[0]-1]+b_list[di[1]-1]-di[2] for di in discounts]
min_discounted=min(set_price_with_discount)
print(min(min_discounted,min_without_discount))

Measured memory_bytes: 36464
//{
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef double lf;
typedef pair<ll,ll> ii;
#define REP(i,n) for(ll i=0;i<n;i++)
#define REP1(i,n) for(ll i=1;i<=n;i++)
#define FILL(i,n) memset(i,n,sizeof i)
#define X first
#define Y second
#define SZ(_a) (int)_a.size()
#define ALL(_a) _a.begin(),_a.end()
#define pb push_back
#ifdef brian
#define debug(...) do{\
    fprintf(stderr,"%s - %d (%s) = ",__PRETTY_FUNCTION__,__LINE__,#__VA_ARGS__);\
    _do(__VA_ARGS__);\
}while(0)
template<typename T>void _do(T &&_x){cerr<<_x<<endl;}
template<typename T,typename ...S> void _do(T &&_x,S &&..._t){cerr<<_x<<" ,";_do(_t...);}
template<typename _a,typename _b> ostream& operator << (ostream &_s,const pair<_a,_b> &_p){return _s<<"("<<_p.X<<","<<_p.Y<<")";}
template<typename It> ostream& _OUTC(ostream &_s,It _ita,It _itb)
{
    _s<<"{";
    for(It _it=_ita;_it!=_itb;_it++)
    {
        _s<<(_it==_ita?"":",")<<*_it;
    }
    _s<<"}";
    return _s;
}
template<typename _a> ostream &operator << (ostream &_s,vector<_a> &_c){return _OUTC(_s,ALL(_c));}
template<typename _a> ostream &operator << (ostream &_s,set<_a> &_c){return _OUTC(_s,ALL(_c));}
template<typename _a,typename _b> ostream &operator << (ostream &_s,map<_a,_b> &_c){return _OUTC(_s,ALL(_c));}
template<typename _t> void pary(_t _a,_t _b){_OUTC(cerr,_a,_b);cerr<<endl;}
#define IOS()
#else
#define debug(...)
#define pary(...)
#define endl '\n'
#define IOS() ios_base::sync_with_stdio(0);cin.tie(0);
#endif // brian
//}


const ll MAXn=1e5+5,MAXlg=__lg(MAXn)+2;
const ll MOD=1000000007;
const ll INF=ll(1e15);

int main()
{
    IOS();
    ll n;
    cin>>n;
    cout<<n/3<<endl;
}


Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <queue>
#include <unordered_map>
#include <map>
#include <string>
#include <iomanip>
#include <cmath>
#include <cstring>
#include <algorithm> 
#include <ctime>

#define MaxN 100005
#define INF 2140000000

using namespace std;

long long N,delta,base,Ans=0,S[MaxN],aux;
int main()
{
	cin>>N>>delta>>base;
	delta-=base;
	for(int i=1;i<=N;i++)
		cin>>S[i];
	long long lw=0,hi=INF,mid;
	while(lw<=hi)
	{
		aux=0;
		mid=(hi+lw)>>1;
		for(int i=1;i<=N;i++)
		{
			long long plus=(S[i]-base*mid)/delta+(long long)((S[i]-base*mid)%delta!=0);
			if(S[i]-base*mid<0)plus=0;
			aux+=max(0LL,plus);
		}
		if(aux>mid)
			lw=mid+1;
		else hi=mid-1,Ans=mid;
	}
	cout<<Ans;
	return 0;
}

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

int main()
{
  std::string n;
  
  std::cin >> n;

  if (n[0] == '9' || n[1] == '9') {
    std::cout << "Yes" << std::endl;
  } else {
    std::cout << "No" << std::endl;
  }

  return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef pair<ll,ll> mp;
ll inf =  1e9;


int main(){
 ll a,b,c;
 string s,t;
cin>>s;
if(s[0]=='7' || s[1] =='7' || s[2] =='7' ){
 cout<<"Yes"<<endl;
}else{
 cout<<"No"<<endl;
}
    return 0;
}


Measured memory_bytes: 3620
using System;
using System.Linq;

class C
{
	static void Main()
	{
		var h = Console.ReadLine().Split().Select(int.Parse).ToArray();
		var n = h[0];
		var s = new int[h[1]].Select(_ => Console.ReadLine().Split()).ToArray();

		var gs = s.GroupBy(x => x[0], x => x[1]).Select(g => g.ToArray()).ToArray();
		Console.WriteLine($"{gs.Count(g => g.Contains("AC"))} {gs.Where(g => g.Contains("AC")).Sum(g => g.TakeWhile(x => x == "WA").Count())}");
	}
}


Measured memory_bytes: 48688
N = int(input())
A = list(map(int,input().split()))
ans = [0]*(10**6+1)
mul = set()
for i in range(N):
	if ans[A[i]] == 0:
		ans[A[i]] = 1
		p = A[i]*2
		while p <= 10**6:
			ans[p] = -1
			p += A[i]
	elif ans[A[i]] == 1:
		ans[A[i]] = 2

q = 0	
for i in range(10**6+1):
	if ans[i] == 1:
		q += 1
print(q)


Measured memory_bytes: 104132
#include<iostream>
#include<algorithm>
#include<vector>
#include<string>
#include<map>
#include<set>
#include<queue>
#include<stack>
using namespace std;

#define rp(i,n) for(int i=0;i<n;i++)
#define rep(i,m,n) for(int i=m;i<=n;i++)
#define llrp(i,n) for(long long i=0;i<n;i++)
#define llrep(i,m,n) for(long long i=m;i<=n;i++)
#define sort(a) sort(a.begin(),a.end())
#define reverse(a) reverse(a.begin(),a.end())
#define pb push_back
#define elif else if
#define vcin(a); rp(i,a.size()){cin>>a[i];}
#define vcout(a); rp(i,a.size()){cout<<a[i]<<endl;}
#define allchar(c) for(char c='a';c<='z';c++)

typedef vector<int> vi;
typedef vector<long long> vll;
typedef vector<string> vs;
typedef vector<char> vc;
typedef vector<bool> vb;
typedef long long ll;
typedef string S;
typedef pair<int,int> P;

const int mod=1e9+7;

ll modpow(ll a,ll b,ll p){
    if(b==0){
        return 1;
    }elif(b%2==0){
        return modpow((a*a)%p,b/2,p);
    }else{
        return (a*modpow(a,b-1,p))%p;
    }
}

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    S s,t;
    cin >> s >> t;
    vc f1(26),f2(26);
    vb sapp(26),tapp(26);
    allchar(c){
        f1[c-'a']=c;
        f2[c-'a']=c;
    }

    rp(i,s.size()){
        f1[s.at(i)-'a']=t.at(i);
        f2[t.at(i)-'a']=s.at(i);
    }
    rp(i,s.size()){
        if(t.at(i)!=f1[s.at(i)-'a']){
            cout << "No" << endl;
            return 0;
        }
        if(s.at(i)!=f2[t.at(i)-'a']){
            cout << "No" << endl;
            return 0;
        }
    
    }
    cout << "Yes" << endl;
    return 0;
}

Measured memory_bytes: 916
from sys import stdin
import math

n = int(stdin.readline().rstrip())

d = {}
max = 0
for i in range(n):
    s = stdin.readline().rstrip()
    if s in d.keys():
        d[s] += 1
    else:
        d[s] = 1
    if max < d[s]:
        max = d[s]

result = []
for key, value in d.items():
    if value == max:
        result.append(key)

result.sort()

for i in range(len(result)):
    print(result[i])

Measured memory_bytes: 32092
#include <bits/stdc++.h>
using namespace std;
#define REP(i,a) for(int i = 0; i < (a); i++)
#define ALL(a) (a).begin(),(a).end()
typedef long long ll;
typedef pair<int, int> P;
const int INF = 1e9;
const int MOD = 1e9 + 7;

signed main(){
    int n;
    cin >> n;
    ll a[n];
    REP(i,n){
        cin >> a[i];
    }
    if(a[0] != 0){
        cout << -1 << endl;
        return 0;
    }
    ll ans = a[n - 1];
    for(int i = n - 2; i >= 0; i--){
        if(a[i + 1] - a[i] > 1){
            cout << -1 << endl;
            return 0;
        }else if(a[i + 1] - a[i] == 1){
            continue;
        }else{
            ans += a[i];
        }
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 1792
#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){
  string s; cin >> s;

  bool level = false;
  rep(i,s.size()-1){
    if(s[i] == s[i+1]) level = true;
  }

  if(level) cout << "Bad" << endl;
  else cout << "Good" << endl;
  
  return 0;
}


Measured memory_bytes: 3620
def abc(n,i):
    if i==1:
        return 0
    while not n%i:
        n=n//i
    return not (n-1)%i
n=int(input())
e={}
for i in range(1,int(pow(n,0.5))+1):
    if not n%i:
        if abc(n,i):
            e[i]=0
        if abc(n,n//i):
            e[n//i]=0
n-=1

c=0
for i in range(1,int(pow(n,0.5))+1):
    if not n%i:
        c+=1
        if i!=n//i:
            c+=1
print(len(e)+c-1)


Measured memory_bytes: 3188
#include <algorithm>
#include <cstdio>
#include <iostream>
#include <cfloat>
#include <climits>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <queue>
#include <sstream>
#include <stack>
#include <time.h>
#include <vector>
#include <complex>
#include <map>
#include <set>
#include <iomanip>
#include <math.h>
#include <stdlib.h>
#include <list>
#include <utility>
#include <memory>
#include <cstring>
#include <fstream>
#include <numeric>
#include <assert.h>
#include <bitset>
#include <ios> 
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int n;
ll awsl[200004],a[200004],dp[200004],MOD=1e9+7;
int main(){
	cin>>n;
	for (int i=1;i<=n;i++){
		cin>>a[i];
		if (a[i]==a[i-1]) i--,n--;
	}
	dp[0]=1;
	for (int i=1;i<=n;i++){
		dp[i]=dp[i-1];
		dp[i]=(dp[i]+awsl[a[i]])%MOD;
		awsl[a[i]]=(awsl[a[i]]+dp[i-1])%MOD;
	}
	cout<<dp[n];
}

Measured memory_bytes: 4992
#include <iostream>
#include <numeric>
#include <vector>

using namespace std;

void solve(int N, int K, const vector<long long>& scores)
{
	vector<long long> sums(N + 1);
	sums[0] = 0;
	partial_sum(scores.begin(), scores.end(), sums.begin() + 1);
	long long  next = 0;
	long long prev = sums[K] - sums[0];
	for(int start = K + 1; start <= N; start++) {
		//cout << sums[start] << endl << sums[start - K] << endl;
		next = sums[start] - sums[start - K];
		//cout << "next " << next << endl;
		if(prev < next)
			cout << "Yes" << endl;
		else
			cout << "No" << endl;
		prev = next;
	}
}

int main()
{
	int N;
	int K;
	cin >> N >> K;
	vector<long long> scores(N);
	for(int i = 0; i < N; i++) {
		cin >> scores[i];
	}
	solve(N, K, scores);
	return 0;
}


Measured memory_bytes: 6408
#include <bits/stdc++.h>
using namespace std;
long long x,sum,cnt;
int main(){
	cin >> x;
	while(x--){
		long long t;
		cin >> t;
		sum += t;
		cnt += t * t;
	}
	cout << ((sum * sum - cnt) >> 1) << endl;
	return 0;	
}

Measured memory_bytes: 256
#include<stdio.h>
const int MOD=10000;
long long dp[110][4][4];
int plan[110];

int main(void){
    int n,k;
    int i,j,l,m,x,y;
    int in1,in2;
    int ans;

    scanf("%d%d",&n,&k);
    for(i=0;i<k;i++){
	scanf("%d%d",&in1,&in2);
	plan[in1]=in2;	
    }

    for(j=1;j<=3;j++) for(k=1;k<=3;k++){
	dp[n-1][j][k]=1;
    }
    if(plan[n]>0){
	for(j=1;j<=3;j++) for(k=1;k<=3;k++){
	    if(plan[n]!=k) dp[n-1][j][k]=0;
	}
    }
    if(plan[n-1]>0){
	for(j=1;j<=3;j++) for(k=1;k<=3;k++){
	    if(plan[n-1]!=j) dp[n-1][j][k]=0;
	}
    }

/*
    for(j=1;j<=3;j++) for(k=1;k<=3;k++){
	printf("dp[%d][%d][%d]=%d\n",n-1,j,k,dp[n-1][j][k]);
    }
*/

    for(i=n-2;i>=1;i--) for(j=1;j<=3;j++) for(k=1;k<=3;k++)
	for(l=1;l<=3;l++) for(m=1;m<=3;m++) {
	    if(k==l && !(j==k && k==m)){
		dp[i][j][k]=(dp[i][j][k]+dp[i+1][l][m])%MOD;
	    }

	    if(plan[i]>0){
		for(x=1;x<=3;x++) for(y=1;y<=3;y++){
		    if(plan[i]!=x) dp[i][x][y]=0;
		}
	    }
	}

/*
    printf("----------------------------\n");
    for(i=n-1;i>=1;i--) for(j=1;j<=3;j++) for(k=1;k<=3;k++){
	printf("dp[%d][%d][%d]=%d\n",i,j,k,dp[i][j][k]);
    }
*/

    ans=0;
    for(j=1;j<=3;j++) for(k=1;k<=3;k++){
	ans=(ans+dp[1][j][k])%MOD;
    }
    printf("%d\n",ans);
    
    return 0;
}

Measured memory_bytes: 608
#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
int main()
{
     ll a,b,c,d;
  cin>>a>>b>>c>>d;
 
 while(a>0 && c>0)
 {
     c-=b;
     a-=d;
 }
 if(c<=0)
  cout<<"Yes";
  else
  cout<<"No";

    return 0;
}

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

#define pb         push_back

typedef long long ll;
const ll INF = 1000000000000000000ll;
const ll MOD = 1000000007ll;
const double EPS = 1e-8;

int main(void) {
    //ios_base::sync_with_stdio(false);
    //cin.tie(0);
    
    string s;
    cin >> s;

    for(int i=0; i<s.size()-8; i++){
        cout << s[i];
    }
    puts("");
    
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rrep(i, n) for(int i = n-1; i >= 0; i--)
#define  all(x) (x).begin(),(x).end()     // 昇順ソート
#define  rall(v) (v).rbegin(), (v).rend() // 降順ソート
#define  FastIO ios_base::sync_with_stdio(0),cin.tie(0),cout.tie(0)
#define sz(x) ((int)(x).size())
typedef long long ll;
using P = pair<int,int>;
using VI = vector<int>;
using VVI = vector<vector<int>>;
using VL = vector<ll>;
using VVL = vector<vector<ll>>;
using VP = vector<P>;
template<typename T> void view(T e){std::cout << e << std::endl;}
template<class T> bool chmax(T &a, const T &b) { if (a<b) { a=b; return true; } return false; }
template<class T> bool chmin(T &a, const T &b) { if (a>b) { a=b; return true; } return false; }

const int inf = 1 << 30;
const ll INF = 1LL << 60;

int main(){
    ll a, b, x;
    cin >> a >> b >> x;
    ll bCnt = b / x;
    ll aCnt = a / x;
    ll ans = bCnt - aCnt;
    if (a % x == 0) ans++;
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 3636
#include <iostream>
#include <vector>
#include <string>

using namespace std;

class cdice{
private:
  int dice[6];
public:
  void set( int i, int x);
  int get( int i);
  void change(char c);
  void show();
};

void cdice::show(){
  for( int i = 0; i < 6 ; ++i){
    cout << dice[i] << endl;
  }
}

void cdice::set( int i, int x){
  dice[i-1] = x;
}

int cdice::get( int i ){
  return dice[i-1];
}

void cdice::change( char c){
  int temp[6];
  for( int i = 0; i < 6; ++i){
    temp[i] = dice[i];
  }
  if( c == 'S'){
    dice[0] = temp[4];
    dice[1] = temp[0];
    dice[5] = temp[1];
    dice[4] = temp[5];
  }

  if(c == 'N'){
    dice[0] = temp[1];
    dice[1] = temp[5];
    dice[5] = temp[4];
    dice[4] = temp[0];
  }

  if( c == 'W'){
    dice[0] = temp[2];
    dice[2] = temp[5];
    dice[5] = temp[3];
    dice[3] = temp[0];
  }

  if( c == 'E'){
    dice[0] = temp[3];
    dice[3] = temp[5];
    dice[5] = temp[2];
    dice[2] = temp[0];
  }
}


int main(){
  cdice d;
  int temp;
  string str;

  for( int j = 0; j < 6; ++j){
    cin >> temp;
    d.set( j+1, temp);
  }

  cin >> str;
  for( int i = 0; i < str.size(); ++i){
    d.change( str[i]);
  }

  cout << d.get(1) << endl;;
}

Measured memory_bytes: 3132
#include<bits/stdc++.h>
using namespace std;
#define lli long long int
#define nl "\n";
#define fastio ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0)
#define db double
#define mod 1e9 + 7
#define lb lower_bound
#define ub upper_bound
#define vlli vector<lli>
#define mslli multiset<lli>
#define inf INT_MAX
#define sp " "
#define pb push_back
#define pie 3.14159265358979323846
#define test lli t; cin>>t; while(t--)
int main()
{
    /*#ifndef ONLINE_JUDGE
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#endif

	ios_base::sync_with_stdio(false);
	cin.tie(NULL);*/
	//fastio;
    string s;
    cin>>s;
    lli c=0,ans=0;
    for(lli i=0;i<3;i++)
    {
        if(s[i]=='R')
        {
            lli j=i,c=0;
            while(s[j]=='R')
            {
                c++;
                j++;
            }
            i=j-1;
            ans=max(ans,c);
        }
    }
    cout<<ans;
}


Measured memory_bytes: 3588
N, K = map(int, input().split())
ans = 0
num = 0

if K % 2 != 0:
    tmp = N // K
    ans = tmp ** 3
else:
    tmp1, tmp2 = 0, 0
    for i in range(1, N+1):
        if i % K == 0:
            tmp1 += 1
        elif i % (K//2) == 0:
            tmp2 += 1
    ans = tmp1 ** 3 + tmp2 ** 3
print(ans)


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

using namespace std;
const int maxn =  1e6 + 10;
#define ll long long
#define ios std::ios::sync_with_stdio(false)
const ll INF(0x3f3f3f3f3f3f3f3fll);
const int inf(0x3f3f3f3f);
/*


ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}
ll lcm(ll a,ll b){return a*b/gcd(a,b);}
ll pow_mod(ll x,ll n,ll mod){ll res=1;while(n){if(n&1)res=res*x%mod;x=x*x%mod;n>>=1;}return res;}//xµÄn´Î·½mod


ll mult(ll a,ll b,ll p){a%=p;b%=p;ll r=0,v=a;while(b){if(b&1){r+=v;if(r>p)r-=p;}v<<=1;if(v>p)v-=p;b>>=1;}return r;}
ll quick_pow(ll a,ll b,ll p){ll r=1,v=a%p;while(b){if(b&1)r=mult(r,v,p);v=mult(v,v,p);b>>=1;}return r;}
bool CH(ll a,ll n,ll x,ll t)
{ll r=quick_pow(a,x,n);ll z=r;for(ll i=1;i<=t;i++){r=mult(r,r,n);if(r==1&&z!=1&&z!=n-1)return true;z=r;}return r!=1;}
bool Miller_Rabin(ll n)
{if(n<2)return false;if(n==2)return true;if(!(n&1))return false;ll x=n-1,t=0;while(!(x&1)){x>>=1;t++;}srand(time(NULL));
ll o=8;for(ll i=0;i<o;i++){ll a=rand()%(n-1)+1;if(CH(a,n,x,t))return false;}return true;}


*/

#define int long long
#define sc(t) scanf("%lld",&t)
#define pr(ans) printf("%lld\n",ans)
ll pow_mod(ll x,ll n,ll mod){ll res=1;while(n){if(n&1)res=res*x%mod;x=x*x%mod;n>>=1;}return res;}//xµÄn´Î·½mod
template<typename T>void read(T &res){bool flag=false;char ch;while(!isdigit(ch=getchar()))(ch=='-')&&(flag=true);
for(res=ch-48;isdigit(ch=getchar());res=(res<<1)+(res<<3)+ch - 48);flag&&(res=-res);}
typedef unsigned long long ULL;

int gcd(int a,int b){return !b?a:gcd(b,a%b);}
int lcm(int a,int b){return a/gcd(a,b)*b;}
#define debug(x) cout << #x << " : " << x << '\n';
#define sb cout << "sb\n" << '\n';
#define fi first
#define se second
#define pb(a) push_back(a)
#define cn cout << '\n'



signed main()
{
    ios;
    cin.tie(0);///

    string str;
    cin >> str;
    if(str == "ABC"){
        cout << "ARC";
        cn;
    }
    else{
        cout << "ABC" ;
        cn;
    }
    return 0;
}
/*
1
1025
*/


Measured memory_bytes: 3592
N, M = map(int, input().split())
AB = [tuple(map(int, input().split())) for _ in range(M)]
class UnionFind():
    def __init__(self, n):
        self.n = n
        self.parents = [-1] * n
        
    def find(self, x):
        if self.parents[x] < 0:
            return x
        else:
            self.parents[x] = self.find(self.parents[x])
            return self.parents[x]
    
    def union(self, x, y):
        x = self.find(x)
        y = self.find(y)
        
        if x == y:
            return
        
        if self.parents[x] > self.parents[y]:
            x, y = y, x
        
        self.parents[x] += self.parents[y]
        self.parents[y] = x
    
    def size(self, x):
        return -self.parents[self.find(x)]
        
    def same(self, x, y):
        return self.find(x) == self.find(y)
    
    def members(self, x):
        root = self.find(x)
        return [i for i in range(self.n) if self.find(i) == root]
    
    def roots(self):
        return [i for i, x in enumerate(self.parents) if x < 0]

    def group_count(self):
        return len(self.roots())
    
    def all_group_members(self):
        return {r: self.members(r) for r in self.roots()}
    
    def __str__(self):
        return '\n'.join('{}: {}'.format(r, self.members(r)) for r in self.roots())


uf = UnionFind(N+1)
for ab in AB:
    h1 = ab[0]
    h2 = ab[1]
    uf.union(h1, h2)

ans = 0
for i in range(1, N+1):
    ans = max(ans, uf.size(i))
print(ans)

Measured memory_bytes: 37840
/**
 * code generated by JHelper
 * More info: https://github.com/AlexeyDmitriev/JHelper
 * @author aajisaka
 */

#include<bits/stdc++.h>

using namespace std;

void debug_out() { cerr << endl; }
template <typename Head, typename... Tail>
void debug_out(Head H, Tail... T) {
  cerr << " " << to_string(H);
  debug_out(T...);
}
#ifdef LOCAL
#define debug(...) cerr << "[" << #__VA_ARGS__ << "]:", debug_out(__VA_ARGS__)
#else
#define debug(...) 42
#endif

#define SPEED ios_base::sync_with_stdio(false);cin.tie(nullptr)
#define rep(i,n) for(int i=0; i<(int)(n); i++)
#define all(v) v.begin(), v.end()
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }

using ll = long long;
using ull = unsigned long long;
using P = pair<ll, ll>;

constexpr long double PI = 3.14159265358979323846264338327950288L;
mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count());

class AAirConditioner {
public:
    void solve(istream& cin, ostream& cout) {
      SPEED;
      int x; cin >> x;
      if (x >= 30) {
        cout << "Yes" << endl;
      } else {
        cout << "No" << endl;
      }
    }
};

signed main() {
  AAirConditioner solver;
  std::istream& in(std::cin);
  std::ostream& out(std::cout);
  solver.solve(in, out);
  return 0;
}

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

using namespace std;

int main() {
  int H, W; cin >> H >> W;

  string s[H];
  for (int i = 0; i < H; i++) {
    cin >> s[i];
  }


  int ans[H][W] = {};
  for (int i = 0; i < H; i++) {
    for (int j = 0; j < W; j++) {
      
      if(s[i][j] == '#'){
        ans[i][j] = -1;
        continue;
      }
      int t = 0;
      for (int k = -1; k < 2; k++) {
        for (int l = -1; l < 2; l++) {
          if(i+k<0 || H<=i+k || j+l<0 || W<=j+l) continue;
          if(k==0 && l==0) continue;
          if(s[i+k][j+l] == '#')t++;
        }
      }
      ans[i][j] = t;

    }
  }

  for (int i = 0; i < H; i++) {
    for (int j = 0; j < W; j++) {
      if(ans[i][j] == -1) cout << "#";
      else cout << ans[i][j];
    }
    cout << endl;
  }

}


Measured memory_bytes: 256
#include <iostream>

using namespace std;
typedef long long ll;
#define rep(i,n) for(int i=0;i<n;i++)
 
int N;
ll K;
ll A[100001];
int cnt[64];

ll f(ll x) {
    ll y = 0;
    rep(i, N) {
        y += A[i] ^ x;
    }
    return y;
}

int main() {
    cin >> N >> K;
    rep(i, N) {
        cin >> A[i];
    }
    rep(i, N) {
        rep(j, 64) {
            cnt[j] += (A[i] >> j) & 1;
        }
    }
    ll argmax = 0;
    for (int j = 62; j >= 0; j --) {
        if (2 * cnt[j] < N && argmax + (1ll << j) <= K) {
            argmax += 1ll << j;
        }
    }
    cout << f(argmax) << endl;
    return 0;
}

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

using namespace std;

int main() {
    int a, b, c;
    cin >> a >> b >> c;
    
    int five = 0, seven = 0;
    if(a == 5)
    {
        five ++;
    }else if(a == 7){
        seven ++;
    }
    if(b == 5)
    {
        five ++;
    }else if(b == 7){
        seven ++;
    }
    if(c == 5)
    {
        five ++;
    }else if(c == 7){
        seven ++;
    }

    if(five == 2 && seven == 1){
        cout << "YES" << endl;
    }else{
        cout << "NO" <<endl;
    }
    return 0;
}


Measured memory_bytes: 256
#include<iostream>
#include<string>
#include<algorithm>
using namespace std;
int main(){
	int n,a;
	cin>>n>>a;
	if(n%500==0){
		cout<<"Yes"<<endl;
	}
	
	else if(n%500!=0 && (n%500)<a){
		cout<<"Yes"<<endl;
	}
	
	else cout<<"No"<<endl;
}

Measured memory_bytes: 256
#include <iostream>

int main()
{
    int n,m;
    std::cin>>n>>m;
    int A[100][100]={{}};
    int b[100]={};
    int hoge;
    int c = 0;
    for(int i = 0; i < n; i++)
    {
        for(int j = 0; j < m; j++)
        {
        std::cin>>A[i][j];
        }
    }

    for(int i = 0; i < m; i++)
    {
        std::cin>>b[i];
    }

    for(int i = 0; i < n; i++)
    {
        for(int j = 0; j < m; j++)
        {
            c+= A[i][j] * b[j];
        }
        std::cout<<c<<std::endl;
        c=0;
    }


    return 0;
}



Measured memory_bytes: 3140