akhauriyash/Code-Regression huggingface dataset:
#include<bits/stdc++.h>
using namespace std;
#define SORT(c) sort((c).begin(),(c).end());
#define pb push_back
#define MP make_pair
#define pii pair<int,int>
#define pcc pair<char,char>
#define pic pair<int,char>
#define pci pair<char,int>
#define VS vector<string>
#define VI vector<int>
#define pi 3.141592653589793
#define ll long long
#define ull unsigned long long
#define w(x) int x;cin>>x;while(x--)
#define fast ios_base::sync_with_stdio(0)
#define sz size()
#define cu cout<<
#define en endl
#define sp " "
#include<cstdio>
#include<cstring>
typedef unsigned long long UL;
template<typename T>inline T  S(T a)
{
    return a*a;
}
template<class T>inline string tostring(T a)
{
    ostringstream os("");
    os << a;
    return os.str();
}
template<typename T>inline ll tolong(T a)
{
    ll res;
    istringstream os(a);
    os>>res;
    return res;
}
template<typename T>inline T gcd(T a, T b)
{
    if (b == 0)return a;
    else return gcd(b, a % b);
}
template<typename T>inline T bigmod(T a, T b, T m)
{
    if (b == 0)return 1;
    else if (b % 2 == 0)return S(bigmod(a, b / 2, m)) % m;
    else return (a % m*bigmod(a, b - 1, m)) % m;
}
const int inf = (int)1e9 + 5;
const ll linf = (ll)1e16 + 5;
const ll modd = (ll)1e9 + 7;
const int mod = 10000007;
/*#define N 20000009
bool prime[N];
vector<ll> prm;
void seive ()
{

    memset(prime, true, sizeof(prime));

    for( ll i=2; i*i<=N; i++)
    {
        if (prime[i] == true)
        {
            prm.pb(i);
            for (ll j=i*i; j<=N; j += i)
                pe[j] = false;
        }
    }
}*/
void pr (int f)
{
    if(f==1)
        cout<<"YES\n";
    else
        cout<<"NO\n";
}
bool isprime(ll n)
{
    if(n<2) return 0;
    if(n==2) return 1;
    else
    {
        for(int i=2; i*i<=n; i++)
            if(n%i==0) return 0;
    }
    return 1;
}

ll countSum(ll x)
{
    ll res = 0;
    while (x != 0)
    {
        res += (x % 10);
        x /= 10;
    }
    return res;
}
int used[1111111];
bool cmp(string a,string b)
{
    if(a.sz==b.sz)
        return a<b;
    else
        return a.sz<b.sz;
}
int main()
{
    fast;
    int n;
    string s ;
    cin >> n >> s;
    //cout << s <<endl;
 for ( int i=0;i<n-1;i++)
 {
     if(s[i]==s[i+1])
     {
         s[i]='2';
     }
 }
 int cc = 0;
 //cout << s <<endl;
 for (int i=0;i<n;i++)
 {
     if(s[i]!='2') cc++;
 }
cout << cc <<endl;
}






Measured memory_bytes: 3720
from sys import stdin
import sys

[A, B, C, X, Y] = list(map(int, stdin.readline().rstrip().split()))

## C is expensive
if A + B <= 2 * C:
    print(A * X + B * Y)

