akhauriyash/Code-Regression huggingface dataset:
#include<bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0; i<(n); i++)
#define FOR(i,x,n) for(int i=x; i<(n); i++)
#define ALL(n) begin(n),end(n)
#define MOD 1000000007
 
typedef long long ll;
typedef unsigned int ui;
typedef unsigned long long ull;

// cost, to
typedef pair<int, int> P;

int V, E, st;

void BellmanFord(vector<P> G[], ll dist[], int st, bool& has_negative){
    rep(i, V) dist[i]=INT64_MAX;
    dist[st] = 0;
    bool update=true;

    int cnt=0;
    while(update){
        update = false;
        cnt++;
        if(cnt==V) {has_negative=true; return;}
        rep(i, V){
            if(dist[i]==INT64_MAX) continue;
            for(auto e: G[i]){
                if(dist[e.second] > dist[i]+e.first){
                    dist[e.second] = dist[i] + e.first;
                    update = true;
                }
            }
        }
    }

    return;
}

void dijkstra(vector<P> G[], bool vis[], ll dist[], int st)
{
    priority_queue<P, vector<P>, greater<P>> min_heap;
    min_heap.push({0, st});
    rep(i, V) vis[i] = false;
    rep(i, V) dist[i] = INT64_MAX;
    dist[st] = 0;

    int frm, d;
    while(!min_heap.empty()){
        tie(d, frm) = min_heap.top(); min_heap.pop();
        if(vis[frm]) continue;

        // printf("node=%d\n", frm);
        vis[frm] = true;
        dist[frm] = d;

        for(P e: G[frm]){
            if(dist[e.second] > d+e.first)
                min_heap.push({d+e.first, e.second});
                // printf("(%d, %d) pushed\n", d+e.first, e.second);
        }
    }
}

int main()
{
    cin >> V >> E >> st;
    ll dist[V];
    bool vis[V];
    P edge;
    vector<P> G[V];

    int frm, to, cst;
    rep(i, E){
        scanf("%d %d %d", &frm, &to, &cst);
        G[frm].push_back({cst, to});
    }

    // dijkstra(G, vis, dist, st);
    bool has_negative=false;
    BellmanFord(G, dist, st, has_negative);

    if(V>1 && has_negative) {printf("NEGATIVE CYCLE\n"); return 0;}

    rep(i, V){
		if(dist[i] == INT64_MAX)
			printf("INF\n");
		else
			printf("%lld\n", dist[i]);
	}
}


Measured memory_bytes: 3236
import unittest


class TestB(unittest.TestCase):
    def test_1(self):
        self.assertEqual(think(150, [150, 140, 100, 200]), 2)

    def test_2(self):
        self.assertEqual(think(500, [499]), 0)

    def test_3(self):
        self.assertEqual(think(1, [100, 200, 300, 400, 500]), 5)


def solve():
    k, h = read()
    result = think(k, h)
    write(result)


def read():
    n, k = read_int(2)
    h = read_int(n)
    return k, h


def read_int(n):
    return list(map(lambda x: int(x), read_line().split(' ')))[:n]


def read_float(n):
    return list(map(lambda x: float(x), read_line().split(' ')))[:n]


def read_line(n=0):
    if n == 0:
        return input().rstrip()
    else:
        return input().rstrip()[:n]


def think(k, h):
    return len(list(filter(lambda x: x >= k, h)))


def write(result):
    print(result)


if __name__ == '__main__':
    # import sys
    # sys.setrecursionlimit(10000)
    # unittest.main()
    solve()

Measured memory_bytes: 14756
# -*- coding: utf-8 -*-

def reverse(text):
    tmp = list(text)
    tmp.reverse()
    return "".join(tmp)
    
a, b = map(int, input().split())

count = 0
for i in range(a, b + 1):
    text = str(i)
    reversed = reverse(text)
    # print("{} / {}".format(text, reversed))
    if text == reversed:
        count += 1

print(count)


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

// pbds
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/detail/standard_policies.hpp>
using namespace __gnu_pbds;
// gp_hash_table<int, int> table;

using namespace std;

#define vec vector
#define ALL(x) begin(x), end(x)

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

const int inf = 1000 * 1000 * 1000;
const ll inf64 = 1e18;

const int N = 5005;

int n;
int a[N];
vector< int > g[N];
ll dp[N][N][2];
ll buf[N][2];
int sz[N];

void go(int v, int par = -1) {
    sz[v] = 1;
    for(int to : g[v]) {
        if(to == par) continue;
        go(to, v);
        sz[v] += sz[to];
    }
}

inline void upd(ll &x, ll y) {
    if(x > y) x = y;
}

void dfs(int v, int par = -1) {
    dp[v][1][ a[v] < 0 ] = a[v];
    int cur = 1;
    for(int to : g[v]) {
        if(to == par) continue;
        dfs(to, v);

        for(int cv = 1;cv <= cur + sz[to];cv++) {
            for(int xv = 0;xv < 2;xv++) {
                buf[cv][xv] = inf64;
            }
        }

        for(int cto = 1;cto <= sz[to];cto++) {
            for(int xto = 0;xto < 2;xto++) {
                for(int cv = 1;cv <= cur;cv++) {
                    for(int xv = 0;xv < 2;xv++) {
                        if(dp[to][cto][xto] == inf64) continue;
                        if(dp[v][cv][xv] == inf64) continue;
                        if(dp[to][cto][xto] < 0 || !xto)
                            upd(buf[cv + cto][xv], dp[v][cv][xv]);
                        upd(buf[cv + cto - 1][xv | xto], dp[v][cv][xv] + dp[to][cto][xto]);
                    }
                }
            }
        }

        cur += sz[to];

        for(int cv = 1;cv <= cur;cv++) {
            for(int xv = 0;xv < 2;xv++) {
                dp[v][cv][xv] = buf[cv][xv];
            }
        }
    }
}

int main() {

#ifdef debug
    freopen("input.txt", "r", stdin);
#endif

    ios_base::sync_with_stdio(0);
    cin.tie(0);

    cin >> n;

    for(int v = 1;v <= n;v++) {
        cin >> a[v];
    }

    for(int u, v, i = 1;i < n;i++) {
        cin >> u >> v;
        g[u].push_back(v);
        g[v].push_back(u);
    }

    for(int v = 1;v <= n;v++) {
        for(int c = 1;c <= n;c++) {
            for(int x = 0;x < 2;x++) {
                dp[v][c][x] = inf64;
            }
        }
    }

    go(1);
    dfs(1);

    int res = n;

    for(int c = 1;c <= n;c++) {
        for(int x = 0;x < 2;x++) {
            if(dp[1][c][x] == inf64) continue;
            if(dp[1][c][x] < 0 || !x) {
                res = min(res, c - 1);
            }
        }
    }

    cout << res << "\n";

    return 0;
}


