akhauriyash/Code-Regression huggingface dataset:
#include<bits/stdc++.h>
using namespace std;
 
int main()
{
 int L;
  cin>>L;
  if(L%3==0)
  {
    cout<<L/3*L/3*L/3;
  }
  else
  {
   double p=(double)L/3;
   cout<<setprecision(12)<<fixed<<p*p*p<<endl;
  }
  return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<string>
#include<sstream>
#include<cctype>
#include<cstdlib>
#include<map>
#include<vector>
#include<complex>
#include<queue>
#include<set>
using namespace std;
#define REP(i, j) for(int i = 0; i < j; i++)
#define FOR(i, j, k) for(int i = j; i < k; i++)
#define P pair<int, int>
#define Y first
#define X second
const int INF = 100000000;


class C{
    public:
        int y, x, step;
        C(int _y, int _x, int _step){
            y = _y;
            x = _x;
            step = _step;
        }
};

int dfs(int now, int sum, int cnt, int goal, vector<bool> visited, vector< vector<int> > &v){
    if(cnt == goal) return sum;
    int ret = INF;
    REP(i, v.size()){
        if(!visited[i]){
            visited[i] = true;
            ret = min(ret, dfs(i, sum + v[now][i], cnt + 1, goal, visited, v));
            visited[i] = false;
        }
    }
    return ret;
}




int main(){
    int h, w;
    while(cin >>w >>h && h){
        int cnt = 0, firy, firx;
        vector< vector<char> > v(h, vector<char>(w));
        vector<P> node;
        REP(i, h){
            REP(j, w){
                cin >>v[i][j];
                if(v[i][j] == 'o') node.push_back( P(i, j) );
                if(v[i][j] == '*') cnt++;
            }
        }
        REP(i, h) REP(j, w) if(v[i][j] == '*') node.push_back( P(i, j) );
        vector< vector<int> > d(cnt + 1, vector<int>(cnt + 1, 0));
        //debug
        //cout <<cnt <<endl;
        //REP(i, h){
        //    REP(j, w){
        //        cout <<v[i][j] <<" ";
        //    }
        //    cout <<endl;
        //}
        REP(z, node.size()){
            queue<C> open;
            open.push( C(node[z].Y, node[z].X, 0) );
            vector< vector<int> > closed(h, vector<int>(w, INF));
            while(!open.empty()){
                C now = open.front();
                open.pop();

                if(now.step >= closed[now.y][now.x]) continue;
                closed[now.y][now.x] = now.step;

                int my[] = {0, 0, 1, -1};
                int mx[] = {1, -1, 0, 0};

                REP(i, 4){
                    int ny = now.y + my[i];
                    int nx = now.x + mx[i];
                    if(ny < 0 || nx < 0 || ny >= h || nx >= w || v[ny][nx] == 'x') continue;
                    open.push( C(ny, nx, now.step + 1) );
                }
            }
            REP(i, node.size()) d[z][i] = closed[node[i].Y][node[i].X];
        }
        //debug
        //REP(i, d.size()){
        //    REP(j, d[i].size()){
        //        cout <<d[i][j] <<" ";
        //    }
        //    cout <<endl;
        //}
        vector<bool> tmp(node.size(), false);
        tmp[0] = true;
        int ans = dfs(0, 0, 0, cnt, tmp, d);
        cout <<(ans == INF? -1 : ans) <<endl;
    }
    return 0;
}

Measured memory_bytes: 1236
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define all(v) v.begin(), v.end()
int main() {
  long long int H; cin >> H;
  long long int HP = H;
  long long int enemy = 1;
  long long int attack = 1;
  while(!(HP/2 == 0)){
    HP /= 2;
    enemy *= 2;
    attack += enemy;
  }
  cout << attack << endl;
  return 0;
}


Measured memory_bytes: 256
program palindrome_phobia
  implicit none
  character(100000) :: s
  integer :: n, i, m(3)
  read(*,*) s
  s = trim(adjustl(s))
  n = len_trim(s)
  m = 0
  do i = 1, n
    m(ichar(s(i:i))-96) = m(ichar(s(i:i))-96)+1
  end do
  if (maxval(m)-minval(m).le.1) then
    write(*,'(a)') "YES"
  else
    write(*,'(a)') "NO"
  end if
  stop
end program palindrome_phobia

Measured memory_bytes: 700
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include<math.h>
int n,m;
int ans[100001];
int tmp[100001];
int scan_tmp[100001];
int scan_tmp2[100001];
int main(void)
{
  scanf("%d%d",&n,&m);
  for(int i=0;i<=n;i++){
    ans[i]=0;
    tmp[i]=0;
    scan_tmp[i]=0;
    scan_tmp2[i]=0;
  }
  
  int a[m+1],b[m+1];
  for(int i=0;i<m;i++){
    scanf("%d%d",&a[i],&b[i]);
    scan_tmp[a[i]]++;
    scan_tmp[b[i]]++;
  }

  int **class;
  class=malloc(sizeof(int *)*(n+2));
  for(int i=1;i<=n+1;i++){
    class[i]=(int *)malloc(sizeof(int *)*(scan_tmp[i]+1));
  }
  for(int j=0;j<m;j++){
    scan_tmp2[a[j]]++;
    scan_tmp2[b[j]]++;
    class[a[j]][scan_tmp2[a[j]]]=b[j];
    class[b[j]][scan_tmp2[b[j]]]=a[j];
  }
  
  tmp[1]=1;
  int tmp_new[n],start=0,end=0,s=0,e=0;
  tmp_new[0]=1;
  while(1){
    for(int i=start;i<=end;i++){
      for(int j=1;j<=scan_tmp[tmp_new[i]];j++){
        if(tmp[class[tmp_new[i]][j]]==0){
          ans[class[tmp_new[i]][j]]=tmp_new[i];
          tmp[class[tmp_new[i]][j]]=1;
          tmp_new[e+1]=class[tmp_new[i]][j];
          e++;
        }
      }
    }
    if(e==end) break;
    start=end+1;
    end=e;
  }
  
  for(int i=2;i<=n;i++){
    if(ans[i]==0){
      printf("No\n");
      return 0;
    }
  }
  printf("Yes\n");
  for(int i=2;i<=n;i++){    
    printf("%d\n",ans[i]);
  }
  
  return 0;
}

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

public class Main {	

	private static void solve(){
		//Implement solution here.
		long N = nl();
		StringBuilder sb = new StringBuilder();
		while(N > 0) {
//			System.out.println(N);
			long rem = -1;
			if(N % 26 == 0) {
				rem = 26;
				if(N == 26) {
					N = 0;
				} else {
					N /= 26L;
					N--;
				}
			} else {
				rem = N % 26L;
				N /= 26L;
			}	
			sb.insert(0,(char)(rem + 96L));
			
			
		}
		System.out.println(sb.toString());
	}

	//Switch input source (stdin/file)
	private static BufferedReader br;
	public static void main(String[] args){
		br = new BufferedReader(new InputStreamReader(System.in));
		String debugDataPath = System.getenv("DD_PATH");        
		if(debugDataPath != null){
			try{
				br = new BufferedReader(new InputStreamReader(new FileInputStream(new File(debugDataPath))));
			}catch(Exception e){
				throw new RuntimeException(e);
			}
		}
		boolean hasNext = true;
		while(hasNext){
			solve();	
			try{
				br.mark(1);
				if(br.read() > 0){
					br.reset();			
					System.out.println("---");
				} else {
					hasNext = false;
				}
			}catch(Exception e){
				throw new RuntimeException(e);
			} 
		}
	}

	//Input read utility
	private static StringTokenizer tokenizer = null;
	public static String next() {
		while (tokenizer == null || !tokenizer.hasMoreTokens()) {
			try {
				tokenizer = new StringTokenizer(br.readLine());
			} catch (Exception e) {
				throw new RuntimeException(e);
			}
		}
		return tokenizer.nextToken();
	}
	//Get next single int
	private static int ni() {
		return Integer.parseInt(next());
	}
	//Get next single long
	private static long nl() {
		return Long.parseLong(next());
	}
	//Get next single double
	private static double nd() {
		return Double.parseDouble(next());
	}
	//Get next int array from one line
	private static int[] na(int n) {
		int[] a = new int[n];
		for (int i = 0; i < n; i++)
			a[i] = ni();
		return a;
	}
	//Get next char array from one line
	private static char[] ns() {
		return next().toCharArray();
	}
	//Get next long array from one line
	private static long[] nal(int n) {
		long[] a = new long[n];
		for (int i = 0; i < n; i++)
			a[i] = nl();
		return a;
	}
}


Measured memory_bytes: 25408
use proconio::input;
fn main() {
    input! {
        n:usize,
    }
    for a in 0..100 {
        for b in 0..100 {
            if n == 4 * a + 7 * b {
                println!("Yes");
                return;
            }
        }
    }
    println!("No");
}


Measured memory_bytes: 2116
using System;
using System.Collections.Generic;

namespace Task
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = Convert.ToInt32(Console.ReadLine());
            HashSet<int> hs = new HashSet<int>();
            int sl = 0;
            for(int i = 1; i < n; ++i)
            {
                if(i == n - i || hs.Contains(i))
                    continue;
                
                hs.Add(i);
                hs.Add(n - i);
                ++sl;
            }

            System.Console.WriteLine(sl);
        }
    }
}