else:
    minimum = float('inf')
    for Z in range(2 * 10**5 + 1):
        a = (max(0, X - Z // 2)) * A
        b = (max(0, Y - Z // 2)) * B
        c = Z * C
        minimum = min(minimum, (a + b + c))
    
    print(minimum)


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

namespace Prac
{
    class Program
    {
        static void Main(string[] args)
        {
            var input = Console.ReadLine();
            var inputs = input.Split(' ').Select(x => int.Parse(x)).ToArray();
            int count = 0;
            for (var i = inputs[0]; i <= inputs[1]; i++)
            {
                if (inputs[2] % i == 0) count++;
            }
            Console.WriteLine(count);
        }
    }
}

Measured memory_bytes: 5916
#include <iostream>

using namespace std;

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

    bool ans = false;

    for (int i = 1; i < 10; i++)
    {
        for (int j = 1; j < 10; j++)
        {
            if (i * j == N)
            {
                ans = true;
            }
        }
    }

    if (ans)
    {
        cout << "Yes" << endl;
    }
    else
    {
        cout << "No" << endl;
    }
}

Measured memory_bytes: 256
#include <string>
#include <vector>
#include <algorithm>
#include <numeric>
#include <set>
#include <map>
#include <queue>
#include <iostream>
#include <sstream>
#include <cstdio>
#include <cmath>
#include <cstring>
#include <errno.h>

using namespace std;

int main(){
	
	long long int A,B,C,K;
	long long int tmp;
	cin>>A>>B>>C>>K;
	if(K%2==0){
		tmp = A-B;
		if(errno==ERANGE){
			cout<<"Unfair"<<endl;
			return 0;
		}
		cout<<A-B<<endl;
	}else{
		tmp = B-A;
		if(errno==ERANGE){
			cout<<"Unfair"<<endl;
			return 0;
		}
		cout<<B-A<<endl;
	}
	
	return 0;
}

Measured memory_bytes: 256
//
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vi = vector<int>;
using vvi = vector<vi>;
// #define MOD 1000000007
#define rp(i,n) for(int i=0;i<(n);i++)
#define up(i,s,e,d) for(int i=(s);i<(e);i+=(d))
#define ot(x) cout<<(x)
#define ote(x) cout<<(x)<<endl
#define all(x) (x).begin(),(x).end()

int main(){
	int N; cin>>N;
	map<char,int> S;
	rp(i,N){
		char s;cin>>s;
		S[s]++;
	}

	cout<< (S.size()==3? "Three":"Four") <<endl;

}


Measured memory_bytes: 256
#include <iostream>
#include <set>
#include <vector>
#include <iomanip>

#include <cfenv>
#include <cmath>
typedef long long int ll;

using namespace std;

int main()
{


    int N;

    


    cin >> N;

    vector<int> X(N);


    int count = 0; 

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


        cin >> X[i]; 

        count += X[i];

    }


    double kasu =(double)count/(double)N;


    int ans =0;


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


         ans +=pow(X[i]-round(kasu),2);



     }


    cout << ans << endl;






    
    return 0;
}

Measured memory_bytes: 888
#include <bits/stdc++.h>
#define rep(i, a, n) for(int i = a; i < n; i++)
#define repb(i, a, b) for(int i = a; i >= b; i--)
#define all(a) a.begin(), a.end()
#define int long long
using namespace std;
typedef pair<int, int> P;

signed main(){
    int n;
    cin >> n;
    vector<int> a(n);
    rep(i, 0, n){
        cin >> a[i];
        a[i]--;
    }
    int ans = 0;
    rep(i, 0, n){
        int id = a[i];
        if(a[id] == i) ans++;
    }
    cout << ans / 2 << endl;
}

Measured memory_bytes: 1024
#include <bits/stdc++.h>
   
#define ll long long
#define F first
#define S second
#define pb push_back
using namespace std;
   
void data() {
    #ifdef NURS
        freopen("main.in", "r", stdin);
        freopen("main.out", "w", stdout);
    #endif
} 
const int N = 1e6 + 200;
ll kol[N];
int main ()
{
    data();
    #define int ll
    int n;
    cin >> n;
    int a[n + 1];
    ll s = 0;
    for (int i = 1; i <= n; i++)
    {
    	cin >> a[i]; s += a[i]; kol[a[i]]++;
    }         
    int q;
    cin >> q;
    for (int i = 1; i <= q; i++)
    {
    	int b, c;
    	cin >> b >> c;
    	s -= kol[b] * b;
    	s += kol[b] * c;
    	kol[c] += kol[b];
    	kol[b] = 0;
    	cout << s << '\n';
    }
}

Measured memory_bytes: 5148
#include <iostream>
#include <sstream>
#include <algorithm>
#include <string>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <stack>
#include <memory>
#include <complex>
#include <numeric>
#include <cstdio>
#include <iomanip>
#include <cmath>

#define REP(i,m,n) for(int i=int(m);i<int(n);i++)
#define EACH(i,c) for (auto &(i): c)
#define all(c) begin(c),end(c)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort(begin(c),end(c))
#define pb emplace_back
#define MP make_pair
#define SZ(a) int((a).size())

#ifdef LOCAL
#define DEBUG(s) cout << (s) << endl
#define dump(x)  cerr << #x << " = " << (x) << endl
#define BR cout << endl;
#else
#define DEBUG(s) do{}while(0)
#define dump(x) do{}while(0)
#define BR 
#endif
using namespace std;

using UI = unsigned int;
using UL = unsigned long;
using LL = long long int;
using ULL = unsigned long long;
using VI = vector<int>;
using VVI = vector<VI>;
using VLL = vector<LL>;
using VS = vector<string>;
using PII = pair<int,int>;
using VP = vector<PII>;

//struct edge {int from, to, cost;};

constexpr double EPS = 1e-10;
constexpr double PI  = acos(-1.0);
//constexpr int INF = INT_MAX;

template<class T> inline T sqr(T x) {return x*x;}

int main() {
	int n;
	cin >> n;
	int sum = 0;
	VI a(n);
	REP(i,0,n) {
		cin >> a[i];
		sum += a[i];
	}
	int dst = round(1.0*sum/n);
	int ans = 0;
	REP(i,0,n) {
		ans += (a[i] - dst) * (a[i] - dst);
	}
	cout << ans << endl;

	return 0;
}

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

#define SIS std::ios::sync_with_stdio(false),cin.tie(0),cout.tie(0);
#define lowbit(x) (x & -x)
#define PI 3.14159265358979323846264338327950L
typedef long long ll;
using namespace std;
const int MAX = 0x7ffffff;
int t;

void slove()
{
	int n;cin >> n;
	string s;cin >> s;
	int ans = 0;
	for(int i = 1;i < n - 1;i ++)
	{
		string l = s.substr(0, i);
		string r = s.substr(i , n - i);
		vector<bool> vis(100 , 0);
		int cnt = 0;
		for(int i = 0;i < l.size();i ++)
			vis[l[i] - 'a'] = 1;
		for(int i = 0;i < r.size();i ++)
			if(vis[r[i] - 'a']){
				cnt++;
				vis[r[i] - 'a'] = 0;
			}
		ans = max(cnt , ans);
	}	
	cout << ans << endl;
}
int main()
{
	SIS;
	slove();
}

Measured memory_bytes: 3588
#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef long double ld;
ll mod = 1000000007;
double pi = 3.14159265358979;

ll r(ll x, ll y) {
  if (y == 0) return 1;
  else if (y % 2 == 0) return r(x, y/2) * r(x, y/2) % mod;
  else return x * r(x, (y-1)/2) % mod * r(x, (y-1)/2) % mod;
}

int main() {
  ll n;
  cin >> n;
  priority_queue<ll> q;
  vector<ll> v(n);
  vector<ll> c(1000005, 0);
  for (int i = 0; i < n; i++) {
    cin >> v[i];
    c[v[i]]++;
    if (c[v[i]] == 1) q.push(v[i]);
  }
  sort(v.begin(), v.end());
  ll count = 0;
  for (int i = 0; i < n; i++) {
    if (c[v[i]] > 0) {
      int j = 2;
      while (v[i] * j <= q.top()) {
        c[v[i] * j] = 0;
        j++;
      }
      if (c[v[i]] == 1) {
        count++;
      }
    }
  }
  cout << count <<endl;
}

Measured memory_bytes: 14656
import sys

stdin = sys.stdin

ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline().rstrip()  # ignore trailing spaces
nl = lambda: list(map(int, stdin.readline().split()))

n = ni()
d = na()
d.sort()
l = d[n//2-1]
r = d[n//2]
if l != r:
    print(r-(l+1)+1)
else:
    print(0)

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

//repetition
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define rep(i, n) for(int i = 0; i < (int)(n); i++)

//container util
#define all(x) (x).begin(),(x).end()

//typedef
typedef long long ll;
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<ll> VLL;
typedef vector<VLL> VVLL;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef pair<ll, ll> PLL;
#define _A 0
#define _G 1
#define _C 2
#define _T 3
int mod = 1e9+7;
//conversion
inline int toInt(string s) {int v; istringstream sin(s);sin>>v;return v;}
template<class T> inline string toString(T x) {ostringstream sout;sout<<x;return sout.str();}

int dp[101][4][4][4];

int main(){
  int n;
  cin >> n;
  dp[0][3][3][3] = 1;

  rep(len,n){
    rep(prev3,4){
      rep(prev2,4){
        rep(prev1,4){
          rep(word,4){
            if(dp[len][prev3][prev2][prev1] == 0) continue;

            if( prev3 == _A && prev1 == _G && word == _C) continue;
            if( prev2 == _A && prev1 == _C && word == _G) continue;
            if( prev2 == _G && prev1 == _A && word == _C) continue;
            if( prev2 == _A && prev1 == _G && word == _C) continue;
            if( prev3 == _A && prev2 == _G && word == _C) continue;

            dp[len+1][prev2][prev1][word] += dp[len][prev3][prev2][prev1];
            dp[len+1][prev2][prev1][word] %= mod;

          }
        }
      }
    }
  }
  int ans = 0;
  rep(prev3,4){
    rep(prev2,4){
      rep(prev1,4){
        ans += dp[n][prev3][prev2][prev1];
        ans %= mod;
      }
    }
  }
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main(){
  int N;
  cin >> N;
  bool b = false;
  for (int i = 1; i < 10; i++) {
    for (int j = i; j < 10; j++) {
      if (N == i * j) {b = true;}
    }
  }
  if (b) {cout << "Yes" << endl;}
  else {cout << "No" << endl;}
}

Measured memory_bytes: 3644
import java.util.Scanner;
public class Main {
	public static void main(String[] args) {
		Scanner stdIn=new Scanner(System.in);
		int A=stdIn.nextInt();
		int B=stdIn.nextInt();
		if(A>8)
			System.out.println(":(");
		else
			if(B>8)
				System.out.println(":(");
			else
				System.out.println("Yay!");
	}
}

Measured memory_bytes: 21460
#include <cstdio>
#include <iostream>
#include <cstring>
#include <algorithm>
#include <cmath>
#include <queue>
using namespace std;
const long long INF = 0x3f3f3f3f3f3f3f3f;
void SPFA(int st);
queue<int> q;
long long dis[1005] = {};
int n,m,timee[1005] = {};
bool flag, vis[1005];
vector< pair<int, long long> > a[100005];

int main()
{
    scanf("%d%d",&n,&m);
//    flag=1;
//        for(int i = 0; i <= n; ++i)
//        {
//            dis[i] = -INF;
//            for(int j = 0; j <= n; ++j)
//            {
//                a[i][j] = a[j][i] = -INF;
//            }
//        }
//        cout << dis[1] << endl;
//    memset(dis, 0x3f, sizeof(dis));
    int a1,a2;
    long long a3;
    for(int j=0; j<m; ++j)
    {

        scanf("%d%d%lld",&a1,&a2,&a3);
        a[a1].push_back({a2, -a3});
    }

    SPFA(1);

    if(timee[n] > n)
        cout<<"inf"<<endl;
    else
    {
//            for(int i = 1; i <= n; ++i)
//                cout << dis[i] << ' ';
//            cout << endl;
        cout << (-dis[n]) << endl;
    }
    return 0;
}
void SPFA(int st)
{
    for(int i = 0; i <= n; ++i)
    {
        dis[i] = INF;
    }
    dis[st]=0;
    q.push(st);
    vis[st] = 1;
    timee[1] = 1;
    while(!q.empty())
    {
        int i=q.front();
        q.pop();
        vis[i] = 0;
        vector< pair<int, long long> >::iterator it;
        for(it = a[i].begin(); it != a[i].end(); ++it)
//        for (auto it : a[i])
        {
            if(dis[it->first] > dis[i] + it->second)
            {
                dis[it->first] = dis[i] + it->second;
                if(!vis[it->first])
                {
                    timee[it->first]++;
                    if(timee[it->first] > 2 * n)
                    {
                        flag=0;
                        return ;
                    }
                    q.push(it->first);
                    vis[it->first] = 1;
                }
//                printf("i1 = %d", i1);
            }
        }
    }
}


Measured memory_bytes: 2688
#include <cmath>
#include <iostream>
#include <stdio.h>
#include <string>
#include <sstream>
#include <iomanip>
#include <algorithm>
#include <vector>
#include <set>
#include <limits.h>
#include <map>
#include <numeric>

namespace test {
	std::string to_string (char val) {
		return std::string (1, val);
		// return std::string{val};
	}
	//if( str.find ("r") != string::npos)
}

using namespace std;
typedef long long int llint;

int main (void) {
	string s; cin >> s;
	for (auto it = s.begin (); it != s.end (); it++) {
		cout << (*it == ',' ? ' ' : *it );
	}
	cout << endl;
	return 0;
}

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

int main() {
    int n, w;
    while(cin >> n >> w, n) {
        vector<int> v(n);
        for(int i=0; i<n; ++i) {
            cin >> v[i];
        }
        sort(v.begin(), v.end());
        vector<int> hist(v[v.size()-1]/w+1, 0);
        for(int i=0; i<v.size(); ++i) {
            hist[v[i]/w] += 1;
        }
        double max_num = static_cast<double>(*max_element(hist.begin(), hist.end()));
        double ret = 0.01;

        for(int i=0; i<hist.size(); ++i) {
            ret += hist[i]/max_num * (hist.size()-i-1) / (hist.size()-1);
        }

        cout << fixed << setprecision(8) << ret << endl;
    }
}


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

using namespace std;
#ifdef _DEBUG
#define _GLIBCXX_DEBUG
#include "dump.hpp"
#else
#define dump(...)
#endif

#define int long long
#define ll long long
#define ll1 1ll
#define ONE 1ll
#define DBG 1
#define rep(i, a, b) for (int i = (a); i < (b); i++)
#define rrep(i, a, b) for (int i = (b)-1; i >= (a); i--)
#define loop(n) rep(loop, (0), (n))
#define all(c) begin(c), end(c)
const int INF =
    sizeof(int) == sizeof(long long) ? 0x3f3f3f3f3f3f3f3fLL : 0x3f3f3f3f;
const int MOD = (int)(1e9) + 7;
const double PI = acos(-1);
const double EPS = 1e-9;
#define fi first
#define se second
#define pb push_back
#define eb emplace_back
using pii = pair<int, int>;
// template<class T> ostream &operator<<(ostream &os,T &t){dump(t);return os;}
template <typename T, typename S>
istream &operator>>(istream &is, pair<T, S> &p) {
  is >> p.first >> p.second;
  return is;
}
template <typename T, typename S>
ostream &operator<<(ostream &os, pair<T, S> &p) {
  os << p.first << " " << p.second;
  return os;
}

template <typename T> void printvv(const vector<vector<T>> &v) {
  cerr << endl;
  rep(i, 0, v.size()) rep(j, 0, v[i].size()) {
    if (typeid(v[i][j]).name() == typeid(INF).name() and v[i][j] == INF) {
      cerr << "INF";
    } else
      cerr << v[i][j];
    cerr << (j == v[i].size() - 1 ? '\n' : ' ');
  }
  cerr << endl;
}
/*
   typedef __int128_t Int;
   std::ostream &operator<<(std::ostream &dest, __int128_t value) {
   std::ostream::sentry s(dest);
   if (s) {
   __uint128_t tmp = value < 0 ? -value : value;
   char buffer[128];
   char *d = std::end(buffer);
   do {
   --d;
 *d = "0123456789"[tmp % 10];
 tmp /= 10;
 } while (tmp != 0);
 if (value < 0) {
 --d;
 *d = '-';
 }
 int len = std::end(buffer) - d;
 if (dest.rdbuf()->sputn(d, len) != len) {
 dest.setstate(std::ios_base::badbit);
 }
 }
 return dest;
 }

 __int128 parse(string &s) {
 __int128 ret = 0;
 for (int i = 0; i < s.length(); i++)
 if ('0' <= s[i] && s[i] <= '9')
 ret = 10 * ret + s[i] - '0';
 return ret;
 }
 */

#ifndef _DEBUG
#define printvv(...)
#endif
void YES(bool f) { cout << (f ? "YES" : "NO") << endl; }
void Yes(bool f) { cout << (f ? "Yes" : "No") << 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;
}

signed main(signed argc, char *argv[]) {
  cin.tie(0);
  ios::sync_with_stdio(false);
  cout << fixed << setprecision(12);


  int a, b, c; cin >> a >> b >> c;
  cout<<(a-c)/(b+c)<<endl;


  return 0;
}


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

int main(){
    int H,W;
    cin >> H >> W;
    for(int i=0;i<=H+1;i++){
        for(int j=0;j<=W+1;j++){
            if(i==0||i==H+1||j==0||j==W+1){
                cout << "#";
                if(j==W+1) cout << "\n" ;
            }
            else{
                char a;
                cin >> a;
                cout << a ;
            }
        }
    }
    return 0;
}

Measured memory_bytes: 256
#include<stdio.h>
#define MAX 50



typedef struct cell{
 int id;
 struct cell *right;
 struct cell *left;
 struct cell *parent;
}cell;


void postorder(cell *root,cell N[],int x){
cell *p=root;
if(p->left!=NULL){postorder(p->left,N,x);}
if(p->right!=NULL){postorder(p->right,N,x);}

if(p->id!=x){printf("%d ",p->id);}
else{printf("%d",p->id);}

return;
}


int reconstruction(int A[],int B[],int start,int last,cell N[],int n){
int i,j;
int a,b;
int x;


if(start!=last){/*要素二つ以上*/

 for(i=0;i<n;i++){
  for(j=start;j<=last;j++){

   if(B[j]==A[i]){x=A[i];
    a=reconstruction(A,B,start,j-1,N,n);
    if(a!=-1){

     N[A[i]].left=&N[a];
     N[a].parent=&N[A[i]];
    }
    else{
     N[A[i]].left=NULL;
    }

    b=reconstruction(A,B,j+1,last,N,n);
    if(b!=-1){
     N[A[i]].right=&N[b];
     N[b].parent=&N[A[i]];
    }
    else{
     N[A[i]].right=NULL;
    }

    return x;
   }

  }/*for j end*/

 }/*for i end*/

}/*ifおわり*/


if(start==last){/*要素一つ*/
 N[B[start]].right=NULL;
 N[B[start]].left=NULL;
 return B[start];
}

if(start>last){
 return -1;
}




}




int main(){
int n,i;
int A[MAX];
int B[MAX];
cell N[MAX];
cell *root;
int x;

scanf("%d",&n);
for(i=0;i<n;i++)scanf("%d",&A[i]);
for(i=0;i<n;i++)scanf("%d",&B[i]);

for(i=0;i<=n;i++)N[i].id=i;


x=reconstruction(A,B,0,n-1,N,n);

root=&N[x];



postorder(root,N,x);
printf("\n");

return 0;
}


Measured memory_bytes: 2056
a,b,c,d =map(int,input().split())
takalife=a
aokilife=c
for i in range(101):
  aokilife=aokilife-b
  if aokilife<=0:
      print("Yes")
      exit()
  takalife=takalife-d
  if takalife<=0:
      print("No")
      exit()

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

#define fr first
#define sc second
#define mk make_pair
#define pb push_back

using namespace std;

const int N = 1e6 + 5;

vector<pair <int, int>> a;
bool look[N];
map <pair <int, int>, int> mp, used;
long long cnt[20], h, w;
int x[10] = {0, 0, 0, -1, -1, 1, 1, -1, 1};
int y[10] = {0, -1, 1, -1, 1, -1, 1, 0, 0};

int main() {
	int n;
	cin >> h >> w >> n;
	for (int i = 0; i < n; i ++) {
		pair <int, int> A;
		cin >> A.fr >> A.sc;
		mp[A] = true;
		for (int j = 0; j < 9; j ++) {
			pair <int, int> per = mk(max(2, min(A.fr + x[j], (int)h - 1)), max(2, min(A.sc + y[j], (int)w - 1)));
			if (!used[per]){
				used[per] = true;
				a.pb(per);
			}
		}
	}
	
	for (int i = 0; i < a.size(); i ++) {
		int cn = 0;
		for (int j = 0; j < 9; j ++) {
			pair <int, int> per = mk(a[i].fr + x[j], a[i].sc + y[j]);
			cn += mp[per];
		}
		cnt[cn] ++;
	}
	
	cnt[0] = (h - 2) * (w - 2) - (long long)a.size();
	
	for (int i = 0; i < 10; i ++) {
		cout << cnt[i] << endl;
	}
	return 0;
}










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


void __print(int x) {cerr << x;}
void __print(long x) {cerr << x;}
void __print(long long x) {cerr << x;}
void __print(unsigned x) {cerr << x;}
void __print(unsigned long x) {cerr << x;}
void __print(unsigned long long x) {cerr << x;}
void __print(float x) {cerr << x;}
void __print(double x) {cerr << x;}
void __print(long double x) {cerr << x;}
void __print(char x) {cerr << '\'' << x << '\'';}
void __print(const char *x) {cerr << '\"' << x << '\"';}
void __print(const string &x) {cerr << '\"' << x << '\"';}
void __print(bool x) {cerr << (x ? "true" : "false");}
# define M_PI    3.14159265358979323846
template<typename T, typename V>
void __print(const pair<T, V> &x) {cerr << '{'; __print(x.first); cerr << ','; __print(x.second); cerr << '}';}
template<typename T>
void __print(const T &x) {int f = 0; cerr << '{'; for (auto &i : x) cerr << (f++ ? "," : ""), __print(i); cerr << "}";}
void _print() {cerr << "]\n";}
template <typename T, typename... V>
void _print(T t, V... v) {__print(t); if (sizeof...(v)) cerr << ", "; _print(v...);}

#define fo(i, n) for(int i=0; i<n; i++)
#define Fo(i, k, n) for(int i=k; i<n; i++)
#define w(x)  int x; cin>>x; while(x--)
#define watch(x) cout << (#x) << " is " << (x) << "\n"
#define watch2(x,y) cout <<(#x)<<" is "<<(x)<<" and "<<(#y)<<" is "<<(y)<<"\n"
#define watch3(x,y,z) cout <<(#x)<<" is "<<(x)<<" and "<<(#y)<<" is "<<(y)<<" and "<<(#z)<<" is "<<(z)<<"\n"
#define watch4(x,y,z,q) cout <<(#x)<<" is "<<(x)<<" and "<<(#y)<<" is "<<(y)<<" and "<<(#z)<<" is "<<(z)<<" and "<<(#q)<<" is "<<(q)<<"\n"
#define MOD 1000000007
#define INF 1000000007;
#define F first
#define S second
#define pb(x) push_back(x);


#define ll  long long
#define all(c) (c).begin(),(c).end()
#define endl "\n"

typedef vector<int> vl;
typedef vector< vl > vvl;
typedef pair< int, int> pll;
typedef map< int, int> mll;


#ifndef ONLINE_JUDGE
#define debug(x...) cerr << "[" << #x << "] = ["; _print(x)
#else
#define debug(x...)
#endif





void c_p_c()
{
#ifndef ONLINE_JUDGE
	ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#endif
}
void parray(int a[], int n) {
	for (int i = 0; i < n; i++) {
		cout << a[i] << " ";
	}
	cout << endl;
}
 int check(ll a, ll b){

 	ll a1=0,b1=0;
 	while(a){
 		a1++;
 		a/=10;
 	}
 	while(b){
 		b1++;
 		b/=10;
 	}


 	return max(a1,b1);


}

int main() {
	int i, m, k;
	long long int sum = 0;
	c_p_c();
	ll n;
	cin >> n;
	int mini=INF;
	for (ll i = 1; i * i <= n; ++i)
	{
		if (n%i==0){

			mini=min(mini,check(i,n/i));
		}
	}
	cout<<mini<<endl;



}

Measured memory_bytes: 3572
import java.util.*;

public class Main {
    public static void main(String args[]) throws Exception {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int[] arr = new int[n + 1];
        for(int i = 1; i <= n; i++)
        	arr[i] = sc.nextInt();
        boolean[] same = new boolean[n+1];
        for(int i = 1; i <= n; i++)
        	same[i] = (arr[i] == i);

        int cnt = 0;
        for(int i = 1; i <= n; i++) {
        	if(!same[i]) continue;
        	cnt++;
        	if(i < n && same[i+1]) i++;
        }
        System.out.println(cnt);
    }
}


Measured memory_bytes: 50800
N = int(input())
A = list(map(int,input().split()))
ans = 1
A.sort(reverse=True)
t = A.pop()
if t == 0:
    print(0)
    exit(0)

A.append(t)

for i in range(N):
    n = A[i]
    if ans * n > 10 ** 18:
        print(-1)
        exit(0)
    else:
        ans *= n
print(ans)



Measured memory_bytes: 21664
#include <bits/stdc++.h>
        using namespace std;
        #define int long long
const int MAX = 510000;
const int MOD =  998244353;
const int  Inv2 = (MOD+1)/2;
template <typename T>
void fwt(vector<T>& f,int n) {
  
    for (int i = 1; i < n; i <<= 1) {
        for (int j = 0; j < n; j++) {
            if ((j & i) == 0) {
                T x = f[j], y = f[j | i];
                f[j] = (x + y)%MOD, f[j | i] = (x+MOD - y)%MOD;
            }
        }
    }
}
template <typename T>
void ifwt(vector<T>& f,int n) {
    
    for (int i = 1; i < n; i <<= 1) {
        for (int j = 0; j < n; j++) {
            if ((j & i) == 0) {
                T x = f[j], y = f[j | i];
                f[j] = (x + y)%MOD *Inv2 %MOD, f[j | i] = (x+MOD - y) %MOD *Inv2 %MOD;
            }
        }
    }
}
     signed main(){
   int n,nn=1,t=1,m,a,b;
   for(int i=0;i<18;i++)t=(t*10)%MOD;
   cin>>n;
   while(nn<n)nn*=2;
 vector<int> p(nn,0),q(nn,0),r(nn,0),ban(n,0),henp[n],henq[n],henr[n];
 cin>>m;
 for(int i=0;i<m;i++){
         cin>>a>>b;a--;b--;
         if(a>b)swap(a,b);
         henp[a].push_back(b);
 }
        cin>>m;
 for(int i=0;i<m;i++){
         cin>>a>>b;a--;b--;
         if(a>b)swap(a,b);
         henq[a].push_back(b);
 }
 cin>>m;
 for(int i=0;i<m;i++){
         cin>>a>>b;a--;b--;
         if(a>b)swap(a,b);
         henr[a].push_back(b);
 }

priority_queue<int,vector<int>,greater<int>> que;
int mb=1;
 for(int i=n-1;i>=0;i--){
         ban[i]=0;
         for(int j=0;j<henp[i].size();j++)que.push(ban[henp[i][j]]);
         while(!que.empty()){
                 if(ban[i]==que.top())ban[i]++;
                
                 que.pop();
         }
        while(mb<=ban[i])mb*=2;
 }
 a=1;
 for(int i=0;i<n;i++){
         a=(a*t)%MOD;
        p[ban[i]]=(p[ban[i]]+a)%MOD;
 }
 for(int i=n-1;i>=0;i--){
         ban[i]=0;
         for(int j=0;j<henq[i].size();j++)que.push(ban[henq[i][j]]);
         while(!que.empty()){
                 if(ban[i]==que.top())ban[i]++;
                 que.pop();
         }
       while(mb<=ban[i])mb*=2;
 }
 a=1;
 for(int i=0;i<n;i++){
         a=(a*t)%MOD;
        q[ban[i]]=(q[ban[i]]+a)%MOD;
 }
 for(int i=n-1;i>=0;i--){
         ban[i]=0;
         for(int j=0;j<henr[i].size();j++)que.push(ban[henr[i][j]]);
         while(!que.empty()){
                 if(ban[i]==que.top())ban[i]++;
                 que.pop();
         }
        while(mb<=ban[i])mb*=2;
 }
 a=1;
 for(int i=0;i<n;i++){
         a=(a*t)%MOD;
        r[ban[i]]=(r[ban[i]]+a)%MOD;
 }
 fwt(p,mb);fwt(q,mb);
 for(int i=0;i<nn;i++)q[i]=(q[i]*p[i])%MOD;
 ifwt(q,mb);
 int ans=0;
 for(int i=0;i<nn;i++)ans=(ans+(q[i]*r[i])%MOD)%MOD;
 cout<<ans<<endl;


         
}

        


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


int main(){
	string o,e,ans;
	cin >> o >>e;

	int n = o.size()+e.size();

	for(int i=1;i<=n;i++){
		if(i%2){
			ans += o[0];
			o.erase(o.begin());
		} else {
			ans += e[0];
			e.erase(e.begin());
		}
	}

	cout << ans <<endl;


	return 0;
}

Measured memory_bytes: 256
/*Arnab's Code
*/
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define pb push_back
#define mp(a,b) make_pair(a,b)
#define vll vector<ll>
#define vii vector<int>
#define pll pair<ll,ll>
#define pii pair<int,int>/*Arnab's Code
*/
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define pb push_back
#define mp(a,b) make_pair(a,b)
#define vll vector<ll>
#define vii vector<int>
#define pll pair<ll,ll>
#define pii pair<int,int>
#define take(a,n) for(ll i=0;i<n;i++)cin>>a[i]
#define takes(a,n,st) for(ll i=st;i<n+st;i++)cin>>a[i]
ll sum(ll a[],ll n,ll s){ for(ll i=0;i<n;i++)s+=a[i]; return s;}
#define mod 1000000007
ll power(ll x, ll y, ll p)  {  
    ll res = 1;  
    x = x % p;   
    if (x == 0) return 0;  
    while (y > 0){  
        if (y & 1)  
            res = (res*x) % p;  
        y = y>>1;
        x = (x*x) % p;  
    }  
    return res;  
}
void solve(){
	ll n,i,tot1,tot2,x,tot;
	tot1=0;
	tot2=0;
	cin>>n;
	for(i=0;i<n;i++){
		cin>>x;
		tot1+=x;
		tot2+=(x*x);
		tot1%=mod;
		tot2%=mod;
	}
	tot1*=tot1;
	tot1%=mod;
	tot=(mod+tot1 - tot2)%mod;
	tot*=500000004;
	tot%=mod;
	cout<<tot;
	return;
}
int main(){
	ios::sync_with_stdio(false);
	cin.tie(NULL);
	#ifndef ONLINE_JUDGE
		freopen("input.txt","r",stdin);
		freopen("output.txt","w",stdout);
	#endif
	ll t,T;
//	cin>>T;
	T=1;
	for(t=1;t<=T;t++){
//		cout<<"Case #"<<t<<": ";
		solve();
	}
	return 0;
}


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

#define endl '\n'
#define ALL(a)  (a).begin(),(a).end()
#define ALLR(a)  (a).rbegin(),(a).rend()
#define spa << " " <<
#define test cout<<"test"<<endl;
#define fi first
#define se second
#define MP make_pair
#define PB push_back
#define EB emplace_back
#define rep(i,n,m) for(ll i = (n); i < (ll)(m); i++)
#define rrep(i,n,m) for(ll i = (m) - 1; i >= (ll)(n); i--)
using ll = long long;
using ld = long double;
const ll MOD = 1e9+7;
//const ll MOD = 998244353;
const ll INF = 1e18;
using P = pair<ll, ll>;
template<typename T>
void chmin(T &a,T b){if(a>b)a=b;}
template<typename T>
void chmax(T &a,T b){if(a<b)a=b;}
void pmod(ll &a,ll b){a=(a+b)%MOD;}
void pmod(ll &a,ll b,ll c){a=(b+c)%MOD;}
void qmod(ll &a,ll b){a=(a*b)%MOD;}
void qmod(ll &a,ll b,ll c){a=(b*c)%MOD;}
ll median(ll a,ll b, ll c){return a+b+c-max({a,b,c})-min({a,b,c});}
void ans1(bool x){if(x) cout<<"Yes"<<endl;else cout<<"No"<<endl;}
void ans2(bool x){if(x) cout<<"YES"<<endl;else cout<<"NO"<<endl;}
void ans3(bool x){if(x) cout<<"Yay!"<<endl;else cout<<":("<<endl;}
template<typename T1,typename T2>
void ans(bool x,T1 y,T2 z){if(x)cout<<y<<endl;else cout<<z<<endl;}  
template<typename T>
void debug(vector<vector<T>>&v,ll h,ll w){for(ll i=0;i<h;i++)
{cout<<v[i][0];for(ll j=1;j<w;j++)cout spa v[i][j];cout<<endl;}};
void debug(vector<string>&v,ll h,ll w){for(ll i=0;i<h;i++)
{for(ll j=0;j<w;j++)cout<<v[i][j];cout<<endl;}};
template<typename T>
void debug(vector<T>&v,ll n){if(n!=0)cout<<v[0];
for(ll i=1;i<n;i++)cout spa v[i];cout<<endl;};
template<typename T>
vector<vector<T>>vec(ll x, ll y, T w){
  vector<vector<T>>v(x,vector<T>(y,w));return v;}
ll gcd(ll x,ll y){ll r;while(y!=0&&(r=x%y)!=0){x=y;y=r;}return y==0?x:y;}
vector<ll>dx={1,0,-1,0,1,1,-1,-1};
vector<ll>dy={0,1,0,-1,1,-1,1,-1};
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...));
}
ostream &operator<<(ostream &os, pair<ll, ll>&p){
  return os << p.first << " " << p.second;
}  
int main(){
  cin.tie(nullptr);
  ios_base::sync_with_stdio(false);
  //cout<<fixed<<setprecision(10);
  ll res=0,buf=0;
  bool judge = true;
  ll n,t;cin>>n>>t;
  vector<P>a(n);
  rep(i,0,n)cin>>a[i].fi>>a[i].se;
  sort(ALL(a));
  auto dp=vec(n+1,t,0LL);
  rep(i,0,n){
    rep(j,0,t){
      if(j+a[i].fi<t)chmax(dp[i+1][j+a[i].fi],dp[i][j]+a[i].se);
      chmax(dp[i+1][j],dp[i][j]);
      chmax(res,dp[i][j]+a[i].se);
    }
  }
  cout<<res<<endl;
  return 0;
}

Measured memory_bytes: 70784
#include <bits/stdc++.h>
#define PI 3.14159265359
#define NIL (-1)
#define LL long long
using namespace std;
const int64_t MOD = 1e9 + 7;
const int INF = INT_MAX;

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

	int ans = INF;
	for (int i = 0; i < N; i++) {
		int c, t;
		cin >> c >> t;
		if (t <= T) ans = min(ans, c);
	}

	if (ans == INF) cout << "TLE" << endl;
	else cout << ans << endl;
}