Measured memory_bytes: 392192
#include<bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i=0; i < n; i++)
#define repd(i, n) for (int i = n-1; i > -1; i--)
#define repran(i, a,b) for (int i = a; i<b;i++)
#define all(x) (x).begin(), (x).end()
typedef long long ll;
typedef pair<int, int> P;
int main()
{
    string s, t;
    cin >> s >> t;
    int n = s.size();
    int m = t.size();
    int ans = 10000;
    rep(i, n-m+1){
        int tmp = 0;
        rep(j, m){
            if (s[i+j] != t[j]) tmp++;
        }
        ans = min(ans, tmp);
    }
    cout << ans << endl;
}

Measured memory_bytes: 3620
/**
 *   @FileName	a.cpp
 *   @Author	kanpurin
 *   @Created	2020.05.16 16:54:53
**/

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

int main() {
    string s, t;
    cin >> s >> t;
    for (int i = 0; i < s.size(); i++) {
        if (s[i] != t[i]) {
            puts("No");
            return 0;
        }
    }
    puts("Yes");
    return 0;
}

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

int main()
{
	set<long long> s;	
	long q;

	cin >> q;

	for (long i = 0; i < q; i++) {
		int t;
		long long x;
		cin >> t >> x;

		if (t == 0) {
			s.insert(x);
			cout << s.size() << endl;
		}
		else if (t == 1) {
			int f = 1;
			if (s.find(x) == s.end())
				f = 0;
			cout << f << endl;
		}
		else if (t == 2)
			s.erase(x);
		else if (t == 3) {
			long long y;
			std::set<long long>::iterator it;

			cin >> y;

			for (it = s.lower_bound(x); it != s.upper_bound(y); it++)
				cout << *it << endl;
		}
	}

	return 0;
}


Measured memory_bytes: 12464
// vvvvvvvvvvvv TEMPLATE vvvvvvvvvvvv
#include <bits/stdc++.h>
using namespace std; using ll = long long; using P = pair<ll, ll>;
const ll linf = 1e18; const double eps = 1e-12, pi = acos(-1);
#define FOR(i,a,b) for (ll i=(a),__last_##i=(b);i<__last_##i;i++)
#define RFOR(i,a,b) for (ll i=(b)-1,__last_##i=(a);i>=__last_##i;i--)
#define REP(i,n) FOR(i,0,n)
#define RREP(i,n) RFOR(i,0,n)
#define __GET_MACRO3(_1, _2, _3, NAME, ...) NAME
#define each(i,a) for (auto&& i : a)
#define rep(...) __GET_MACRO3(__VA_ARGS__, FOR, REP)(__VA_ARGS__)
#define rrep(...) __GET_MACRO3(__VA_ARGS__, RFOR, RREP)(__VA_ARGS__)
#define pb push_back
#define eb emplace_back
#define all(a) begin(a),end(a)
#define chmin(x,v) x = min(x, v)
#define chmax(x,v) x = max(x, v)
#define min(x,y) (x < y ? x : y)
#define max(x,y) (x < y ? y : x)
template<typename Head> void out(Head h) { cout << h << endl; } template<typename Head, typename... Tail>void out(Head h, Tail... t) { cout << h << " "; out(t...); }
template<typename T> istream& operator>>(istream& is, vector<T>& v) { each(x,v) is >> x; return is; }
template<typename T> ostream& operator<<(ostream& os, const vector<T>& v) { rep(i,v.size()) { if (i) os << " "; os << v[i]; } return os; }
template<typename T> ostream& operator<<(ostream& os, const vector<string>& v) { rep(i,v.size()) { if (i) os << endl; os << v[i]; } return os; }
template<typename T> ostream& operator<<(ostream& os, const vector<vector<T>>& v) { rep(i,v.size()) { if (i) os << endl; os << v[i]; } return os; }
struct yes_no : std::numpunct<char> { string_type do_truename() const { return "Yes"; } string_type do_falsename() const { return "No"; } };
void solve(); int main() {
  ios::sync_with_stdio(false); cin.tie(0); locale loc(locale(), new yes_no); cout.imbue(loc); cout << fixed << setprecision(10) << boolalpha;
  solve();
}
// ^^^^^^^^^^^^ TEMPLATE ^^^^^^^^^^^^

void solve() {
  ll n; cin >> n;
  vector<ll> a(n); cin >> a;
  sort(all(a));
  vector<vector<ll>> dp(n, vector<ll>(n, 0));
  map<ll, ll> m;
  rep(i, n) m[a[i]] = i;
  rep(i, n) rep(j, i) {
    dp[j][i] = 2;
  }
  rep(i, n) rep(j, n) {
    if (dp[i][j] == 0) continue;
    // cout << i << " " << j << " " << dp[i][j] << endl;
    if (m.count(a[j] + a[j]-a[i]) > 0) {
      ll nj = m[a[j] + a[j]-a[i]];
      chmax(dp[j][nj], dp[i][j]+1);
    }
  }
  ll ans = 1;
  rep(i, n) rep(j, n) {
    chmax(ans, dp[i][j]);
  }
  cout << ans << endl;
}



Measured memory_bytes: 199064
#include<bits/stdc++.h>
using namespace std;
using Int = long long;
//BEGIN CUT HERE
struct Chien{
  int n;
  vector<Int> dat,laz;
  const Int def=0;
  Chien(){}
  Chien(int n_){init(n_);}
  void init(int n_){
    n=1;
    while(n<n_) n*=2;
    dat.clear();
    dat.resize(2*n-1,def);
    laz.clear();
    laz.resize(2*n-1,0);
  }
  inline void eval(int len,int k){
    if(k*2+1<n*2-1){
      laz[k*2+1]+=laz[k];
      laz[k*2+2]+=laz[k];
    }
    dat[k]+=laz[k]*len;
    laz[k]=0;
  }
  Int update(int a,int b,Int x,int k,int l,int r){
    eval(r-l,k);
    if(r<=a||b<=l) return dat[k]+laz[k]*(r-l);
    if(a<=l&&r<=b) return dat[k]+(laz[k]+=x)*(r-l);
    eval(r-l,k);
    return dat[k]=update(a,b,x,k*2+1,l,(l+r)/2)
      +update(a,b,x,k*2+2,(l+r)/2,r);
  }
  Int query(int a,int b,int k,int l,int r){
    eval(r-l,k);
    if(r<=a||b<=l) return def;
    if(a<=l&&r<=b) return dat[k];
    Int vl=query(a,b,k*2+1,l,(l+r)/2);
    Int vr=query(a,b,k*2+2,(l+r)/2,r);
    return vl+vr;
  }
  Int update(int a,int b,Int x){
    return update(a,b,x,0,0,n);
  }
  Int query(int a,int b){
    return query(a,b,0,0,n);
  }
};
//END CUT HERE