Measured memory_bytes: 38960
#include<iostream>
#include<vector>
#include<string>
#include<algorithm>	
#include<map>
#include<set>
#include<utility>
#include<cmath>
#include<cstring>
#include<queue>
#include<cstdio>
#include<sstream>
#include<iomanip>
#define loop(i,a,b) for(int i=a;i<b;i++) 
#define rep(i,a) loop(i,0,a)
#define pb push_back
#define mp make_pair
#define all(in) in.begin(),in.end()
#define shosu(x) fixed<<setprecision(x)
using namespace std;
//kaewasuretyuui
typedef long long ll;
typedef pair<int,int> pii;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<pii> vp;
typedef vector<vp> vvp;
typedef pair<int,pii> pip;
typedef vector<pip>vip	;
const double PI=acos(-1);
const double EPS=1e-8;
const int inf=1e8;
int main(){
	int n;
	while(cin>>n,n){
		vi a(n);
		rep(i,n){
			cin>>a[i];
			a[i]*=-1;
		}
		sort(all(a));
		vi b(n-1);
		rep(i,n-1){
			cin>>b[i];
			b[i]*=-1;
		}
		sort(all(b));
		ll sum=0;
		rep(i,n)sum-=a[i];
		ll out=sum*n;
		rep(i,n-1){
			sum-=b[i];
			out=max(out,sum*(n-1-i));
		}
		cout<<out<<endl;
	}
}

Measured memory_bytes: 1532
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp> // Common file
#include <ext/pb_ds/tree_policy.hpp> // Including tree_order_statistics_node_update
using namespace std;
using namespace __gnu_pbds;
auto random_address = [] { char *p = new char; delete p; return uint64_t(p); };
const uint64_t SEED = chrono::steady_clock::now().time_since_epoch().count() * (random_address() | 1);
mt19937_64 rng(SEED);
typedef tree<
int,
null_type,
less<int>,
rb_tree_tag,
tree_order_statistics_node_update>
ordered_set;
typedef long long ll;
typedef long double ld;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
ll n,q,aiblin[300001],aibcol[300001],white,black;
bool uselin[300001],usecol[300001];
ll lsb(ll x)
{
    return x&-x;
}
void updatelin(ll poz,ll val)
{
    for(int i=poz;i<=n-1;i+=lsb(i))
        aiblin[i]+=val;
}
ll sumlin(ll poz)
{
    ll rez=0;
    for(int i=poz;i>=1;i-=lsb(i))
        rez+=aiblin[i];
    return rez;
}
void updatecol(ll poz,ll val)
{
    for(int i=poz;i<=n-1;i+=lsb(i))
        aibcol[i]+=val;
}
ll sumcol(ll poz)
{
    ll rez=0;
    for(int i=poz;i>=1;i-=lsb(i))
        rez+=aibcol[i];
    return rez;
}
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    cin>>n>>q;
    updatelin(2,n);
    updatecol(2,n);
    white=2*n-1;
    black=(n-2)*(n-2);
    while(q--)
    {
        ll tip,poz;
        cin>>tip>>poz;
        if(tip==1)
        {
            if(usecol[poz])
                continue;
            ll lastpoz=sumcol(poz);
            white+=lastpoz;
            black-=(lastpoz-2);
            ll vallin=sumlin(2);
            if(vallin>poz)
            {
                updatelin(2,poz-vallin);
                if(lastpoz+1<=n-1)
                    updatelin(lastpoz+1,vallin-poz);
            }
            usecol[poz]=1;
        }
        if(tip==2)
        {
            if(uselin[poz])
                continue;
            ll lastpoz=sumlin(poz);
            white+=lastpoz;
            black-=(lastpoz-2);
            ll vallin=sumcol(2);
            if(vallin>poz)
            {
                updatecol(2,poz-vallin);
                if(lastpoz+1<=n-1)
                    updatecol(lastpoz+1,vallin-poz);
            }
            uselin[poz]=1;
        }
    }
    cout<<black;
    return 0;
}


Measured memory_bytes: 5360
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
ll a[1000000+30];
int main()
{
    ll n,i,j,k;
    cin>>n;
    ll p=0;
    ll ar[n];
    ll pp=0,v,q=0;
    for(i=0;i<n;i++){
        scanf("%lld",&p);
        if(i==0)
            v=p;
        v=__gcd(p,v);
        ar[i]=p;
        a[p]++;
        if(a[p]>1 && p!=1)
            q=1;
        if(q==1)
            continue;
        for(j=2;j*j<=p;j++){
            if(p%j==0){
                if((p/j)==j){
                    a[j]++;
                    if(a[j]>1)
                        q=1;
                }
                else{
                    a[j]++;
                    a[(p/j)]++;
                    if(a[j]>1 || a[(p/j)]>1)
                        q=1;
                }
            }
            if(q==1)
                break;
        }
    }
    //for(i=0;i<10;i++)
        //cout<<a[i]<<" ";cout<<endl;
    if(q!=1){
        cout<<"pairwise coprime"<<endl;
        return 0;
    }
    p=ar[0];
    for(i=1;i<n;i++){
        ll www=ar[i];
      //  cout<<p<<endl;
        p=__gcd(p,www);
    }
    //cout<<p<<endl;
    if(p==1){
        cout<<"setwise coprime"<<endl;
        return 0;
    }
    cout<<"not coprime"<<endl;
}