Measured memory_bytes: 3636
//AtCoder ABC042 B - 文字列大好きいろはちゃんイージー / Iroha Loves Strings (ABC Edition)
#include <bits/stdc++.h>
using namespace std;
using lli=int64_t;

int main() {
    int N,L;
    cin>>N>>L;
    vector<string> S(N);
    for(auto&& s:S){
        cin>>s;
    }
    sort(S.begin(),S.end());
    for(const auto& s:S){
        cout<<s;
    }
    cout<<endl;
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define err(args...) {}
#ifdef DEBUG
#include "_debug.cpp"
#endif
using namespace std;
using ll = long long;
using ld = long double;
template <typename T> using lim = numeric_limits<T>;
template <typename T> istream& operator>>(istream& is, vector<T>& a) { for(T& x : a) { is >> x; } return is; }
int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    int a, b;
    cin >> a >> b;
    cout << max({a + a - 1, a + b, b + b - 1}) << endl;
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i, start, end) for (long long i = start; i < end; ++i)
#define all(x) (x).begin(), (x).end()
#define len(x) ((long long)(x).size())
#define g(a, b) __gcd((a), (b))
#define l(a, b) ((a) / __gcd((a), (b)) * (b))
using namespace std;
using ll = long long;
using ld = long double;
using vll = vector<ll>;
using vllvll = vector<vll>;
using pll = pair<ll, ll>;
template<class T>void print1d(T x,ll n=-1){if(n==-1)n=x.size();rep(i,0,n){cout<<x[i]<<' ';}cout<<'\n';}
template<class T>void print2d(T x,ll r=-1,ll c=-1){if(r==-1)r=x.size();if(c==-1)c=x[0].size();rep(i,0,r)print1d(x[i],c);}
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, class U>T rem(T a, U b) { return a - b*floor(a/b); }
template<class T>ld deg2rad(T deg) { return M_PI * deg / 180.0; }
template<class T>ld rad2deg(T rad) { return 180.0 * rad / M_PI; }
const long double pi = M_PI;
const long long big = 1LL << 50;
const long long inf = 1LL << 60;
const long long mod = 1e9 + 7;