signed main(){
  int n,q;
  cin>>n>>q;
  Chien ch(n);
  for(int i=0;i<q;i++){
    Int c,s,t,x;
    cin>>c;
    if(c){
      cin>>s>>t;
      cout<<ch.query(s-1,t)<<endl;
    }else{
      cin>>s>>t>>x;
      ch.update(s-1,t,x);
    }
  }
}

/*
verified on 2017/02/24
http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=DSL_2_G&lang=jp
*/

Measured memory_bytes: 6956
#include <bits/stdc++.h>
// #include <atcoder/all>
using namespace std;
// using namespace atcoder;
typedef long long ll;
#define rep(i, n) for(ll i = 0, i##_len = (n); i < i##_len; i++)
#define reps(i, s, n) for(ll i = (s), i##_len = (n); i < i##_len; i++)
#define rrep(i, n) for(ll i = (n) - 1; i >= 0; i--)
#define rreps(i, e, n) for(ll i = (n) - 1; i >= (e); i--)
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define sz(x) ((ll)(x).size())
#define len(x) ((ll)(x).length())
#define endl "\n"
template<class T> void chmax(T &a, const T b){ a = max(a, b); }
template<class T> void chmin(T &a, const T b){ a = min(a, b); }

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    // ifstream in("input.txt");
    // cin.rdbuf(in.rdbuf());
    ll x;
    cin >> x;
    cout << ((x == 0) ? 1 : 0) << endl;
    return 0;
}


Measured memory_bytes: 3636
// _______  _____  _______  _____  _______ _______ _____ _______ _____ _    _ _______ 
// |       |     | |  |  | |_____] |______    |      |      |      |    \  /  |______ 
// |_____  |_____| |  |  | |       |______    |    __|__    |    __|__   \/   |______ 
//
//  _____   ______  _____   ______  ______ _______ _______ _______ _____ __   _  ______   /
// |_____] |_____/ |     | |  ____ |_____/ |_____| |  |  | |  |  |   |   | \  | |  ____  / 
// |       |    \_ |_____| |_____| |    \_ |     | |  |  | |  |  | __|__ |  \_| |_____| .  
//
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll,ll> P;
#define FOR(I,A,B) for(int I = (A); I < (B); ++I)

int main(){
	string a,b;
	cin >> a >> b;
	if(a[0]==b[2] && a[1]==b[1] && a[2]==b[0]){
		cout << "YES" << endl;
	}else{
		cout << "NO" << endl;
	}
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0; i<(n); i++)
#define pb push_back
#define all(v) (v).begin(),(v).end()
#define fi first
#define se second
#define sz(x) ((int)(x).size())
using ll=long long;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
#define MOD  1000000007
const ll INF=1e18;
template<class T>void show(vector<T>v){for (int i = 0; i < v.size(); i++){cerr<<v[i]<<" ";}cerr<<endl;}
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; }



int main(int argc, char const *argv[]) {
  int n;
  string s;
  cin >> n >> s;
  rep(i,sz(s)){
    char c=s[i];
    int x = c - 'A';
    x = (x + n) % 26;
    char tmp = x + 'A';
    cout << tmp ;
  }
  cout  << endl;
  return 0;
}

Measured memory_bytes: 3608
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
template <typename X> ostream& operator << (ostream& x,const vector<X>& v){for(ll i=0;i<v.size();++i) x<<v[i]<<" ";return x;}
template <typename X> ostream& operator << (ostream& x,const set<X>& v){for(auto it:v) x<<it<<" ";return x;}
template <typename X, typename Y> ostream& operator << (ostream& x, const pair<X,Y>& v) {x<<v.ff<<" "<<v.ss;return x;}
template <typename T, typename S> ostream& operator << (ostream& os, const map<T, S>& v) { for (auto it : v) os << it.first << "=>" << it.second << endl; return os; }
struct pair_hash {inline std::size_t operator()(const std::pair<ll, ll> & v) const {return v.first*31+v.second;}};
#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize ("O3")
#pragma GCC optimize ("unroll-loops")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#define speed ios_base::sync_with_stdio(false);cin.tie(NULL)
#define pb push_back
#define fr first
#define sc second
#define prnt(m) for(auto it = m.begin() ; it != m.end() ; ++it){cout<<*it<<endl;}
#define tra(it,m) for(auto it=m.begin();it!=m.end();++it)
#define DBG(x) cout<<"# # #     "<<x<<'\n';
#define fri(i,s,n) for(long long i=s;i<n;i++)
#define mod 1000000007LL
#define mod2 998244353
#define vct2 vector<vector<ll>>
#define vct vector<ll>
#define pll pair<ll,ll>
#define rz(n) resize(n)
#define all(v) v.begin(),v.end()
#define mkp make_pair
#define arrin(a,n) for(ll i = 0; i < n ; i++){cin>>a[i];}
#define arrout(a,n) for(ll i = 0;i < n; i++){cout<<a[i]<<" ";}
#define ex(s) cout<<s<<endl,exit(0);
#define infy 2e18
#define five 100005;
#define six 1000005;
#define printclock cerr<<"Time : "<<1000*(ld)clock()/(ld)CLOCKS_PER_SEC<<"ms\n";
//___________________________________________________________________________________________________________________________________________________________
const int N = 21;
ll dp[1<<21];
int mat[21][21];
int n;
int lim;
ll f(int i,int msk)
{
       if(i==n){
              return 1;
       }
       if(dp[msk] != -1){
              return dp[msk];
       }
       vector<int> ind;
       fri(j,0,n){
              if((msk & (1LL<<j))==0){
                     if(mat[i][j]){
                            ind.pb(j);
                     }
              }
       }
       dp[msk] = 0;
       for(int j : ind){
              int tt = msk | (1LL<<j);
              dp[msk] += f(i+1,tt);
              dp[msk] %= mod;
       }
       return dp[msk];
}
int main()
{
       cin>>n;
       fri(i,0,n){
              fri(j,0,n){
                     cin>>mat[i][j];
              }
       }
       memset(dp,-1,sizeof dp);
       cout<<f(0,0)<<endl;
}


Measured memory_bytes: 16640
#include <iostream>
#include <algorithm>
#include <vector>
#include <string>
#include <complex>
#include <stack>
#include <queue>
#include <list>
#include <unordered_map>
#include <utility>
#include <map>
#include <set>
using namespace std;

int main(){
    string s;
    cin >> s;
    int k;
    cin >> k;
    
    int count = 0;
    int i = 0;
    for(i = 0; i < s.length(); i++){
        if(s[i] != '1'){
            break;
        }
        count++;
    }
    
    //cout << count << endl;
    if(k == 1){
        cout << s[0] << endl;
    }else{
        if(k <= count){
            cout << '1' << endl;
        }else{
            cout << s[count] << endl;
        }
    }
}


Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <set>
#include <queue>
#include <map>

using namespace std;