Measured memory_bytes: 19236
// Merge Sort
#include <bits/stdc++.h>
using namespace std;
int cnt = 0;
void Merge(int *A, int left, int mid, int right){
	int n1 = mid - left;
	int n2 = right - mid;
	int L[n1+1], R[n2+1];
	for(int i=0; i<n1; i++)
		L[i] = A[left + i];
	for(int i=0; i<n2; i++)
		R[i] = A[mid + i];
	L[n1] = numeric_limits<int>::max();
	R[n2] = numeric_limits<int>::max();
	int i=0; int j=0;
	for(int k=left;k<right;k++){
		if(L[i]<=R[j]){
			A[k] = L[i];
			i++;
		}
		else{
			A[k] = R[j];
			j++;
		}
		cnt++;
	}
}

void MergeSort(int *A, int left, int right){
	if((left+1)<right){
		int mid = (left+right)/2;
		MergeSort(A,mid,right);
		MergeSort(A,left,mid);
		Merge(A,left,mid,right);
	}
}

int main(){
	int n; cin >> n;
	int S[n];
	for(int i=0;i<n;i++)
		cin >> S[i];
	MergeSort(S,0,n);
	for(int i=0; i<n; i++)
		cout << S[i] << ((i<(n-1))?" ":"");
	cout << endl;
	cout << cnt << endl;
	return 0;
}

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

using namespace std;

#define pb push_back
#define mp make_pair

const int MAXN = 100010;
vector<pair<int, long long>> g[MAXN], g1[MAXN];
long long d[MAXN], d1[MAXN];
long long path[MAXN];

int main() {
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    //freopen("input.txt", "r", stdin);
    //freopen("output.txt", "w", stdout);
    int n, m, s, t;
    cin >> n >> m >> s >> t;
    s--, t--;
    for(int i = 0; i < m; i++) {
        int u, v;
        long long a, b;
        cin >> u >> v >> a >> b;
        u--, v--;
        g[u].pb(mp(v, a));
        g[v].pb(mp(u, a));
        g1[u].pb(mp(v, b));
        g1[v].pb(mp(u, b));
    }
    long long INF = numeric_limits<long long>::max();
    for(int i = 0; i < n; i++)
        d[i] = d1[i] = INF;
    priority_queue<pair<long long, int>> pq;
    d[s] = 0;
    pq.push(mp(0, s));
    while(!pq.empty()) {
        long long cost = -pq.top().first;
        int v = pq.top().second;
        pq.pop();
        if(cost > d[v])
            continue;
        for(auto k: g[v]) {
            int to = k.first;
            long long w = k.second;
            if(d[to] > d[v] + w) {
                d[to] = d[v] + w;
                pq.push(mp(-d[to], to));
            }
        }
    }
    d1[t] = 0;
    pq.push(mp(0, t));
    while(!pq.empty()) {
        long long cost = -pq.top().first;
        int v = pq.top().second;
        pq.pop();
        if(cost > d1[v])
            continue;
        for(auto k: g1[v]) {
            int to = k.first;
            long long w = k.second;
            if(d1[to] > d1[v] + w) {
                d1[to] = d1[v] + w;
                pq.push(mp(-d1[to], to));
            }
        }
    }
    multiset<long long> best;
    for(int i = 0; i < n; i++)
        path[i] = d[i] + d1[i], best.insert(path[i]);
    for(int i = 0; i < n; i++) {
        cout << (long long)(1e15) - *best.begin() << '\n';
        auto itr = best.find(path[i]);
        best.erase(itr);
    }
}


Measured memory_bytes: 25208
#include <bits/stdc++.h>
using namespace std;
  int n,A;
int main()
{
  cin >> n;

  int xmin = log2(1000000000);
  for(int i=0;i<n;i++){
    cin >> A;
    int x = 0;
    while(A%2 == 0){
      A /= 2;
      ++x;
    }
    xmin=min(x,xmin);
  }
  cout << xmin << endl;
}


Measured memory_bytes: 256
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <algorithm>
#include <cmath>
#include <vector>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <queue>
#include <ctime>
#include <cassert>
#include <complex>
#include <string>
#include <cstring>
#include <chrono>
#include <random>
#include <queue>
#include <bitset>
#include <stack>
#include <functional>

#ifdef LOCAL
    #define eprintf(...) fprintf(stderr, __VA_ARGS__)
#else
    #define eprintf(...) 42
#endif

#define rep_(i, a_, b_, a, b, ...) for (int i = (a), i##_len = (b); i < i##_len; ++i)
#define rep(i, ...) rep_(i, __VA_ARGS__, __VA_ARGS__, 0, __VA_ARGS__)
#define reprev_(i, a_, b_, a, b, ...) for (int i = (b-1), i##_min = (a); i >= i##_min; --i)
#define reprev(i, ...) reprev_(i, __VA_ARGS__, __VA_ARGS__, 0, __VA_ARGS__)
#define all(x) (x).begin(), (x).end()
template <class T> bool chmax(T &a, const T &b) { if (a < b) { a = b; return 1; } return 0; }
template <class T> bool chmin(T &a, const T &b) { if (b < a) { a = b; return 1; } return 0; }
template <class T> T gcd(T a, T b) { return b ? gcd(b, a % b) : a; }
using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef pair <int,int> P;
typedef long double ld;

int main (void)
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    string s; cin >> s;
    int a = -4; rep (i, 4) if (s[i] == '+') a += 2;
    cout << a << "\n";
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Weverything"
#include <boost/multi_array.hpp>
#include <boost/optional.hpp>
#include <boost/range/adaptors.hpp>
#include <boost/range/algorithm.hpp>
#include <boost/range/irange.hpp>
#pragma clang diagnostic pop

using namespace std;

int64_t solve(int64_t n) {
  int64_t ret = 0;
  for (int64_t m = 2; m <= n;) {
    int64_t const nDivM = n / m;
    int64_t const highM = n / nDivM;
    assert(highM >= m);
    if (highM > nDivM) {
      int64_t const loM = std::max(nDivM, m);
      int64_t const nn = n - nDivM;
      for (int64_t d = std::max(nn / highM, INT64_C(1));; d++) {
        if (nn / d < loM) {
          break;
        }
        if (nn % d > 0) {
          continue;
        }
        int64_t const mm = nn / d;
        if (mm <= highM) {
          ret += mm;
        }
      }
    }
    m = highM + 1;
  }
  return ret;
}

int main() {
  std::cin.tie(nullptr);
  std::ios::sync_with_stdio(false);
  int64_t n;
  std::cin >> n;
  auto const res = solve(n);
  std::cout << res << std::endl;
  return 0;
}