int main()
{
        ll N;
        ll T, A;
        cin >> N >> T >> A;
        vll H(N);
        rep(i, 0, N) cin >> H[i];

        vector<ld> temps(N);
        rep(i, 0, N) {
                temps[i] = T - H[i] * 0.006;
        }

        ld mn = inf;
        ll ans = -1;
        rep(i, 0, N) {
                if (abs(A - temps[i]) < mn) {
                        ans = i;
                        mn = abs(A - temps[i]);
                }
        } 
        cout << ans + 1 << endl;
}

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

typedef long long ll;

#define pb push_back
#define rep(i, a, n) for(int i = (a); i < (n); i++)
#define dep(i, a, n) for(int i = (a); i >= (n); i--)
#define mod 1e9+7

__attribute__((constructor))
void initial() {
  cin.tie(0);
  ios::sync_with_stdio(false);
}

vector<vector<int> > ma(100001);
vector<vector<int> > m(2, vector<int>(100001, mod));

int saiki(int d, int p, int c) {
  if(m[d][p] <= c) return 0;
  m[d][p] = c;

  rep(i, 0, ma[p].size()) {
    saiki(d, ma[p][i], c + 1);
  }
}

int main() {
  int n;
  cin >> n;

  rep(i, 0, n - 1) {
    int a, b;
    cin >> a >> b;
    a--, b--;
    ma[a].pb(b);
    ma[b].pb(a);
  }

  saiki(0, 0, 0);
  saiki(1, n - 1, 0);

  int f = 0, s = 0;

  rep(i, 0, n) {
    if(m[0][i] > m[1][i]) s++;
    else f++;
  }

  cout << (f > s ? "Fennec" : "Snuke") << endl;
}