typedef long long ll;
typedef long double ld;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<ld> vld;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;

#define INF ((int)1e9)
#define INFLL ((ll)1e18)
#define MOD (1000000007LL)


int main(int argc, const char * argv[]) {
    ios_base::sync_with_stdio(false);
    int N;
    cin >> N;
    set<string> Set;
    string tmp; string prev;
    cin >> tmp;
    prev = tmp;
    Set.insert(tmp);
    for (int n = 1; n < N; ++n) {
        cin >> tmp;
        if (tmp[0] != prev[prev.size()-1] || Set.count(tmp) > 0) {
            cout << "No" << endl;
            return 0;
        }
        Set.insert(tmp);
        prev = tmp;
    }
    cout << "Yes" << endl;

    return 0;
}


Measured memory_bytes: 256
N = int(input())
D = [int(x) for x in input().split()]
M = int(input())
T = [int(x) for x in input().split()]
flag = True
di = {}
for i in D:
    if(i in di):
        di[i]+=1
    else:
        di[i]=1
for i in T:
    if(i not in di):
        flag=False
        break
    elif(di[i]<=0):
        flag=False
        break
    else:
        di[i]-=1

if(flag):
    print('YES')
else:
    print('NO')


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

int main(){
    long n,a,b,c,d,e;
    cin >> n >> a >> b >> c >> d >> e;

    long slow = min(a, min( min(b,c) , min(d,e) ) );

    long slowstep;
    if(n % slow == 0) slowstep = n/slow;
    else slowstep = n/slow + 1;

    cout << 4 + slowstep << endl;
}   


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

typedef long long ll;
#define FOR(i, a, b) for (int i = (a); i < (b); i++)
#define REP(i, n) for (int i = 0; i < (n); i++)
#define ALL(a) (a).begin(), (a).end()
using namespace std;

int main() {
    int A, B;
    cin >> A >> B;
    cout << max(A + B, max(A - B, A * B)) << endl;
    return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main()
{
    ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
    set<int> array;
    int n,a;
    cin>>n;
    for (int i=0;i<n;i++)
    {
        cin>>a;
        array.insert(a);
    }
    if (array.size()!=n) cout<<"NO";
        else cout<<"YES";
    return 0;
}

Measured memory_bytes: 9600
//import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.Reader;

public class Main<T> {
	public static void main(String[] args) throws NumberFormatException, IOException {
		//System.setIn(new FileInputStream("./input.txt"));
		Reader r = new InputStreamReader(System.in);
		int n = r.read() - 0x30;
		//n = 5;
		//long start = System.nanoTime();
		
		Point[] p = Koch(n);
		//System.out.println((start - System.nanoTime())/ 1000 + " us");
		StringBuilder sb = new StringBuilder();
		for(int i = 0; i < p.length; ++i){
			sb.append(p[i] + "\n");
		}
		System.out.println(sb);
	}

	public static Point[] Koch(int n) {
		Point[] p, p2;
		if(n == 0){
			p = new Point[2];
			p[0] = new Point(0.0, 0.0);
			p[1] = new Point(100.0, 0.0);
			return p;
		}else{
			p = Koch(n-1);
			p2 = new Point[(p.length - 1)*4 + 1];
			for(int i = 0; i < p.length; ++i) {
				// left edge
				p2[i*4] = new Point(p[i].x, p[i].y);
				if(i == p.length - 1){
					break;
				}
				// 3 middle points
				double mx = (p[i+1].x - p[i].x);
				double my = (p[i+1].y - p[i].y);
				
				p2[i*4 + 1] = new Point(mx / 3.0 + p[i].x, my / 3.0 + p[i].y);
				p2[i*4 + 2] = new Point(mx / 2.0 - my / (2.0 * 1.7320508) + p[i].x,
						my / 2.0 + mx / (2.0 * 1.7320508) + p[i].y);
				p2[i*4 + 3] = new Point(mx * 2.0 / 3.0 + p[i].x, my * 2.0 / 3.0 + p[i].y);
			}
			return p2;
		}
	}

	
}
class Point {
	public double x;
	public double y;
	@Override
	public String toString(){
		return String.format("%.5f %.5f", x, y);
	}
	public Point(double x, double y){
		this.x = x;
		this.y = y;
	}
}

Measured memory_bytes: 42228
#include<bits/stdc++.h>
#define rep(i,n)for(int i=0;i<(n);i++)
using namespace std;
typedef pair<int, int>P;
 
struct st { int p, b, c; };
bool operator<(st a, st b) { return a.c>b.c; }
unordered_map<int, vector<int>>E[100000];
vector<int>G[100000];
unordered_map<int, int>d[100000];
int main() {
	int n, m; scanf("%d%d", &n, &m);
	rep(i, m) {
		int p, q, c; scanf("%d%d%d", &p, &q, &c); p--; q--;
		E[p][c].push_back(q); E[q][c].push_back(p);
		G[p].push_back(c); G[q].push_back(c);
	}
	priority_queue<st>que;
	d[0][0] = 0; que.push({ 0,0,0 });
	while (!que.empty()) {
		st p = que.top(); que.pop();
		if (d[p.p][p.b] != p.c)continue;
		if (d[p.p].find(0) == d[p.p].end() || d[p.p][0] > p.c) {
			d[p.p][0] = p.c;
			que.push({ p.p,0,p.c });
		}
		if (p.b == 0) {
			for (int v : G[p.p]) {
				if (d[p.p].find(v) == d[p.p].end() || d[p.p][v] > p.c + 1) {
					d[p.p][v] = p.c + 1;
					que.push({ p.p,v,p.c + 1 });
				}
			}
			continue;
		}
		for (int v : E[p.p][p.b]) {
			if (d[v].find(p.b) == d[v].end() || d[v][p.b] > p.c) {
				d[v][p.b] = p.c;
				que.push({ v,p.b,p.c });
			}
		}
	}
	int Min = INT_MAX;
	for (auto p : d[n - 1])Min = min(Min, p.second);
	if (Min == INT_MAX)puts("-1");
	else printf("%d\n", Min);
}


Measured memory_bytes: 80176
#include<iostream>
using namespace std;
int main()
{
	int a, b;
	while(true)
	{
		cin >> a >> b;
		if(a == 0 && b == 0)
			break;
		if (a > b)
			cout << b << " " << a << endl;
		else
			cout << a << " " << b << endl;
	}
	return 0;
}


Measured memory_bytes: 3008
#include<cstdio>
#include<climits>
#include<algorithm>
using namespace std;
int main()
{
	int h,w,a[25][25],i,j,k,l,mn,sum,x,y;
	scanf("%d %d",&h,&w);
	for(i=0;i<h;i++){
		for(j=0;j<w;j++){
			scanf("%d",&a[i][j]);
		}
	}
	mn=1000000;
	for(i=0;i<h;i++){
		for(j=0;j<w;j++){
			sum=0;
			for(k=0;k<h;k++){
				for(l=0;l<w;l++){
					x=k-i;
					y=l-j;
					if(x<0)	x*=-1;
					if(y<0)	y*=-1;
					sum+=a[k][l]*min(x,y);
				}
			}
			mn=min(mn,sum);
		}
	}
	printf("%d\n",mn);
	return 0;
}


Measured memory_bytes: 2716
#include <bits/stdc++.h>
#define endl '\n'
#define ll long long
using namespace std;


void lok(){
}

int main() {
    ios::sync_with_stdio(0);
    cin.tie(0);
    string t;
    cin>>t;
    for(auto &a:t){
    	if(a=='?'){
    		cout<<'D';
    	}
    	else cout<<a;
    }
    cout<<endl;
	return 0;
}


Measured memory_bytes: 3788
#include <iostream>
#include <cstdio>
#include<algorithm>
#include<cmath>
#include<vector>
using namespace std;

#define MAX 100
long long cnt = 0;
int l;
int n;
int a[1000000];
vector<int> G;

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

void shellSort(int a[], int n){
    for (int h = 1; ; ) {
        if(h > n)break;
        G.push_back(h);
        h = 3*h + 1;
    }
    
    for (int i = G.size() - 1;i >= 0 ; i--) {
        insertionSort(a, n, G[i]);
    }
}

int main(){
    
    cin >> n;
    for (int i = 0; i < n; i++) {
        cin >> a[i];
    }
    
    cnt = 0;
    
    shellSort(a, n);
    
    cout<<G.size()<<endl;
    for (int i = G.size() - 1; i >= 0; i--) {
        printf("%d",G[i]);
        if (i) {
            printf(" ");
        }
    }
    printf("\n");
    printf("%d\n",cnt);
    for(int i = 0;i < n;i++)    printf("%d\n",a[i]);
    
    return 0;

}

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

int main() {
    int w, h, x, y, r;
    cin >> w >> h >> x >> y >> r;
    if(x<r||y<r){
        cout << "No" << endl;
    }
    else if((w-x)<r||(h-y)<r){
        cout << "No" << endl;
    }
    else{
        cout << "Yes" << endl;
    }
    return 0;
}

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

int main(){
    vector<int> A;
    int q;
    cin>>q;
    int q1,q2;
    for (int i = 0; i < q; i++)
    {        
        cin>>q1;
        if (q1==0){
            cin>>q2;
            A.push_back(q2);
        }
        if (q1==1){
            cin>>q2;
            cout<<A[q2]<<endl;
        }
        if (q1==2) A.pop_back();
    }
    return 0;
}


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

main()
{
    string d, res;
    cin>>d;
    if(d=="A") res="T";
    else if(d=="C") res="G";
    else if(d=="G") res="C";
    else if(d=="T") res="A";
    cout<<res<<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 ); }