Measured memory_bytes: 256
#include <stdio.h>
#include <string>
#include <cstring>
#include <stdlib.h>
#include <math.h>
#include <algorithm>
#include <vector>
#include <set>
#include <map>
#include <queue>
#include <list>
#include <iterator>
#include <assert.h>
#pragma warning(disable:4996) 

typedef long long ll;
#define MIN(a, b) ((a)>(b)? (b): (a))
#define MAX(a, b) ((a)<(b)? (b): (a))
#define LINF 9223300000000000000
#define INF 2140000000
const long long MOD = 1000000007;
using namespace std;

ll dp[100005];

int main(int argc, char* argv[])
{
    int n,K;
    scanf("%d%d", &n, &K);

    vector<int> h(n);
    int i;
    for(i=0; i<n; i++) {
        scanf("%d", &h[i]);
    }
    dp[0]=0;
    for(i=1; i<n; i++) {
        dp[i]=INF;
        int j;
        for(j=MAX(0,i-K); j<i; j++) {
            dp[i]=MIN(dp[i], abs(h[j]-h[i])+dp[j]);
        }
    }
    printf("%lld\n", dp[n-1]);
    return 0;
}


Measured memory_bytes: 1408
x1,y1,x2,y2 = map(int,input().split())
x3 = x2-(y2-y1)
y3 = y2+(x2-x1)
x4 = x3-(y3-y2)
y4 = y3+(x3-x2)
print(x3,y3,x4,y4)

Measured memory_bytes: 8996
#include <bits/stdc++.h>
#define REP(i, n) for(int i = 0; i < n; i++)
#define REPR(i, n) for(int i = n; i >= 0; i--)
#define FOR(i, m, n) for(int i = m; i < n; i++)
#define ALL(v) v.begin(), v.end()
#define MOD 1000000007
typedef long long ll;

using namespace std;

int main()
{
  string s;
  cin >> s;
  string p;
  cin >> p;
  int s_len = s.size();
  int p_len = p.size();

  bool ans = false;

  // 先頭の文字を一番後ろに移動させる
  REP(i, s_len) {
    if (s[0] == p[0]) {
      bool flag = true;
      REP(j, p_len)
      {
        if (s[j] != p[j]) flag = false;
        if (j == p_len-1 && flag == true) ans = true;
      }
    }
    s.push_back(s[0]);
    s.erase(0, 1);

    if (ans == true) break;
  }

  if (ans == true) {
    cout << "Yes" << "\n";
  } else {
    cout << "No" << "\n";
  }
}



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

bool solve() {
    ll N, M, d, t;
    cin >> N;
    map<ll, ll> D, T;
    for ( int i = 0; i < N; i++ ) {
        cin >> d;
        D[d]++;
    }
    cin >> M;
    for ( int i = 0; i < M; i++ ) {
        cin >> t;
        T[t]++;
    }
    for ( auto p : T ) {
        if ( D[p.first] < p.second ) return false;
    }
    return true;
}

int main() {
    string ans = solve() ? "YES" : "NO";
    cout << ans << "\n";
    return 0;
}

Measured memory_bytes: 25216
#include "bits/stdc++.h"
using namespace std;
#define dbg(var) cout<<#var<<"="<<var<<" "
#define nl cout<<"\n"
#define fr(i,n) for(int i=0;i<n;i++)
#define rep(i,a,n) for(int i=a;i<=n;i++)
#define fast ios::sync_with_stdio(false);cin.tie(0);
#define vi vector<int>
#define vvi vector<vi>
#define pb push_back
#define fa(v) for(auto &i:v)
#define all(v) v.begin(),v.end()
#define sz(v) (int)(v.size())
//#define int long long
int32_t main()
{
    int n,k; cin >> n >> k;vi v(n);fr(i,n) cin >> v[i];
    double sm = 0;
    fr(i,k) sm += log(v[i]);
    vector<double> ans{sm};
    rep(i,k,n-1){
    	sm += log(v[i]);
    	sm -= log(v[i-k]);
    	ans.pb(sm);
    }
    fr(i,sz(ans)-1){
    	if(ans[i+1] > ans[i]) cout << "Yes\n";
    	else cout << "No\n";
    }
}

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

int main(){
	string s;
	cin>>s;
	int ans = 0;

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

	cout<<ans<<endl;
}

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

using ull = unsigned long long;

int main() {
  std::string s;
  ull k;
  std::cin >> s >> k;

  //
  // case 1

  if (s.front() != s.back()) {
    ull ans = 0;
    ull cnt = 1;
    for (int i=1; i<s.size(); i++) {
      if (s[i-1] != s[i]) {
        ans += cnt / 2;
        cnt = 0;
      }
      cnt++;
    }
    ans += cnt / 2;

    std::cout << (ans * k) << std::endl;
    return 0;
  }

  //
  // case 2

  ull l = s.size();

  for (int i=1; i<s.size(); i++) {
    if (s[i-1] != s[i]) {
      l = i;
      break;
    }
  }

  //
  // case 2-1

  if (l == s.size()) {
    std::cout << (l*k/2) << std::endl;
    return 0;
  }

  //
  // case 2-2

  ull ans = 0;
  ull cnt = 1;
  for (int i=l+1; i<s.size(); i++) {
    if (s[i-1] != s[i]) {
      ans += cnt / 2;
      cnt = 0;
    }
    cnt++;
  }
  ull r = cnt;

  ans *= k;
  ans += l/2;
  ans += r/2;
  ans += (l+r)/2 * (k-1);

  std::cout << ans << std::endl;

  return 0;
}


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

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

void solve(std::string S, std::string T)
{
    cout << (equal(begin(S), end(S), begin(T)) ? YES : NO) << endl;
}

// Generated by 1.1.7.1 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
int main()
{
    std::string S;
    std::cin >> S;
    std::string T;
    std::cin >> T;
    solve(S, T);
    return 0;
}


Measured memory_bytes: 3620
#include <cstdio>
#include <utility>
#include <vector>
#include <string>
#include <queue>
using namespace std;

#define gcu getchar_unlocked
int in(int c){int n=0;bool m=false;if(c=='-')m=true,c=gcu();
	do{n=10*n+(c-'0'),c=gcu();}while(c>='0');return m?-n:n;}
int in() {return in(gcu());}
bool scan(int &n){int c=gcu();return c==EOF?false:(n=in(c),true);}
bool scan(char &c){c=gcu();gcu();return c!=EOF;}
//bool scan(string &s){int c;s="";
//	for(;;){c=gcu();if(c=='\n'||c==' ')return true;else if(c==EOF)return false;s+=c;}}
#define pcu putchar_unlocked
#define vo inline void out
template <typename T>
vo(T n){static char buf[20];char *p=buf;
	if(n<0)pcu('-'),n*=-1;if(!n)*p++='0';else while(n)*p++=n%10+'0',n/=10;
	while (p!=buf)pcu(*--p);}
vo(const char *s){while(*s)pcu(*s++);}
vo(char c){pcu(c);}
vo(string &s){for (char c: s) pcu(c);}
template <typename head, typename... tail> vo(head&& h, tail&&... t){out(h);out(move(t)...);}
//template <typename T> vo(vector<T> &v){for(T &x:v)out(&x == &v[0]?"":" "),out(x);out('\n');}
#undef vo