Measured memory_bytes: 11256
//include
//------------------------------------------
#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <queue>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <fstream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <string>
#include <cstring>
#include <ctime>
#include <climits>
#include <limits>

using namespace std;

//conversion
//------------------------------------------
inline int toInt(string s) { int v; istringstream sin(s); sin >> v; return v; }
template<class T> inline string toString(T x) { ostringstream sout; sout << x; return sout.str(); }

//math
//-------------------------------------------
template<class T> inline T sqr(T x) { return x * x; }

//typedef
//------------------------------------------
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef long long LL;

//container util
//------------------------------------------
#define ALL(a)  (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pair
#define SZ(a) int((a).size())
#define EACH(i,c) for(typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define EXISTch(s,c) ((((s).find_first_of(c)) != std::string::npos)? 1 : 0)//cがあれば1 if(1)
#define SORT(c) sort((c).begin(),(c).end())

#define REP(i,n) for(int i=0;i<(int)n;++i)
#define FOR(i,c) for(__typeof((c).begin())i=(c).begin();i!=(c).end();++i)

//constant
//--------------------------------------------
const double EPS = 1e-10;
const double PI = acos(-1.0);
const int INF = (int)1000000007;
const LL MOD = (LL)1000000007;//10^9+7
const LL INF2 = (LL)100000000000000000;//10^18