int N;
vector<ll> A;

void solve() {
    vector<ll> p, m;
    rep(i, N) {
        if (A[i] >= 0) p.pb(A[i]);
        else m.pb(A[i]);
    }
    sort(rall(p));
    sort(all(m));
    if (m.empty()) m.pb(p.back()), p.pop_back();
    if (p.empty()) p.pb(m.back()), m.pop_back();

    vector<pair<ll, ll>> res;
    ll cur = m[0];
    rep(i, p.size()-1) {
        res.pb({cur, p[i]});
        cur -= p[i];
    }
    res.pb({p.back(), cur});
    cur = p.back() - cur;

    REP(i, 1, m.size()) {
        res.pb({cur, m[i]});
        cur -= m[i];
    }

    cout << cur << endl;
    for (pair<ll, ll> x : res) {
        cout << x.fi << ' ' << x.se << endl;
    }
}

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

    cin >> N;
    A.resize(N);
    rep(i, N) cin >> A[i];
    solve();
    return 0;
}

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

string reverse(string text){
  int length = text.size();
  string reverse_string = text;
  
  for (int i = 0; i < length; i++) {
    reverse_string.at(i) = text.at(length - i - 1);
  }
  return reverse_string;
}

int check_kaibun(string text, string reverse_text){
  if (text == reverse_text){
    return 1;
  }
  else{
    return 0;
  }
}

int main() {
  string text, reverse_text;
  int A, B;
  int counter=0;
  cin >> A >> B;
  
  for (int i = 0; i < B-A+1; i++) {
    text = to_string(A + i);
    reverse_text = reverse(text);
    counter += check_kaibun(text, reverse_text);
  }
  cout << counter << endl;
}


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

#define rep(i, a, b) for (int i = (a), i##end = (b); i <= i##end; ++i)
#define per(i, a, b) for (int i = (a), i##end = (b); i >= i##end; --i)

mt19937 Rnd(chrono::high_resolution_clock::now().time_since_epoch().count());

template <typename T>
inline void chkmax(T &x, T y) { if (x < y) x = y; }

template <typename T>
inline void chkmin(T &x, T y) { if (x > y) x = y; }

inline int read() {
  #define nc getchar()
  int x = 0;
  char c = nc;
  while (c < 48) c = nc;
  while (c > 47) x = x * 10 + (c ^ 48), c = nc;
  return x;
  #undef nc
}

typedef long long ll;
int n, m;

void solve() {
  cin>>n>>m;
  int x=m-m/2,y=m/2;
  rep(i,1,x)printf("%d %d\n",i,x*2-i+1);
  rep(i,1,y)printf("%d %d\n",x*2+i,x*2+y*2-i+2);
}

int main() {
//  int T = read();
//  while (T--) solve();
  solve();
  return 0;
}


Measured memory_bytes: 3740
def main():
    import sys

    input = sys.stdin.readline

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

    L, R = 1, N
    for _ in range(M):
        left, right = map(int, input().split())
        L = max(L, left)
        R = min(R, right)
    ans = max(0, R - L + 1)
    print(ans)


if __name__ == '__main__':
    main()

# import sys
#
# sys.setrecursionlimit(10 ** 7)
#
# input = sys.stdin.readline
# rstrip()
# int(input())
# map(int, input().split())


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

using namespace std;


#define MOD 1000000007
#define ll long long int
#define ff first
#define ss second
#define N 100001


template <typename T,typename G>
ostream& operator << (ostream& out, const pair<T,G> &a) 
{return out<<"( "<<a.ff<<", "<<a.ss<<")";}

template <typename T>
ostream& operator << (ostream& out, const vector<T> &a) 
{out<<"[ ";for(const auto &i:a)out<<i<<", ";return out<<"]"<<endl;}

template <typename T>
ostream& operator << (ostream& out, const set<T> &a) 
{out<<"{ ";for(const auto &i:a)out<<i<<", ";return out<<"}"<<endl;}