int read() {
	int h;
	if (!scan(h))
		return 0;
	int m = in(), s = in();
	return h * 3600 + m * 60 + s;
}

int main() {
	int s;
	while ((s = read())) {
		int d = read() - s;
		out(d / 3600, ' ', d / 60 % 60, ' ', d % 60, '\n');
	}
}


Measured memory_bytes: 2636
while True:
    N = int(input())
    if N == 0:
        break
    A = list(map(int, input().split()))
    A.sort()
    m = 0
    flag = True
    for i in range(N):
        m += 1
        if i == N - 1 or A[i] != A[i + 1]:
            if 2 * m > N:
                print(A[i])
                flag = False
                break
            m = 0
    if flag:
        print("NO COLOR")



Measured memory_bytes: 125020
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);

int32_t main()
{
//	freopen("input.txt", "r", stdin);
	IOS;
	
	int n; cin >> n;
	if(n%1000 == 0) cout << 0;
	else cout << 1000 - (n%1000);
	return 0;
}

Measured memory_bytes: 3620
import sys,bisect as bs,collections as cl,heapq as hq
sys.setrecursionlimit(100000)
mod = 10**9+7
Max = sys.maxsize
def l(): #intのlist
    return list(map(int,input().split()))
def m(): #複数文字
    return map(int,input().split())
def onem(): #Nとかの取得
    return int(input())
def s(x): #圧縮
    a = []
    aa = x[0]
    su = 1
    for i in range(len(x)-1):
        if aa != x[i+1]:
            a.append([aa,su])
            aa = x[i+1]
            su = 1
        else:
            su += 1
    a.append([aa,su])
    return a
def jo(x): #listをスペースごとに分ける
    return " ".join(map(str,x))
def max2(x): #他のときもどうように作成可能
    return max(map(max,x))
def In(x,a): #aがリスト(sorted)
    k = bs.bisect_left(a,x)
    if k != len(a) and a[k] ==  x:
        return True
    else:
        return False

n,a,b = m()

h = []

for i in range(n):
    h.append(onem())

h.sort(reverse = True)

l = 1
r = h[0]//b+1

while l != r:
    x = (l+r)//2
    ct = 0
    for i in range(n):
        ct += ((a-b-1) + max(0,h[i]-b*x))//(a-b)
    if ct > x:
        l = x+1
    else:
        r = x
print(l)






Measured memory_bytes: 51928
#include<bits/stdc++.h>
#define FIO ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define PI 3.141592653589793238462643383279502884L
#define make_unique(vec) vec.resize(distance(vec.begin(),unique(vec.begin(),vec.end())))
#define Sort(vec) sort(vec.begin(),vec.end())
#define RSort(vec) sort(vec.rbegin(),vec.rend())
#define endl "\n"
#define tr1(i) cout<<i<<endl;
#define tr2(i,j) cout<<i<<" "<<j<<endl;
#define tr3(i,j,k) cout<<i<<" "<<j<<" "<<k<<endl;
#define vvi vector<vector<int> > 
#define vvl vector<vector<ll> >
#define all(st) st.begin(),st.end()
#define vpl vector<pair<ll,ll> >
#define vpi vector<pair<int,int> >
#define pi pair<int,int>
#define pl pair<ll,ll>
#define al vector<list<int> >
#define vs vector<string>
#define vi vector<int>
#define vb vector<bool>
#define vl vector<ll>
#define vc vector<char>
#define rep(i,l,r) for(int i=l;i<r;i++)
#define repit(st) for(auto it=st.begin();it!=st.end();it++)
#define ull unsigned long long int
#define eb emplace_back
#define pb push_back
#define ll long long int
#define minf -(1e18)
#define inf 1e18
#define f first
#define se second
#define mod 1000000007
using namespace std;
ll mi(ll n,ll m){ll pw=n%m;ll ex=m-2;ll ans=1;while(ex){if(ex&1) ans = ans*pw%m;pw = pw*pw%m;ex>>=1;}return ans%mod;}
ll pw(ll a,ll n){ll pw=a%mod;ll ex=n;ll ans=1;while(ex){if(ex&1) ans = ans*pw%mod;pw = pw*pw%mod;ex>>=1;}return ans%mod;}
template<typename T>istream &operator>>(istream &is, vector<T> &v) { for (T &t : v) is >> t; return is; }
template<typename T>ostream &operator<<(ostream &os, const vector<T> &v) { for (const T &t : v) {os << t <<" ";} os << '\n'; return os; }
void show(ll x){cout<<x<<" ";}
ll gcd(ll a,ll b){return b==0?a:gcd(b,a%b);}
ll lcm(ll a,ll b){return a/gcd(a,b)*b;}
ll max(ll a,ll b){return a>b?a:b;}
ll min(ll a,ll b){return a<b?a:b;}
ll Abs(ll x){return x>0?x:(-x);}
ll Ceil(ll a,ll b){return a/b+(a%b!=0);}
#define bs binary_search
//#define int long long 
#define lb lower_bound
#define mkp make_pair
//#define d double
void solve(){
 
 
	ll n,k;
	cin>>n>>k;
	ll cnt=0;
	while(n){
		cnt++;
		n/=k;
	}
 cout<<cnt<<endl;
 
 
 
 
 
}
int32_t main(){
int t=1;
//cin>>t;
while(t--){
	solve();
}
}

Measured memory_bytes: 256
import math
a, b, c, d, e = [int(input()) for _ in range(5)]
li = [a, b, c, d, e]
ls = []
for l in li:
    ls.append(math.ceil(l/10)*10)


def amari(x): return (x-1) % 10+1


li = list(map(amari, li))
min = min(li)

sum = sum(ls)

print(sum + min - 10)


Measured memory_bytes: 3064
#include <bits/stdc++.h>
#define _overload3(_1, _2, _3, name, ...) name
#define _rep(i, n) repi(i, 0, n)
#define repi(i, a, b) for (ll i = (ll)(a); i < (ll)(b); ++i)
#define rep(...) _overload3(__VA_ARGS__, repi, _rep, )(__VA_ARGS__)
#define ll long long
#define lld long double
#define ALL(x) x.begin(), x.end()
using namespace std;

const int IINF = 1 << 30;
const ll INF = 1ll << 60;
const ll MOD = 1e9 + 7;