int main() {

	string s; cin >> s;
	int n = s.length();

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

	if (ans == INF)ans = n;
	cout << ans << endl;


	return 0;
}

Measured memory_bytes: 512
#define _CRT_SECURE_NO_WARNINGS
#include <bits/stdc++.h>
using namespace std;
static const int N = 100;

int n;
int M[N][N];
int vis[N];
int seq[N];

void bfs_print() {
	for (int i = 0; i < n; i++) {
		cout << i + 1 << ' ' << seq[i]<<endl;
	}
}

int main() {
	cin >> n;
	int u, k;
	int index;

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

	for (int i = 0; i < n; i++) {
		cin >> u >> k;
		for (int j = 0; j < k; j++) {
			cin >> index;
			M[u - 1][index - 1] = 1;
		}
	}
	for (int i = 0; i < n; i++) {
		seq[i] = 0;
		vis[i] = 0;
		if(i >0) seq[i] = -1;
	}

	queue<int> q;
	q.push(0);
	seq[0] = 0;
	int t;
	while (not q.empty()) {
		vis[q.front()] = 1;
		for (int i = 0; i < n; i++) {
			if (M[q.front()][i] == 1 and vis[i] == 0) {
				vis[i] = 1;
				seq[i] = seq[q.front()] + 1;
				q.push(i);
			}
		}
		q.pop();
	}

	bfs_print();
}
//
//void dfs_visit(int u) {
//	color[u] = GRAY;
//	d[u] = ++tt;
//	for (int v = 0; v < n; v++) {
//		if (M[u][v] == 1 && color[v] == WHITE) {
//			dfs_visit(v);
//		}
//	}
//	color[u] = BLACK;
//	f[u] = ++tt;
//}
//
//void dfs_print() {
//	for (int i = 0; i < n; i++) color[i] = WHITE;
//	tt = 0;
//	for (int i = 0; i < n; i++) {
//		if (color[i] == WHITE) {
//			dfs_visit(i);
//		}
//	}
//
//	for (int i = 0; i < n; i++) {
//		cout << i + 1 << ' ' << d[i] << ' ' << f[i] << endl;
//	}
//}
//

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