template <typename T,typename G>
ostream& operator << (ostream& out, const map<T,G> &a) 
{out<<"< ";for(const auto &i:a)out<<i<<", ";return out<<">"<<endl;}
ll dp[100009][2][101];
string s;
ll k,n;
ll getSum(ll pos,ll mod,bool flag)
{
	if(dp[pos][flag][mod]!=-1)
		return dp[pos][flag][mod];
	if(pos>=n)
	{
		if(mod==0)
			return 1;
		return 0;
	}
	int lim=9;
	if(!flag)
		lim=s[pos]-'0';
	ll ans=0;
	for(int i=0;i<=lim;i++)
	{
		if(flag || i<lim)
			ans=(ans%MOD+getSum(pos+1,(mod%MOD+i%MOD)%k,true)%MOD)%MOD;
		else
			ans=(ans%MOD+getSum(pos+1,(mod%MOD+i%MOD)%k,false)%MOD)%MOD;
	}
	return dp[pos][flag][mod]=ans%MOD;
}
void solve()
{
	cin>>s;
	cin>>k;
	n=s.length();
	memset(dp,-1,sizeof(dp));

	ll ans=(getSum(0,0,0))%MOD;
	ans--;
	if(ans<0)
		ans=MOD-1;
	cout<<ans<<"\n";
}
	


int32_t main()
{
 
    //your code goes here...
    int t=1;
   // cin>>t;
    while(t--)
    {
        solve();
    }    
}

Measured memory_bytes: 158976
"use strict"
var int = x=>parseInt(x,10);var spln = x=>x.split(/\n/g);var spsp = x=>x.split(/\s/g);
function main(input) {
  var n = int(spln(input)[0]);
  var a = spln(input).slice(1,n+1);
  var s = new Set(a);
  if(a.length!==s.size){
    console.log('No');
    return;
  }else{
    for(let i=0;i<n;i++){  
    if(!(a[i+1])){
      continue;
    }else if(a[i].split('').pop()!==a[i+1][0]){
        console.log('No')
        return;
      }
    }
    console.log('Yes');
  }
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));


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

using namespace std;

using ll = long long;
using ld = long double;

using vi = vector<int>;
using vvi = vector<vi>;
using vll = vector<ll>;
using vvll = vector<vll>;
using vb = vector<bool>;
using vs = vector<string>;
using vld = vector<ld>;
using vvld = vector<vld>;

typedef pair<ll, ll> P;

#define bit(n) (1LL << (n))

//#define int long long

#define all(v) v.begin(), v.end()

#define rep(i, n) for (ll i = 0; i < n; i++)
#define REP(i, n) for (ll i = 1; i < n; i++)

#define FOR(i, a, b) for (ll i = (a); i < (b); i++)
#define FORm(i, m) for (auto i = m.begin(); i != m.end(); i++)

template <class T>
inline void chmax(T& a, T b) {
  a = std::max(a, b);
}
template <class T>
inline void chmin(T& a, T b) {
  a = std::min(a, b);
}

#define mod (ll)(1e9 + 7)
// #define mod (998244353ll)

const long long INF = 1LL << 60;

signed main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  cout << fixed << setprecision(20);

  string s;
  cin >> s;
  rep(i, 3) {
    cout << s[i];
  }
  cout << endl;

  return 0;
}


Measured memory_bytes: 3644
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.Arrays;

public class Main {
	public static void main(String[] args) throws Exception {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int n = Integer.parseInt(br.readLine());
		int[] x = new int[n];
		int[] y = new int[n];
		for (int i = 0; i < n; i++) {
			String[] sa = br.readLine().split(" ");
			int a = Integer.parseInt(sa[0]);
			int b = Integer.parseInt(sa[1]);
			x[i] = a + b;
			y[i] = a - b;
		}
		br.close();

		Arrays.sort(x);
		Arrays.sort(y);
		System.out.println(Math.max(x[n - 1] - x[0], y[n - 1] - y[0]));
	}
}


Measured memory_bytes: 58844
#include <iostream>
#include <vector>
#include <array>
#include <algorithm>

using namespace std;

typedef array<int, 3> Row;

class Solve {
    vector<Row> hapinesses;
    vector<Row> totals;
public:
    Solve(vector<Row> hs): hapinesses(hs) {
        totals = vector<Row>(hapinesses.size(), {-1, -1, -1});
        totals[0] = hapinesses[0];
    }

    Row hapiness_of(const int index) {
        if (index == 0) {
            return hapinesses[0];
        }

        int current = *max_element(totals[index].begin(), totals[index].end());
        if (current >= 0) {
            return totals[index];
        }

        int max_h = -1;
        array< array<int, 2>, 3> pairs = { 
            array<int, 2>({1, 2}), 
            array<int, 2>({0, 2}), 
            array<int, 2>({0, 1}) 
        };
        
        Row result = hapinesses[index];
        for (int i = 0; i < 3; ++i) {
            int h = hapinesses[index][i];
            array<int, 2> p = pairs[i];
            auto prev = hapiness_of(index - 1);
            int t1 = prev[p[0]];
            int t2 = prev[p[1]];
            result[i] += max(t1, t2);
        }

        totals[index] = result;
        return result;
    }

    int hapiness_of_last() {
        auto candidates = hapiness_of(hapinesses.size() - 1);
        return *max_element(candidates.begin(), candidates.end());
    }
};

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

    vector<Row> hapinesses;
    for (int i = 0; i < N; ++i) {
        int a,b,c;
        cin >> a >> b >> c;
        hapinesses.push_back({a, b, c});
    }

    Solve s(hapinesses);
    cout << s.hapiness_of_last();
    return 0;
}

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

#define repr(i, a, b) for (int i = (int)(a); i < (int)(b); i++)
#define rep(i, n) repr(i, 0, n)
#define INF 2e9
#define MOD 1000000007
#define LINF (long long)4e18
#define PI 3.1415926535

using ll = long long;
using Pi = pair<int,int>;
using Pl = pair<ll,ll>;

int N,A,B,C;
vector<int> l;
int ans = INF;




int main(){
   int N,K; cin >> N >> K;
   ll ans = 0;
   if(K & 1){
     ll cnt = 0;
     repr(i,1,N+1){
       if(i % K == 0) cnt++;
     }
     ans = cnt * cnt * cnt;
     cout << ans << endl;
   }
   else{
     ll cnt1 = 0;
     ll cnt2 = 0;
     repr(i,1,N+1){
       if(i % (K) == 0) cnt1++;
       if(i % (K) == (K/2)) cnt2++;
     }
     ans = cnt1 * cnt1 * cnt1 + cnt2 * cnt2 * cnt2;
     cout << ans << endl;
   }

}
   

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i,n)for(long long i=0;i<(n);i++)
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> P;
 
const int MOD=1000000007;
const int INF=0x3f3f3f3f;
const ll INFL=0x3f3f3f3f3f3f3f3f;
ll gcd(ll x, ll y){
  if(y==0) return x;
  else return gcd(y, x%y);
}
ll lcm(ll x,ll y){
  ll g=gcd(x,y);
  return x/g*y;
}