int main(int argc, char const *argv[])
{
    string s;
    cin >> s;
    int cur = 0;
    int ans = 0;
    rep(i, s.size())
    {
        if (cur > 0)
        {
            cur--;

            if (s[i] == 'g')
            {
                ans++;
            }
        }
        else
        {
            cur++;
            if (s[i] == 'p')
            {
                ans--;
            }
        }
    }
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 512
N, K = map(int, input().split())
x = [int(i) for i in input().split()]
min = 10 ** 9
for i in range(N-K+1):
  count = abs(x[i] - x[i+K-1]) + abs(x[i])
  if count < min:
    min = count
  count = abs(x[i] - x[i+K-1]) + abs(x[i+K-1])
  if count < min:
    min = count
print(min)

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

int main(){
  ios_base::sync_with_stdio(0),cin.tie(0),cout.tie(0);
  long n;cin>>n;
  long long a[n];
  for(long i=0;i<n;i++){
  	cin>>a[i];
  }
  long long x=0;
  long long m=1000000007;
  long long ssum[n];
  ssum[n-1]=a[n-1];
  for(int i=n-2;i>=0;i--){
  	ssum[i]=(a[i]+ssum[i+1])%m;
  }
  // for(int i=0;i<n;i++)cout<<ssum[i]<<" ";
  // cout<<endl;
  for(int i=0;i<n-1;i++){
  	x=(x+(a[i]*ssum[i+1])%m)%m;
  }
  cout<<x<<"\n";
 return 0; 
}

Measured memory_bytes: 6736
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {

    	Scanner parameter = new Scanner(System.in);

        Integer input1 = parameter.nextInt();

        if (input1 < 10) {

        	System.out.println(input1);
        } else if (input1 >= 10 && input1 < 100) {

        	System.out.println(9);
        } else if (input1 >= 100 && input1 < 1000) {

        	System.out.println(input1 - 90);
        } else if (input1 >= 1000 && input1 < 10000) {

        	System.out.println(909);
        } else if (input1 >= 10000 && input1 < 100000) {

        	System.out.println(input1 - 9090);
        } else {

        	System.out.println(90909);
        }
    }
}


Measured memory_bytes: 21972
import java.util.*; 
public class Main{
 public static void main(String ...string){
  Scanner sc = new Scanner(System.in); 
   int a = sc.nextInt(),b = sc.nextInt(),c = sc.nextInt();
   System.out.println(Math.min(a+b,Math.min(a+c,c+b))); 
 }
   
}


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

int partition(int a[], int p, int r){
    int x = a[r];
    int i = p - 1;
    for(int j = p; j < r; j++){
        if(a[j] <= x){
            i++;
            swap(a[i], a[j]);
        }
    }
    swap(a[i+1], a[r]);
    return i + 1;
}

int main(){
    int n, p; cin >> n;
    int a[n];
    for(int i = 0; i < n; i++) cin >> a[i];

    p = partition(a,0,n-1);

    for(int i = 0; i < n; i++){
        if(i) cout << " ";
        i != p ? cout << a[i] : cout << "[" << a[p] << "]";
    }
    cout << endl;

    return 0;
}


Measured memory_bytes: 3432
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#include <chrono>

using namespace __gnu_pbds;
using namespace std;

#define ordered_set tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update>
// order_of_key (val): returns the no. of values less than val
// find_by_order (k): returns the kth largest element.(0-based)

#define ll long long int
#define ld long double
#define ff first
#define ss second
#define pb push_back
#define pi pair<ll,ll>
#define pii pair<ll,pi >
#define ppi pair<pi,ll>
#define ppp pair<pi,pi >
#define ex(str,a,b) str.substr((int)(a),min((int)str.size()-a,(int)(b-a+1))) 
#define all(X) X.begin(),X.end()
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());

// for pair comparison function(ascending order) use return (i1.ff < i2.ff);

/* string operations :
   str.substr (x,y) : returns a substring str[x],str[x+1],...str[x+y-1]
   __builtin_popcount(n) : no. of set bits in n.
*/

const int M = (1<<20)+5;
const int md = 1e9+7;

ll pwr(ll a,ll n,ll m)
{
	ll p=1;
	while(n>0)
	{
		if(n%2==1)
			p=(p*a)%m;
		a=(a*a)%m;
		n=n/2;
	}
	return p;
}

vector<vector<bool> > mat,mrk;
vector<vector<ll> > dist;
queue<pi > pq;
ll n,m,k,ax,ay,bx,by;

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

	ll i,j,d;
	char ch;

	cin >> n >> m >> k;
	mat.resize(n);
	dist.resize(n);
	mrk.resize(n);

	cin >> ax >> ay >> bx >> by;
	ax--;
	ay--;
	bx--;
	by--;

	for(i=0;i<n;++i)
	{
		for(j=0;j<m;++j)
		{
			cin >> ch;
			if(ch == '@')
				mat[i].pb(0);
			else
				mat[i].pb(1);
		}
	}

	for(i=0;i<n;++i)
	{
		for(j=0;j<m;++j)
		{
			dist[i].pb(1e7);
			mrk[i].pb(0);
		}
	}

	pq.push(pi(ax,ay));
	dist[ax][ay] = 0;

	while(!(pq.empty()))
	{
		pi ed = pq.front();
		pq.pop();
		ax = ed.ff;
		ay = ed.ss;

		if(ax == bx && ay == by)
		{
			cout << dist[ax][ay] << "\n";
			return 0;
		}

		if(mrk[ax][ay])
			continue;
		mrk[ax][ay] = 1;

		d = dist[ax][ay];

		for(i=1;i<=k;++i)
		{
			if(ax+i >= n || mat[ax+i][ay] == 0 || dist[ax+i][ay] <= dist[ax][ay])
				break;
			dist[ax+i][ay] = d+1;
			pq.push(pi(ax+i,ay));
		}
		
		for(i=1;i<=k;++i)
		{
			if(ax-i < 0 || mat[ax-i][ay] == 0 || dist[ax-i][ay] <= dist[ax][ay])
				break;
			dist[ax-i][ay] = d+1;
			pq.push(pi(ax-i,ay));
		}

		for(i=1;i<=k;++i)
		{
			if(ay+i >= m || mat[ax][ay+i] == 0 || dist[ax][ay+i] <= dist[ax][ay])
				break;
			dist[ax][ay+i] = d+1; 
			pq.push(pi(ax,ay+i));
		}

		for(i=1;i<=k;++i)
		{
			if(ay-i < 0 || mat[ax][ay-i] == 0 || dist[ax][ay-i] <= dist[ax][ay])
				break;
			dist[ax][ay-i] = d+1;
			pq.push(pi(ax,ay-i));
		}
	}

	cout << -1 << "\n";
}






	

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

int main(){
	int m[10];
	for(int i=0;i<10;i++)
	cin>>m[i];
	
	sort(m,m + 10,greater<int>());
	cout<<m[0]<<endl<<m[1]<<endl<<m[2]<<endl;
	
	
	return 0;
}


Measured memory_bytes: 3140
n, m = gets.split.map(&:to_i)
l = [[nil, 1]] + (1..n+1).map {|i| [i - 1, i + 1]}
m.times do |i|
    x = gets.to_i
    l[l[x][0]][1] = l[x][1]
    l[l[x][1]][0] = l[x][0]
    l[x][0] = 0
    l[x][1] = l[0][1]
    l[l[0][1]][0] = x
    l[0][1] = x
end
a = []
i = l[0][1]
until i > n
    a << i
    i = l[i][1]
end
puts a


Measured memory_bytes: 25296
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <iomanip>
#include <map>
#include <set>
#include <ctype.h>
#include <numeric>
#include <math.h>
using namespace std;

typedef long long ll;
typedef pair<int, int> P;
typedef pair<ll, ll> Pll;
const ll MOD = 1e9 + 7;
const int INF = 1e9;