#define EPS (1e-7)
#define INF (1e9)
#define PI (acos(-1))
//const ll mod = 1000000007;

int main() {
    //cout.precision(10);
    int n, m;
    cin >> n >> m;
    int a[400][400];
    for(int i = 1; i <= n; i++){
        for(int j = 1; j <= m; j++){
            cin >> a[i][j];
        }
        a[i][m + 1] = -1;
    }
    int ok = n;
    int ng = 0;
    int index[400];
    bool open[400];
    int attend[400];
    while(ok - ng > 1){
        int mid = (ok + ng) / 2;
        //cout << mid << endl;
        for(int i = 1; i <= 300; i++){
            index[i] = 1;
            open[i] = true;
        }
        int over = -1;
        while(true){
            over = -1;
            for(int i = 1; i <= 300; i++){
                attend[i] = 0;
            }
            for(int i = 1; i <= n; i++){
                attend[a[i][index[i]]]++;
                if(attend[a[i][index[i]]] > mid){
                    over = a[i][index[i]];
                    //cout << over << endl;
                    break;
                }
            }
            //cout << over << endl;
            if(over == -1){
                 ok = mid;
                break;
            }
            bool checker = false;
            open[over] = false;
            for(int i = 1; i <= n; i++){
                while(open[a[i][index[i]]] == false){
                    index[i]++;
                    if(index[i] > m){
                        checker = true;
                        break;
                    }
                }
            }
            //cout << 2 << " " << index[2] << endl;
            if(checker){
                //cout << "checker" << endl;
                ng = mid;
                break;
            }
        }
    }
    cout << ok << endl;
    return 0;
}


Measured memory_bytes: 768
#include<bits/stdc++.h>
#define clr(x)  memset(x,0,sizeof(x))
using namespace std;

long long ar[500005],visit[500005],len;
map<long long,long long>ma;
pair<long long,long long>pa;

string s,ss;

struct st
{
    long long a,b,c;
    string s;
};

long long vv[500005];


int main()
{
    long long i,j,k,n,ans=0,a,b,c,tc,x=0,m;
    cin>>n;
    for(i=0;i<n;i++)
        {
            cin>>ar[i];
            vv[i]=ar[i];
        }
    sort(ar,ar+n);
    for(i=0;i<n;i++)
    {
        if(ar[n-1]==vv[i]) cout<<ar[n-2]<<endl;
        else cout<<ar[n-1]<<endl;
    }


    return 0;

}