using Graph=vector<vector<int>>;
Graph G;

int main(){
  ll n, k;
  cin >> n >> k;
  vector<ll> num(k,0);
  for(int i=1;i<=n;i++) num[i%k]++;
  
  ll res = 0;
  for(int a = 0; a < k; a++){
    ll b = (k-a)%k;
    ll c = (k-a)%k;
    if((b+c)%k!=0) continue;
    res += num[a]*num[b]*num[c];
  }
  
  cout << res << endl;
  
  
}
    


Measured memory_bytes: 1792
// This amazing code is by Eric Sunli Chen.
#include <algorithm>
#include <bitset>
#include <cmath>
#include <cstring>
#include <cstdio>
#include <cstdlib>
#include <ctime>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <string>
#include <utility>
#include <vector>
using namespace std;
template<typename T> void get_int(T &x)
{
	char t=getchar();
	bool neg=false;
	x=0;
	for(; (t>'9'||t<'0')&&t!='-'; t=getchar());
	if(t=='-')neg=true,t=getchar();
	for(; t<='9'&&t>='0'; t=getchar())x=x*10+t-'0';
	if(neg)x=-x;
}
template<typename T> void print_int(T x)
{
	if(x<0)putchar('-'),x=-x;
	short a[20]= {},sz=0;
	while(x>0)a[sz++]=x%10,x/=10;
	if(sz==0)putchar('0');
	for(int i=sz-1; i>=0; i--)putchar('0'+a[i]);
}
#define ff first
#define ss second
#define pb push_back
#define mp make_pair
#define get1(a) get_int(a)
#define get2(a,b) get1(a),get1(b)
#define get3(a,b,c) get1(a),get2(b,c)
#define printendl(a) print_int(a),puts("")
typedef long long LL;
typedef unsigned long long uLL;
typedef pair<int,int> pii;
const int inf=0x3f3f3f3f;
const LL Linf=1ll<<61;
const double pi=acos(-1.0);

int n,l,t,w[100111];
LL x[200111];
LL getrk(LL num)
{
	LL ret=0;
	for(int i=1;i<=n;i++)//l*t+x[i]<=num
	{
		LL t;
		if(num-x[i]>=0)t=(num-x[i])/l;
		else t=-(x[i]-num+l-1)/l;
		ret+=t+2000000000+1;
	}
	return ret;
}
LL getnum(LL rk)
{
	LL l=-20000000000000ll,r=20000000000000ll,mid;
	while(l<r-1)
	{
		mid=(l+r)/2;
		if(getrk(mid)>=rk)r=mid;
		else l=mid;
	}
	return r;
}
int main()
{
	get3(n,l,t);
	for(int i=1;i<=n;i++)
	{
		get2(x[i],w[i]);
		if(w[i]==1)x[i]+=t;
		else x[i]-=t;
	}
	if(n==1)
	{
		printendl((x[1]%l+l)%l);
		return 0;
	}
	//[-2e9*l+x,2e9*l+x]
	LL t1=getnum(2000000000ll*n+1),t2=getnum(2000000000ll*n+2);
	t1=(t1%l+l)%l;t2=(t2%l+l)%l;
	for(int i=1;i<=n;i++)x[i]=(x[i]%l+l)%l;
	sort(x+1,x+n+1);for(int i=n+1;i<=n+n;i++)x[i]=x[i-n];
	for(int i=1;i<=n;i++)if(x[i]==t1&&x[i+1]==t2)
	{
		for(int j=0;j<n;j++)printendl(x[i+j]);
		break;
	}
	return 0;
}

Measured memory_bytes: 3200
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Arrays;
import java.io.*;

class Main{
  public static void main(String args[]){
    try{
      BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
      String str = br.readLine();
      int N = Integer.parseInt(str);
      int h = 0;
      while(N > 0){
        h = h + N;
        N--;
      }
      System.out.println(h);
    }catch(IOException e){
      System.out.println(e);
    }
  }
}


Measured memory_bytes: 8020
import java.io.BufferedReader;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.Random;
import java.util.StringTokenizer;
 
public class Main {
	
	public static void main(String[] args) {
		FastReader scan = new FastReader();
		PrintWriter out = new PrintWriter(System.out);
		Task solver = new Task();
		int t = 1;
		while(t-->0) solver.solve(1, scan, out);
		out.close();
	}
	
	static class Task {
		
		public void solve(int testNumber, FastReader scan, PrintWriter out) {
			String s = scan.next();
			String[] a = {"RUD", "LUD"};
			for(int i = 0; i < s.length(); i++) {
				if(!a[i%2].contains(s.charAt(i)+"")) {
					out.println("No");
					return;
				}
			}
			out.println("Yes");
		}
	}
	
	static void shuffle(int[] a) {
		Random get = new Random();
		for(int i = 0; i < a.length; i++) {
			int r = get.nextInt(a.length);
			int temp = a[i];
			a[i] = a[r];
			a[r] = temp;
		}
	}
	
	static void shuffle(long[] a) {
		Random get = new Random();
		for(int i = 0; i < a.length; i++) {
			int r = get.nextInt(a.length);
			long temp = a[i];
			a[i] = a[r];
			a[r] = temp;
		}
	}
	
 
	static class FastReader {
		BufferedReader br;
		StringTokenizer st;
 
		public FastReader() {
			br = new BufferedReader(new InputStreamReader(System.in));
		}
		public FastReader(String s) throws FileNotFoundException {
			br = new BufferedReader(new FileReader(new File(s)));
		}
 
		String next() {
			while (st == null || !st.hasMoreElements()) {
				try {
					st = new StringTokenizer(br.readLine());
				} catch (IOException e) {
					e.printStackTrace();
				}
			}
			return st.nextToken();
		}
 
		int nextInt() {
			return Integer.parseInt(next());
		}
 
		long nextLong() {
			return Long.parseLong(next());
		}
 
		double nextDouble() {
			return Double.parseDouble(next());
		}
 
		String nextLine() {
			String str = "";
			try {
				str = br.readLine();
			} catch (IOException e) {
				e.printStackTrace();
			}
			return str;
		}
	}
 
}

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

class Main
{
	public static void main(String[] args) throws IOException
	{
		Scan in = new Scan();
		Print out = new Print();
		out.println((in.scanString().contains("7") ? "Yes" : "No"));
		out.close();
	}
}