int dx4[4] = { 0, -1, 1, 0 };
int dy4[4] = { -1, 0, 0, 1 };
int dx8[8] = { 0, -1, 1, 0, -1, 1, -1, 1 };
int dy8[8] = { -1, 0, 0, 1, -1, -1, 1, 1 };

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

  if (a > b) cout << "GREATER" << endl;
  else if (a < b) cout << "LESS" << endl;
  else cout << "EQUAL" << endl;
  return 0;
}


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

#define REP(i, m, n) for (int i = (m); i < (int)(n); i++)
#define REPS(i, m, n) for (int i = (m); i <= (int)(n); i++)
#define rep(i, n) REP(i, 0, n)
#define reps(i, n) for (int i = 0; i <= (int)(n); i++)
#define rrep(i, x) for (int i = ((int)(x)-1); i >= 0; i--)
#define rreps(i, x) for (int i = (int)(x); i >= 0; i--)
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define pb push_back
#define fi first
#define se second
typedef long long ll;
typedef pair<int, int> P;
const int inf = INT_MAX;
const ll INF = 1LL << 60;
const ll mod = 1e9 + 7;
const double EPS = 1e-10;
const double PI = acos(-1.0);
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; }
template<typename A, size_t N, typename T> void Fill(A (&array)[N], const T &val) { fill( (T*)array, (T*)(array+N), val ); }

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

ll lcm(ll a, ll b) {
    return a / gcd(a, b) * b;
}
int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);

    ll a, b;
    cin >> a >> b;
    cout << lcm(a, b) << endl;
}

Measured memory_bytes: 256
Q = int(input())
lr = [list(map(int,input().split(" "))) for x in range(Q)]

prime = [2]
l = len(prime)
p = prime[-1]+1

d = [0] * 100002

def isPrime(x):
    i = 0
    while i < l:
        if prime[i]**2 > x:
            return True
        if not(x % prime[i]):
            return False
        i += 1

while p < 100000:
    if isPrime(p):
        prime.append(p)
        d[p] = 1
        l += 1
    p += 1

a = [0,1]

for i in range(5,100002,2):
    b = d[i] and d[(i+1)//2]
    a.append(a[-1]+b)

o = []
for i in lr:
    if i[1] == 1:
        o.append(0)
        continue
    if i[0] == 1:
        i[0] = 3
    i[0] = (i[0] - 1)//2
    i[1] = (i[1] - 1)//2
    o.append(a[i[1]]-a[i[0]-1])
    
print('\n'.join(map(str,o)))

Measured memory_bytes: 38792
#include <bits/stdc++.h>
using namespace std;
 
#define ll long long
#define mod 1000000007
#define pb push_back
#define pi pair<int,int>
#define vi vector<int>
#define vpi vector< pi >
const int N=200010;
ll x[N],v[N],ans[N];
int main()
{
	ll n,c;
	cin>>n>>c;
	for(int i=1;i<=n;i++) cin>>x[i]>>v[i];
	//for(int i=1;i<=n;i++) cin>>v[i];
	ll res=0,r=0;
	for(ll i=n;i>0;i--)
	{
		if(i==n)
		r-=(c-x[i]);
		else
			r-=(x[i+1]-x[i]);
		r+=v[i];
		ans[i]=max(ans[i+1],r);
		res=max(res,ans[i]);
	}
	r=0;
	for(ll i=1;i<=n;i++)
	{
		if(i==1)
			r-=x[i];
		else
			r-=(x[i]-x[i-1]);
		r+=v[i];
		res=max(res,max(r,r+ans[i+1]-x[i]));
		ans[i]=max(ans[i-1],r);
	}
	r=0;
	for(ll i=n;i>0;i--)
	{
		if(i==n)
		r-=(c-x[i]);
		else
			r-=(x[i+1]-x[i]);
		r+=v[i];
		res=max(res,r+ans[i-1]-(c-x[i]));
	}
	//cout<<ans[0]<<ans[n+1]<<"\n";
	cout<<res;
	return 0;
}

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

typedef long long ll;

#define optimize() ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define file() freopen("input.txt","r",stdin);freopen("output.txt","w",stdout);
#define tt int t; cin>>t; while(t--)
#define nl cout<<"\n";
#define sp cout<<" ";
#define rep(i, a, b) for(long long i=a; i<b; i++)

const int INF = 1e9 + 7;
const int MOD = 1e9 + 7;
double PI = 4*atan(1);

int main()
{
    optimize();

    char s[3];
    int c=0, mx=0;

    for(int i=0; i<3; i++)
         cin>> s[i];

    for(int i=0; i<3; i++)
    {

        c=0;
        while(s[i]=='R')
        {
           c++;
           i++;
        }
           // i--;
    mx= max(c, mx);
    }

cout<< mx;
nl;

    return 0;
}




Measured memory_bytes: 3608
import sys
import heapq, math
from itertools import zip_longest, permutations, combinations, combinations_with_replacement
from itertools import accumulate, dropwhile, takewhile, groupby
from functools import lru_cache
from copy import deepcopy

N, M, Q = map(int, input().split())
A, B, C, D = [0] * Q, [0] * Q, [0] * Q, [0] * Q
for i in range(Q):
    A[i], B[i], C[i], D[i] = map(int, input().split())
    A[i] -= 1
    B[i] -= 1


def calc(X):
    score = 0
    for i in range(Q):
        if X[B[i]] - X[A[i]] == C[i]:
            score += D[i]

    return score


def solve(idx, par, X):
    if idx == N:
        return calc(X)

    ret = 0
    for i in range(par, M + 1):
        X[idx] = i
        ret = max(ret, solve(idx + 1, i, X))

    return ret


print(solve(0, 1, [0] * N))

Measured memory_bytes: 9708
#pragma GCC optimize ("O3")
#include <iostream>
#include <iomanip>
#include <istream>
#include <ostream>
#include <sstream>
#include <iterator>
#include <vector>
#include <algorithm>
#include <queue>
#include <deque>
#include <list>
#include <stack>
#include <map>
#include <unordered_map>
#include <set>
#include <bitset>
#include <utility>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <string>
#include <ctime>
#include <cctype>
#include <cstdlib>
#define IINF 1000000000
#define INF 9223372036854775807
#define MOD 998244353
#define mod 998244353

#define INT_MAX_ 2147483647
#define EPS (1e-10)
#define REP(i, a, n) for (ll i = a; i < (ll)(n); i++)
#define REPE(i, a, n) for (ll i = a; i <= (ll)(n); i++)
#define rep(i,n)for (ll i = 0; i < (ll)(n); i++)
#define Endl endl
#define fi first
#define se second
#define pb push_back
#define mp make_pair
#define mt make_tuple
#define eb emplace_back
#define mmax(x,y)(x>y?x:y)
#define mmin(x,y)(x<y?x:y)
#define chmax(x,y) x=mmax(x,y)
#define chmin(x,y) x=mmin(x,y)
#define all(x) (x).begin(),(x).end()
#define siz(x) (ll)(x).size()
#define PI acos(-1.0)
#define me memset
#define bit(n,k) ((n>>k)&1)
using namespace std;
typedef long long int ll;
typedef unsigned long long int ull;
typedef long double ld;
typedef pair<int,int>Pin;
typedef pair<ll,ll>Pll;
template<class T> using V=vector<T>;
template<typename T> using min_priority_queue = priority_queue<T, vector<T>, greater<T> >;
long long GCD(long long a, long long b) {return b?GCD(b,a%b):a;}
long long LCM(long long a, long long b) {return a/GCD(a,b)*b;}
int dx[4]={-1,0,1,0};
int dy[4]={0,-1,0,1};
int ddx[8]={-1,0,1,0,1,1,-1,-1};
int ddy[8]={0,-1,0,1,1,-1,1,-1};
ll cmp1(pair<ll,ll> a,pair<ll,ll> b){
        if(a.se!=b.se)
        return a.se<b.se;
        else
        return a.fi>b.fi;
}
//----------------------------------------------------------------------

//----------------------------------------------------------------------
int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    //-------------------------------  
    //ll begin_t=clock();
    //freopen("input.txt", "r", stdin);
    //freopen("output.txt", "w", stdout);
    //-------------------------------
    ll n;cin>>n;
    V<ll>a(n),b(n);
    for(ll i=0;i<n;i++)cin>>a[i]>>b[i];
    sort(all(a));sort(all(b));
    if(n%2!=0){
        cout<<b[n/2]-a[n/2]+1<<Endl;
    }
    else{
        ll aa = (a[n/2-1]+a[n/2]);
        ll bb = (b[n/2-1]+b[n/2]);
        cout<<(bb-aa)+1<<endl;;
    }
    //-------------------------------  
    //fclose(stdin);
    //fclose(stdout);
    //ll end_t=clock();cout<<"time="<<end_t-begin_t<<"ms"<<endl;
    //-------------------------------
    return 0;
}
//----------------------------------------------------------------------



















