Measured memory_bytes: 9344
#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <exception>
#include <fstream>
#include <functional>
#include <iomanip>
#include <ios>
#include <iosfwd>
#include <iostream>
#include <istream>
#include <iterator>
#include <limits>
#include <list>
#include <locale>
#include <map>
#include <memory>
#include <new>
#include <numeric>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdexcept>
#include <streambuf>
#include <string>
#include <typeinfo>
#include <utility>
#include <valarray>
#include <vector>
#include <array>
#include <atomic>
#include <chrono>
#include <condition_variable>
#include <forward_list>
#include <future>
#include <initializer_list>
#include <mutex>
#include <random>
#include <ratio>
#include <regex>
#include <scoped_allocator>
#include <system_error>
#include <thread>
#include <tuple>
#include <typeindex>
#include <type_traits>
#include <unordered_map>
#include <unordered_set>
using namespace std;
using ll = long long;
#define MAX_N 1000001
#define MAX_M 100010
const long long mod = 1e9 + 7;
#define vec vector<int>
#define vecll vector<ll>
#define vecllvec vector<vector<ll>>
#define vecb vector<bool>
#define vecBvec vector<vector<bool>>
#define vecst vector<string>
#define veche vector<char>
#define vecd vector<double>
#define vecvec vector<vector<int>>
#define vecDvec vector<vector<double>>
#define vecHvec vector<vector<char>>
#define all(x) (x).begin(),(x).end()
#define ent cout<<endl
#define printvec(vec) for(int aqw=0;aqw<vec.size();aqw++){cout<<vec[aqw]<<" ";}ent;
#define rep(i,n) for(int i=0;i<(int)n;++i)
#define REP(i,m,n) for(int i=m;i<(int)n;++i)
#define INF 1e+9
#define P pair<int, int>;
#define PLL pair<ll, ll>;
#define MAX_V 1000
#define PI 3.141592653589793
// cout << setprecision(15) << std::fixed;

ll ans = INF;
ll twop(ll n, ll c) {
	if (n%2==1||n==0||c > ans) return c;
	n /= 2;
	twop(n, c + 1);
}

int main()
{
	int n;
	cin >> n;
	for (int i = 0;i < n;i++) {
		ll a;
		cin >> a;
		ans = min(ans, twop(a, 0));
	}
	cout << ans << endl;
}


Measured memory_bytes: 256
import java.util.Scanner;

public class Main {
	public static void main(String[] arg) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int i = 1;

		do {
			int x = i;
			if (x % 3 == 0) {
				System.out.print(" " + i);
				continue;
			}
			while (true) {
				if (x % 10 == 3) {
					System.out.print(" " + i);
					break;
				}
				x /= 10;
				if (x == 0) {
					break;
				}
			}

		} while (++i <= n);
		System.out.println();
	}

}

Measured memory_bytes: 28704
#!/usr/bin/env python3
from collections import defaultdict,deque
from heapq import heappush, heappop
from bisect import bisect_left, bisect_right
import sys, random, itertools, math
sys.setrecursionlimit(10**5)
input = sys.stdin.readline
sqrt = math.sqrt
def LI(): return list(map(int, input().split()))
def LF(): return list(map(float, input().split()))
def LI_(): return list(map(lambda x: int(x)-1, input().split()))
def II(): return int(input())
def IF(): return float(input())
def LS(): return list(map(list, input().split()))
def S(): return list(input().rstrip())
def IR(n): return [II() for _ in range(n)]
def LIR(n): return [LI() for _ in range(n)]
def FR(n): return [IF() for _ in range(n)]
def LFR(n): return [LI() for _ in range(n)]
def LIR_(n): return [LI_() for _ in range(n)]
def SR(n): return [S() for _ in range(n)]
def LSR(n): return [LS() for _ in range(n)]
mod = 1000000007
inf = float('INF')

#A
def A():
    d = {"Sunny":1 , "Cloudy":2, "Rainy":0}
    a = ["Sunny", "Cloudy", "Rainy"]
    print(a[d[input()]])
    return

#B
def B():
    s = S()
    for i, si in enumerate(s):
        if i % 2:
            if si == "R":
                print("No")
                return
        else:
            if si == "L":
                print("No")
                return
    print("Yes")
    return

#C
def C():
    n, k, q = LI()
    d = [0] * n
    for _ in range(q):
        a = II() - 1
        d[a] += 1
    for a in d:
        if k - (q - a) > 0:
            print("Yes")
        else:
            print("No")
    return

#D
def D():
    n, = LI()
    a = LI()
    q = []
    for ai in a:
        heappush(q, ai)
    for _ in range(m):
        heappush(q, heappop(q) / 2)
    ans = 0
    while q:
        ans += int(heappop(q))
    print(ans)
    return

#E
def E():
    return

#F
def F():
    return

#Solve
if __name__ == '__main__':
    B()


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

typedef long long ll;
const ll mod=1e9+7;

ll n,k,zero;
ll a[200005];
vector<ll> pos,neg;

void find_pos(){
    sort(pos.begin(),pos.end(),[](const ll &a,const ll &b){
        return a>b;
    });
    sort(neg.begin(),neg.end(),[](const ll &a,const ll &b){
        return a<b;
    });
    ll res=1;
    ll pi=0,ni=0;
    while(pi+1<pos.size()&&ni+1<neg.size()&&pi+ni+2<=k){
        if(pos[pi]*pos[pi+1]>neg[ni]*neg[ni+1]){
            res=res*pos[pi]%mod*pos[pi+1]%mod;
            pi+=2;
        }else{
            res=res*neg[ni]%mod*neg[ni+1]%mod;
            ni+=2;
        }
    }
    while(pi+1<pos.size()&&pi+ni+2<=k){
        res=res*pos[pi]%mod*pos[pi+1]%mod;
        pi+=2;
    }
    while(ni+1<neg.size()&&pi+ni+2<=k){
        res=res*neg[ni]%mod*neg[ni+1]%mod;
        ni+=2;
    }
    if(pi+ni<k){
        res=res*pos[pi]%mod;
    }
    cout<<(res+mod)%mod<<endl;
}

void find_neg(){
    sort(a,a+n,[](const ll &a,const ll &b){
        return abs(a)<abs(b);
    });
    ll res=1;
    for(ll i=0;i<k;i++){
        res=res*a[i]%mod;
    }
    cout<<(res+mod)%mod<<endl;
}

int main(){

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

    cin>>n>>k;
    for(ll i=0;i<n;i++){
        cin>>a[i];
        if(a[i]>0)pos.emplace_back(a[i]);
        if(a[i]==0)zero++;
        if(a[i]<0)neg.emplace_back(a[i]);
    }
    if(neg.size()-(neg.size()&1)+pos.size()>=k&&(k&1)<=pos.size()){
        find_pos();
    }else if(zero){
        cout<<"0\n";
    }else find_neg();

    return 0;
}

Measured memory_bytes: 6728
n,a,b = map(int,input().split())
h = [int(input()) for i in range(n)]
def judige(n):
    global h,a,b
    check = 0
    for i in range(len(h)):
        num = h[i]
        num -= b*n
        if num > 0:
            check += num//(abs(b-a)) if num % abs(b-a) == 0 else num//abs(b-a) + 1
    if check <= n:return True
    return False
inf = max(h)//b + 1
zero = 0
while True:
    num = (inf+zero)//2
    if inf-zero==1 or inf-zero==0:break
    if judige(num):inf = num
    else:zero = num
if judige(zero-2) and zero > 2:print(zero-2)
elif judige(zero-1) and zero > 1:print(zero-1)
elif judige(zero):print(zero)
else:print(inf)

Measured memory_bytes: 51844