class Scan
{
	private byte[] buf=new byte[1024];
	private int index;
	private InputStream in;
	private int total;
	public Scan()
	{
		in=System.in;
	}
	public int scan()throws IOException
	{
		if(total<0)
			throw new InputMismatchException();
		if(index>=total)
		{
			index=0;
			total=in.read(buf);
			if(total<=0)
				return -1;
		}
		return buf[index++];
	}
	public int scanInt()throws IOException
	{
		int integer=0;
		int n=scan();
		while(isWhiteSpace(n))
			n=scan();
		int neg=1;
		if(n=='-')
		{
			neg=-1;
			n=scan();
		}
		while(!isWhiteSpace(n))
		{
			if(n>='0'&&n<='9')
			{
				integer*=10;
				integer+=n-'0';
				n=scan();
			}
			else throw new InputMismatchException();
		}
		return neg*integer;
	}
	public double scanDouble()throws IOException
	{
		double doub=0;
		int n=scan();
		while(isWhiteSpace(n))
			n=scan();
		int neg=1;
		if(n=='-')
		{
			neg=-1;
			n=scan();
		}
		while(!isWhiteSpace(n)&&n!='.')
		{
			if(n>='0'&&n<='9')
			{
				doub*=10;
				doub+=n-'0';
				n=scan();
			}
			else throw new InputMismatchException();
		}
		if(n=='.')
		{
			n=scan();
			double temp=1;
			while(!isWhiteSpace(n))
			{
				if(n>='0'&&n<='9')
				{
					temp/=10;
					doub+=(n-'0')*temp;
					n=scan();
				}
				else throw new InputMismatchException();
			}
		}
		return doub*neg;
	}
	public String scanString()throws IOException
	{
		StringBuilder sb=new StringBuilder();
		int n=scan();
		while(isWhiteSpace(n))
			n=scan();
		while(!isWhiteSpace(n))
		{
			sb.append((char)n);
			n=scan();
		}
		return sb.toString();
	}
	private boolean isWhiteSpace(int n)
	{
		if(n==' '||n=='\n'||n=='\r'||n=='\t'||n==-1)
			return true;
		return false;
	}
}

class Print
{
	private final BufferedWriter bw;
	public Print()
	{
		this.bw=new BufferedWriter(new OutputStreamWriter(System.out));
	}
	public void print(Object object)throws IOException
	{
		bw.append(""+object);
	}
	public void println(Object object)throws IOException
	{
		print(object);
		bw.append("\n");
	}
	public void close()throws IOException
	{
		bw.close();
	}
}

Measured memory_bytes: 36524
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> P;
#define rep(i,n) for (ll i = 0; i < (n); ++i)
#define vcout(v) rep(i,v.size()) cout << v[i] << " "; cout << endl
#define mcout(m) rep(j,m.size()){vcout(m[j]);}
const ll MOD = 1e9 + 7;

int mainsolve(){

	ll h,w; cin >> h >> w;

	ll res = -1;

	if(h==1 || w==1){
		cout << 1 << endl;
		return 0;
	}

	if(h%2==1 && w%2==1){
		res = h*w/2 + 1;
	}
	else{
		res = h*w/2;
	} 


	cout << res << endl;
	return 0;
}

int main(){

	return mainsolve();
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define ld double
#define ll long long
#define pb emplace_back
#define mk make_pair
#define mod 1000000007
#define ff first
#define ss second
#define sz(x) (int)x.size()
#define FIO ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
#define all(x) x.begin(),x.end()
ll power(ll a, ll b) {ll res = 1; a = a % mod; while (b) {if (b & 1)res = (res * a) % mod; a = (a * a) % mod; b /= 2;} return res;}
ll invmod(ll a) {return power(a, mod - 2);}
int main(void)
{
	FIO
	int t = 1;
	// cin >> t;
	while (t--)
	{
		int x;
		cin >> x;
		x = 1 - x;
		cout << x << "\n";
	}
	return 0;
}

Measured memory_bytes: 3648
#include<iostream>
#include<algorithm>
#include<vector>
using namespace std;
struct ab{
    long a;
    long b;
};
bool cmpb(const ab &a, const ab &b){
    return a.b < b.b;
}
int main(){
    int n, i;
    long long int s = 0;
    long ta, tb;
    vector<struct ab> data;
    cin >> n;
    for(i=0; i<n; i++){
        cin >> ta >> tb;
        data.push_back({ta,tb});
    }
    sort(data.begin(), data.end(), cmpb);
    for(i=0;i<n;i++){
        s+=(data.begin()+i)->a;
        if(s>(data.begin()+i)->b) break;
    }
    cout << (i==n? "Yes": "No") << endl;
}

Measured memory_bytes: 6512
#include<bits/stdc++.h>
using namespace std;
#define mod 1000000007
#define mod2 998244353 
#define PI 3.14159265
#define ll long long
#define ld long double
#define pi pair<ll,ll>
#define pb push_back
#define vi vector<ll>
#define sz size()
#define fi first
#define se second
#define lz length()
#define all(x) (x).begin(),(x).end()
#define scf(x) scanf("%lld",&x)
#define rep(i,n) for(ll i=0;i<n;i++)
const int INF = (int)1e9;
const ll IINF=1LL<<62;
const int maxn=10000005;
int divr[maxn];
/*ll modexpo(ll a,ll b)
{
     ll res=1LL;
     while(b>0)
     {
          if(b&1)res=(res*a)%mod;
          a=(a*a)%mod;
          b>>=1;
     }
     return res;
}*/
void divisor()
{for(int i=2;i<sqrt(maxn);i++)
     {
          if(!divr[i])
          {
               for(int j=i*i;j<maxn;j+=i)if(!divr[j])divr[j]=i;     
          }
     }
     for(int i=1;i<maxn;i++)if(!divr[i])divr[i]=i;
}
 
/*const int N=1000005;
ll n;
struct line {
    long long m, c;
    long long eval(long long x) { return m * x + c; }
    long double intersectX(line l) { return (long double) (c - l.c) / (l.m - m); }
};
vector<pair<pi,ll>> rect;
deque<line> dq;
*/
 
 
 
 
 














int main()
{
     int n;
     cin>>n;
     int a[n];
     for(int i=0;i<n;i++)cin>>a[i];
     int g=0;
     for(int i=0;i<n;i++)
     {
          g=__gcd(g,a[i]);
     }
     cout<<g;

}




















 
 
 
 
 

















Measured memory_bytes: 640
#include <bits/stdc++.h>
#define rep(k,i,n) for(long long i=k;i<n;++i)
using namespace std;
typedef long long ll;
int main(void){
    // Your code here!
    ll N;
    cin>>N;
    ll a[N],b[3],ans=0,c=0;
    string S;
    cin>>S;
    rep(0,i,N)a[i]=atoi(S.substr(i,1).c_str());
    rep(0,i,1e4){
        b[2]=i%10;
        b[1]=(i%100)/10;
        b[0]=i/100;
        rep(0,j,N){
            if(b[c]==a[j]){
                ++c;
            }
            if(c==3)break;
        }
        if(c==3){
            ++ans;
        }
        c=0;
    }
    cout<<ans<<endl;
}


Measured memory_bytes: 512