Measured memory_bytes: 6368
def solve(s, t):
    dic1, dic2 = {}, {}
    for c, d in zip(s, t):
        if c in dic1:
            if dic1[c] != d:
                return False
        else:
            dic1[c] = d
        if d in dic2:
            if dic2[d] != c:
                return False
        else:
            dic2[d] = c
    return True


s = input()
t = input()
print('Yes' if solve(s, t) else 'No')


Measured memory_bytes: 3632
#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define ALL(c) (c).begin(),(c).end()
#define RALL(c) (c).rbegin(),(c).rend()
using namespace std;
using ll = long long;
using P = pair<int,int>;
#define chmax(x,y) x = max(x,y)
#define chmin(x,y) x = min(x,y)

const ll INF = 1e18 + 10;

const int mod = 1000000007;
struct mint {
    ll x;
    mint(ll x=0):x( (x%mod + mod) % mod ) {}
    mint operator-() const { return mint(-x); }
    mint& operator+=(const mint a) {
        if ( (x += a.x) >= mod ) x -= mod;
        return *this;
    }
    mint& operator-=(const mint a) {
        if ( ( x += mod - a.x) >= mod ) x -= mod;
        return *this;
    }
    mint& operator*=(const mint a) {
        ( x *= a.x) %= mod;
        return *this;
    }
    mint operator+(const mint a) const { return mint(*this) += a; }
    mint operator-(const mint a) const { return mint(*this) -= a; }
    mint operator*(const mint a) const { return mint(*this) *= a; }
    mint pow(ll t) const {
        if (!t) return 1;
        mint a = pow(t >> 1);
        a *= a;
        if (t&1) a *= *this;
        return a;
    }

    mint inv() const { return pow(mod - 2); }
    mint& operator/=(const mint a) { return *this *= a.inv(); }
    mint operator/(const mint a) { return mint(*this) /= a; }
};
istream& operator>>(istream& is, mint& a) { return is >> a.x; }
ostream& operator<<(ostream& os, const mint& a) { return os << a.x; }

mint dp[2005];
int S;

int main() {
    cin >> S;
    rep(i,2005) dp[i] = 1;
    dp[0] = dp[1] = dp[2] = 0;
    for (int i = 3; i < S; i++) {
        for (int j = 3; i + j <= S; ++j) {
            dp[i+j] += dp[i];
        }
    }
    cout << dp[S] << endl;
}

Measured memory_bytes: 3628
#include <cstdlib>
#include <cmath>
#include <climits>
#include <cfloat>
#include <map>
#include <utility>
#include <set>
#include <iostream>
#include <memory>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
#include <sstream>
#include <deque>
#include <complex>
#include <stack>
#include <queue>
#include <cstdio>
#include <cctype>
#include <cstring>
#include <ctime>
#include <iterator>
#include <bitset>
#include <numeric>
#include <list>
#include <iomanip>
using namespace std;
#define ll int64_t
const long MOD = 1e9 + 7;




int main() {

  long n;
  cin >> n;
  vector<int> a(n);

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

  vector <int> rate(9, 0);

  for (int i = 0; i < n; ++i) {
    if (a[i] >= 1    && a[i] <= 399 )rate[0]++;
    if (a[i] >= 400  && a[i] <= 799 )rate[1]++;
    if (a[i] >= 800  && a[i] <= 1199)rate[2]++;
    if (a[i] >= 1200 && a[i] <= 1599)rate[3]++;
    if (a[i] >= 1600 && a[i] <= 1999)rate[4]++;
    if (a[i] >= 2000 && a[i] <= 2399)rate[5]++;
    if (a[i] >= 2400 && a[i] <= 2799)rate[6]++;
    if (a[i] >= 2800 && a[i] <= 3199)rate[7]++;
    if (a[i] >= 3200                )rate[8]++;
  }



  int minval = 0;
  int maxval = 0;
  for (int i = 0; i < 8; ++i) {
    if (rate[i] > 0)minval++;
  }

  cerr << minval;


  maxval = minval + rate[8];
  if (minval ==0 )minval=1;


  cout << minval << " " << maxval;

  return 0;
}



























Measured memory_bytes: 256
#include <iostream>
#include <cmath>
#include <string>
#include <numeric>
#include <algorithm>
#include <iomanip>
#include <queue>
#include <vector>
using namespace std;
#define INF 1000000007
#define ll long long
#define rep(i_, __start, __end) for(ll i_=(ll)__start; i_<(ll)__end; i_++)
#define print(_a) cout << _a << endl;
#define printarray(a, len) rep(ii,0,len) cout << a[ii] << " ";
#define printarray2(aa, len) rep(ij,0,len) printarray(aa[ij], aa[ij].size()); print("");
 
ll dp[62] = {};
int main(){
    ll n, a, cur=1, ans=0;
    cin >> n;
    rep(i, 0, n){
      cin >> a;
      rep(x, 0, 62){
        if(a % 2 == 1) dp[x] += 1;
        a /= 2;
      }
    }
    
    rep(i, 0, 62){
      ans += ((cur * dp[i] % INF) * (n - dp[i])) % INF;
      cur *= 2;
      cur %= INF;
      ans %= INF;
    }
 
    print(ans);
 
  return 0;
}

Measured memory_bytes: 256