akhauriyash/Code-Regression huggingface dataset:
#include"bits/stdc++.h"
using namespace std;
#define int long long
#define rep(i,n) for(int i=0;i<n;i++)
const long long mod = 1000000007;
const long long inf = 1ll << 61;
typedef pair<int, int> P;
typedef pair<double,P> PP;
struct edge { int to; int cost; };

signed main() {
	int a, p; cin >> a >> p; cout << (a * 3 + p) / 2 << endl;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#define F first
#define S second
#define pi acos(-1)
using ll = long long;
using namespace std;
using namespace __gnu_pbds;
using vl = vector<ll>;
using pll =  pair<ll,ll>;
const ll mod = 1000000007;
const ll infi = 1000000000000000;
const ll md = 998244353;
typedef tree<int,null_type,less<int>,rb_tree_tag,tree_order_statistics_node_update>ordered_set;


ll power(ll x,ll y){
    ll res = 1;
    while(y){
        if(y&1)
            res = (res*x)%md;
        x = (x*x)%md;
        y = y/2;
    }
    return res;
}


void solve(){
    int n,k;
    cin>>n>>k;
    vector<int> a(n);
    for(int i=0;i<n;i++)
        cin>>a[i];


    for(int j=0;j<k;j++){
        vector<int> temp(n + 1,0);
        int f = 1;
        for(int i=0;i<n;i++){
            int left = max(0 ,i - a[i]);
            int right = min(n , i + a[i] +1);
            temp[left] += 1;
            temp[right] -= 1;
            if(a[i] != n)
                f = 0;
        }
        a[0] = temp[0];
        for(int i=1;i<n;i++){
            a[i] = a[i-1] + temp[i];
        }
        if(f == 1){
            break;
        }
    }
    for(int i=0;i<n;i++){
        cout<<a[i]<<" ";
    }

}
 
int main()
{
    
    

    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    //int n; cin>>n; for (int i = 0; i < n; ++i)
    solve();
    return 0;
}


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

int main()
{
	int n;
	cin >> n;
	int b[n-1];
	int a[n];
	for (int i = 0; i < n-1; i++) cin >> b[i];
	a[0] = b[0];
	a[n-1] = b[n-2];
	int sum = 0;
	sum += b[0] + b[n-2];
	for (int i = 1; i < n-1; i++){
		sum += min(b[i-1], b[i]);

	}

	cout << sum << endl;
}


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

typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
const int INF = (1<<30) - 1;
const ll LINF = (1LL<<60) - 1;
const int mod = 1e9 + 7;

int main(){
    ll n, m, k;
    cin >> n >> m >> k;

    vector<ll> a(n+1, LINF), b(m+1, LINF);
    a[0] = 0;
    b[0] = 0;

    for (int i = 0; i < n; ++i) {
        cin >> a[i+1];
        a[i+1] += a[i];
    }
    for (int i = 0; i < m; ++i) {
        cin >> b[i+1];
        b[i+1] += b[i];
    }

    ll res = 0;
    for (int i = 0; i < n + 1; ++i) {
        ll rem = k - a[i];
        if (rem < 0) break;
        res = max(res, i + (ll)(upper_bound(b.begin(), b.end(), rem) - b.begin()) - 1);
    }
    cout << res << endl;
}

Measured memory_bytes: 6344
#include<bits/stdc++.h>
using namespace std;
#define FAST ios_base::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr);
#define ll long long int
void findAns()
{
    int n;
    cin >> n;

    vector<int> a;
    vector<int> b;
    vector<int> dup;

    dup.clear();
    a.clear();
    b.clear();

    int x;

    for (int i = 0; i < n; i++)
    {
        cin >> x;

        a.push_back(x);
        dup.push_back(x);

    }

    for (int i = 0; i < n; i++)
    {
        cin >> x;
        b.push_back(x);
    }
    sort(dup.begin(), dup.end());



    // for (auto c : dup) cout << c << " ";

    // cout << "\n";



    int counter = 1;

    int ans = -1;

    if (a == b)
    {
        cout << "0";
        return;
    }



    do {

        if (a == dup)
        {
            if (ans == -1) ans = counter;
            else
            {
                cout << abs(ans - counter);
                return;
            }
        }
        else if (b == dup)
        {
            if (ans == -1) ans = counter;
            else
            {
                cout << abs(ans - counter);
                return;
            }
        }

        counter++;


    } while (next_permutation(dup.begin(), dup.end()));

    // cout << abs(ans[0] - ans[1]);
}
int main()
{
// #ifndef ONLINE_JUDGE
//     freopen("in.txt", "r", stdin);
//     freopen("test.txt", "w", stdout);
//     //cout << "Time elapsed: " << 1.0 * clock() / CLOCKS_PER_SEC << " s" << "\n";
// #endif

    FAST;
    ll  t = 1;
    //cin >> t;

    while (t--) findAns();
}


Measured memory_bytes: 3616
n, k, s = map(int, input().split())
if s == 10 ** 9:
    for i in range(k):
        print(10**9,end=' ')
    for i in range(n-k):
        print(1,end=' ')

else:
    for i in range(k):
        print(s, end=' ')
    for i in range(n - k):
        print(10 ** 9, end=' ')


Measured memory_bytes: 4340
s = input()
l = len(s)

for i in range(2**(l-1)):
    ans = 0
    a = s[0]
    for j in range(l-1):
        if i >> j & 1 == 0:
            a += '+' + s[j+1]
        elif i >> j & 1 == 1:
            a += '-' + s[j+1]
    ans = eval(a)
    if ans == 7:
        print(a + '=7')
        exit()

Measured memory_bytes: 9100
#include <iostream>
using namespace std;
typedef long long ll;
int a[105];
int main(){
	int n;
	cin>>n;
	int cnt=0;
	for(int i=1;i<=n;i++){
		cin>>a[i];
		if(i&1 && a[i]&1) cnt++;
	} 
	cout<<cnt<<endl;
	return 0;
}

Measured memory_bytes: 3596
#include <iostream>
using namespace std;
double x[4],y[4],px,py,ax,ay,bx,by;
int main()
{
	while(true)
	{
		for(int i = 1;i<=3;i++){cin >> x[i];cin >> y[i];}
		if(cin.eof()){break;}
		cin >> px;
		cin >> py;
		double m,n;
		ax = x[2]-x[1];
		ay = y[2]-y[1];
		bx = x[3]-x[1];
		by = y[3]-y[1];
		px = px - x[1];
		py = py - y[1];
		double det = ax*by-ay*bx;
		m = (by*px-bx*py)/det;
		n = (-ay*px+ax*py)/det;
		if( det ==0) cout << "NO"<<endl;
		if(m>0 && m <= 1 && n > 0 && n <= 1 && m+n <= 1 ) cout << "YES" << endl;
		else cout << "NO" << endl;
	}
	return 0;
}

Measured memory_bytes: 0
#include<iostream>
using namespace std;
int main()
{
    int n;
    cin>>n;
    char s[n], t[n];
    for(int i=0;i<n; i++)
    {
        cin>>s[i];
    }
    for(int i=0;i<n; i++)
    {
        cin>>t[i];
    }
    for(int i=0;i<n; i++)
    {
        cout<<s[i]<<t[i];
    }
    cout<<endl;


    return 0;
}




Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
using namespace std;
typedef long long ll;


int main(void){
  int n,i,a,b,amax=0,lb;
  
  cin >> n;
  for (i=0;i<n;i++){
    cin >> a >> b;
    if (amax<a){
      amax=a;
      lb=b;
    }
  }
  
  cout << amax+lb << endl;
  
  return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(ll i = 0; i < n; i++)
#define yes "yes"
#define Yes "Yes"
#define no "no"
#define No "No"

namespace mydef
{
  void say(string some){
    cout << some << "\n";
  }
} // namespace mydef
using namespace mydef;
typedef long long ll;
const int INF = 1001001001;

//ここからいじる

signed main(){
  cin.tie(nullptr);
  ios::sync_with_stdio(false);
  int n; ll k;
  cin >> n >> k;
  vector<int> a(n);
  rep(i, n) cin >> a[i];

  vector<int> s;
  vector<int> ord(n+1, -1); //初期値は-1
  int c = 1; int l = 0;
  {
    int v = 1;
    while(ord[v] == -1){
      ord[v] = s.size();
      s.push_back(v);
      v = a[v-1];
    }
    c = s.size() -ord[v];
    l = ord[v];
  }

  if(k < l) cout << s[k] << endl;
  else
  {
    k -= l;
    k %= c;
    cout << s[l+k] << endl;
  }
  


  return 0;
}




Measured memory_bytes: 5800
#include<iostream>
#include<algorithm>
#include<string>
#include<math.h>
#include<vector>
#include<map>
#include<numeric>
//#include <bits/stdc++.h>
#include<cstring>
#include<iostream>
#include<functional>
using namespace std;
int main() {

	int N;
	cin >> N;
	string s = to_string(N);

	bool check = true;
	for(int i=0;i<s.size();i++)
		if (s[i] != s[s.size() - 1 - i]) {
			check = false;
			break;
		}
	if (check)
		cout << "Yes\n";
	else
		cout << "No\n";


	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i = 0; i < n; i++)
#define per(i,n) for(int i = n-1; i >= 0; i--)
typedef long long ll;
typedef pair<int, int> P;
typedef pair<long long, long long> Pll;
typedef vector<int> vi;
typedef vector<ll> vll;

int main() {
  ll x;
  cin >> x;
  ll cnt = 0;
  for(ll i = 1; i <= 1000000000; i++) {
    cnt += i;
    if(cnt>=x) {
      cout << i << endl;
      return 0;
    }
  }
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define be(v) (v).begin(),(v).end()
#define pb(q) push_back(q)
typedef long long ll;
using namespace std;
const ll mod=1000000007, INF=(1LL<<60);
#define doublecout(a) cout<<fixed<<setprecision(10)<<a<<endl;

int main() {
    cin.tie(0);
    cout.tie(0);
    ios::sync_with_stdio(false);
    int x;
     cin >> x;
    if(x >= 30){
    	cout << "Yes" << endl ;
    }
    else{
    	cout << "No" << endl;
    }
    return 0;
}


Measured memory_bytes: 3664
#include <bits/stdc++.h> 
 using namespace std; 
  int main() { 
    long long a,b;
    cin>>a>>b;
   int sum=0;
  
   for(int i=0;i<b;i++){
       int x;
       cin>>x;
       sum=sum+x;
     
       
   }
   if(sum>=a){
       cout<<"Yes";
   }else{
       cout<<"No";
   }
     }


   


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using namespace std::chrono;
#define FASTIO std::ios::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define endl '\n'
#define hell        163577857
#define vi          vector<int>
// #define int         long long int
const long long INF = 1000 * 1000 * 1000 * 1ll * 1000 * 1000 * 1000;
typedef long long ll;
typedef pair<int, int> pairs;
vector<int>v[15];
int b[15];
int main () {
  int n, m, x, ans = 1e9, z;
  cin >> n >> m >> x;
  for (int i = 0; i < n; i++) {
    cin >> b[i];
    for (int j = 0; j < m; j++) {
      cin >> z ;
      v[i].push_back(z);
    }
  }
  bool flag = false;
  for (int i = 1; i < (1 << n); i++) {
    int t = 0, y = i, cost = 0;;
    int ch[m + 1] = {0};
    flag = true;
    while(y) {
      if (y & 1) {
        for (int j = 0; j < m; j++) {
          ch[j] += v[t][j];
        }
        cost += b[t];
      }
      t++;
      y >>= 1;
    }
    for (int j = 0; j < m; j++) {
      if (ch[j] < x) {
        flag = false;
        break;
      }
    }
    if (flag) {
      ans = min(ans, cost);
    }
  }
  if (ans != 1e9)cout << ans << endl;
  else {
    cout << -1 << endl;
  }
}


Measured memory_bytes: 3612
#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <set>
#include <cmath>
#include <stdio.h>
#include <list>
#include <numeric>
#include <stack>
#include <queue>
#include <tuple>
#include <bitset>
#include <map>
#include <math.h>
//　ceil(a/b)   (a + (b - 1))/ b
using namespace std;
#define rep(i,n) for(int i = 0; i < (n); i++)
typedef long long ll;
typedef pair<int,int> P;
const int inf=1000000007;
const ll mod=1000000007;
const double PI=3.14159265358979323846;
int dx[] = {1,-1,0,0};
int dy[] = {0,0,1,-1};

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

int cans(bool f){
  if(f) cout << "Yes" << endl;
  else cout << "No" << endl;
  return 0;
}



int comb(int num){
  return num*(num-1)/2;
}


int main(){
  int N,M;
  cin >> N >> M;
  cout << comb(M) + comb(N) << endl;

  return 0;
}



Measured memory_bytes: 256
// #define DEBUGGING
#include <bits/stdc++.h>
using namespace std;
#define endl '\n'
#define ALL(V) (V).begin(), (V).end()
#define ALLR(V) (V).rbegin(), (V).rend()

template <typename T> using V = vector<T>;
template <typename T> using VV = V<V<T>>;
using ll = int64_t;
using ull = uint64_t;
using PLL = pair<ll, ll>;

template <typename T> const T& var_min(const T &t) { return t; }
template <typename T> const T& var_max(const T &t) { return t; }
template <typename T, typename... Tail> const T& var_min(const T &t, const Tail&... tail) { return min(t, var_min(tail...)); }
template <typename T, typename... Tail> const T& var_max(const T &t, const Tail&... tail) { return max(t, var_max(tail...)); }
template <typename T, typename... Tail> void chmin(T &t, const Tail&... tail) { t = var_min(t, tail...); }
template <typename T, typename... Tail> void chmax(T &t, const Tail&... tail) { t = var_max(t, tail...); }
template <typename T> const T& clamp(const T &t, const T &low, const T &high) { return max(low, min(high, t)); }
template <typename T> void chclamp(T &t, const T &low, const T &high) { t = clamp(t, low, high); }

namespace init__ {

struct InitIO {
    InitIO() {
        cin.tie(nullptr);
        ios_base::sync_with_stdio(false);
        cout << fixed << setprecision(30);
    }
} init_io;

}

#ifdef DEBUGGING
// #include "../debug/debug.cpp"
#include "../../debug/debug.cpp"
#else
#define DEBUG(...) 0
#define DEBUG_SEPARATOR_LINE 0
#endif

template <typename T>
T make_v(T init) { return init; }

template <typename T, typename... Tail>
auto make_v(T init, size_t s, Tail... tail) {
#define rec make_v(init, tail...)
    return V<decltype(rec)>(s, rec);
#undef rec
}

const ll inf = 5e15;
V<ll> dijk(const VV<PLL> &edges, ll start) {
    V<ll> dists(edges.size(), inf);
    dists[start] = 0;
    priority_queue<PLL, V<PLL>, greater<PLL>> pq;
    pq.emplace(0, start);
    while(pq.size()) {
        ll dist, cur;
        tie(dist, cur) = pq.top();
        pq.pop();
        for(auto &&ele : edges[cur]) {
            ll nxt, cost;
            tie(nxt, cost) = ele;
            if(dists[nxt] <= dist + cost) continue;
            dists[nxt] = dist + cost;
            pq.emplace(dists[nxt], nxt);
        }
    }
    return dists;
}

int main() {
    ll N, M;
    cin >> N >> M;
    VV<PLL> edges(1ll << N);
    for(ll i = 0; i < M; i++) {
        ll a, b;
        cin >> a >> b;
        ll bit = 0;
        while(b--) {
            ll c;
            cin >> c;
            c--;
            bit += (1ll << c);
        }
        for(ll i = 0; i < edges.size(); i++) {
            if((i | bit) == i) continue;
            edges[i].emplace_back(i | bit, a);
        }
    }
    ll ans = dijk(edges, 0).back();
    if(inf <= ans) ans = -1;
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 71296
#include <iostream>
#include <utility>
#include <map>
#include <vector>
#include <algorithm>
#include <queue>
#include <math.h>
#include <stack>
#include <set>
#include <deque>
#include <cmath>
#include <cassert>

using namespace std;
typedef long long ll;
ll mod = 1e9+7;
#define rep(i,n) for(int i = 0; i < (n); ++i)

struct UnionFind {
    vector<int> p;
    UnionFind(int n) {
        p = vector<int>(n, -1);
    };
    int root (int a) {
        if (p[a] < 0) return a;
        return p[a] = root(p[a]);
    }
    bool unite(int a, int b) {
        int roota = root(a);
        int rootb = root(b);
        if (roota == rootb) return false;
        //cout << size(roota) << " " << size(rootb) << endl;
        if (p[roota] > p[rootb]) {
            swap(roota, rootb);
        }
        p[roota] += p[rootb];
        p[rootb] = roota;
        return true;
    }
    bool same(int a, int b) {
        return root(a) == root(b);
    }
    int size (int a) {
        return -p[root(a)];
    }
};

int main() {
    int n, m, k;
    cin >> n >> m >> k;
    UnionFind uni(n);
    vector<int> connect_dim1_num(n, 0);
    rep(i, m) {
        int a, b;
        cin >> a >> b;
        --a, --b;
        ++connect_dim1_num[a];
        ++connect_dim1_num[b];
        uni.unite(a, b);
    }
    vector<int> block_num(n);
    rep(i, k) {
        int c, d;
        cin >> c >> d;
        --c, --d;
        if (uni.root(c) == uni.root(d)) {
            ++block_num[c];
            ++block_num[d];
        }
    }
    rep(i, n) {
        if (i != 0) cout << " ";
        cout << uni.size(i) - 1 - connect_dim1_num[i] - block_num[i];
    }
    cout << endl;
    return 0;
}


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

long long a,b,n;

int main()
{
	cin>>n;
	for(int i=sqrt(n);i>0;i--)
	{
		if(n%i==0)
		{
			cout<<(n/i)+i-2<<'\n';
			return 0;
		}
	}
}

Measured memory_bytes: 256
#include<iostream>
#include<algorithm>
#include<string>
using namespace std;
#define REP(i, a, n) for(int i=a; i<n; i++)
#define ll long long

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

	int cnt = 0, ans = 0;
	REP(i, 0, N.size()) {
		if (N[cnt] == '9') cnt++;
		else break;
	}
	if (cnt == 0 && N[0]=='1') {
		REP(i, 0, N.size()) ans += (N[i] - '0');
		ans = max(ans, (int)(9 * (N.size() - 1)));
	}
	else {
		int sum = 0;
		REP(i, 0, N.size()) sum += (N[i] - '0');
		if (cnt == N.size()) {
			ans += (9 * N.size());
		}
		else if (cnt == 0) {
			ans += (N[0] - '1');
			ans += (9 * (N.size() - 1));
		}
		else {
			ans += (9 * (cnt - 1));
			ans += (N[cnt-1] - '1');
			ans += (9 * (N.size() - cnt));
		}
		ans = max(ans, sum);
	}
	cout << ans << endl;
	return 0;
}

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

int main () {
  int n;
  cin >> n;
  vector<pair<pair<string, int>, int>> data (n);
  for (int i = 0; i < n; i++) {
    string s;
    cin >> s;
    int p;
    cin >> p;
    data[i].first.first = s;
    data[i].first.second = -p;
    data[i].second = i+1;
  }
  
  sort (data.begin(), data.end());
  
  for (auto c : data) {
    int x;
    tie (ignore, x) = c;
    cout << x << endl;
  }
}

Measured memory_bytes: 256
#include <iostream>
#include <stdio.h>
#include <vector>
#include <map>
#include <queue>
#include <algorithm>
#include <cmath>
#include <limits.h>
#include <assert.h>
#include <bitset>
#include <deque>
#include <list>
#include <map>
#include <math.h>
#include <stack>
#include <queue>
#include <set>
#include <stdlib.h>
#include <string.h>

using namespace std;

#define mp make_pair
#define pb push_back
#define ll long long int
#define db double
#define ldb long double
#define MOD 1000000007
#define Fi first
#define Se second
#define INF INT_MAX
#define NINF INT_MIN
#define L_INF LLONG_MAX
#define L_NINF LLONG_MIN
#define gc getchar
#define sz(x) (int)(x).size()
#define pii pair<int,int>
#define pll pair<ll,ll>

void fsscan(){ios_base::sync_with_stdio(false);cin.tie(NULL);}

void scani(int &x)
{
    register int c = gc();x = 0;int neg = 0;
    for(;((c<48 || c>57) && c != '-');c = gc());
    if(c=='-') {neg=1;c=gc();}
    for(;c>47 && c<58;c = gc()) {x = (x<<1) + (x<<3) + c - 48;}
    if(neg) x=-x;
}

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

int lenOfLongIncSubArr(int arr[], int n) 
{ 
    int max = 0, len = 0; 
       
    for (int i=1; i<n; i++) 
    { 
        if (arr[i] <= arr[i-1]) 
            len++; 
        else
        { 
            if (max < len)     
                max = len; 
                  
            len = 0;     
        }     
    } 
      
    if (max < len) 
        max = len; 
      
    return max; 
} 

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


Measured memory_bytes: 640
#include <iostream>
#include <string>
#include <vector>
#include <deque>
#include <queue>
#include <algorithm>
#include <set>
#include <map>
#include <bitset>
#define vv(a, b, c, d) vector<vector<d> >(a, vector<d>(b, c))
#define vvi std::vector<std::vector<int> >
#define vvl std::vector<std::vector<ll> >
#define MODs 1000000007;
typedef long long int ll;
using namespace std;

int main(int argc, char const *argv[]) {
  int N, K, Q, INF=1000000007, ans = INF;
  cin >> N >> K >> Q;
  vector<int> A(N);
  for(int i=0;i<N;i++) std::cin >> A[i];

  for(int i=0;i<N;i++){
    vvi s = vv(3000, 0, 0, int);
    vector<int> candi;
    int now = 0;
    for(int j=0;j<N;j++){
      if(A[j]>=A[i]) s[now].push_back(A[j]);
      else if(s[now].size()!=0) now++;
    }
    for(int j=0;j<=now;j++) if(s[j].size()!=0) sort(s[j].begin(), s[j].end());
    for(int j=0;j<=now;j++){
      if(s[j].size()==0) continue;
      for(int k=0;k+K-1<s[j].size();k++) candi.push_back(s[j][k]);
    }
    sort(candi.begin(), candi.end());
    /*
    for(int j=0;j<=now;j++){
      for(int k=0;k<s[j].size();k++) std::cout << s[j][k] << " ";
      std::cout << '\n';
    }
    std::cout << "candi" << '\n';
    for(int j=0;j<candi.size();j++) std::cout << candi[j] << " ";
    std::cout << '\n';
    */

    if(candi.size()<Q) continue;
    ans = min(ans, candi[Q-1] - A[i]);
  }
  std::cout << ans << '\n';
  return 0;
}


Measured memory_bytes: 512
x = int(input())
dp = [0] * 100200
dp[100] = 1
dp[101] = 1
dp[102] = 1
dp[103] = 1
dp[104] = 1
dp[105] = 1

for i in range(100, x+1):
    for p in [100, 101, 102, 103, 104, 105]:
        dp[i+p] = max(dp[i], dp[i+p])

print(dp[x])


Measured memory_bytes: 9660
#include <iostream>
#include <vector>

using namespace std;

int main(void) {
	int num, i = 0, a, ans = 0;
	cin >> num;
	vector<int> d(num);
	for (; i < num; i++)
		scanf("%d", &d[i]);
	for (i = 0; i < num; i++) {
		scanf("%d", &a);
		d[i] -= a;
		if (d[i] > 0)
			ans += d[i];
	}
	cout << ans << "\n";
	return 0;
}

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

int main(){
    int N;
    cin >> N;
    vector<pair<string,int>> P(N+1);
    map<int,int> mp;
    for(int i = 1; i <= N; ++i){
        cin >> P[i].first >> P[i].second;
        P[i].second *= -1;
        mp[P[i].second] = i;
    }
    sort(P.begin(), P.end());
    for(int i = 1; i <= N; ++i) cout << mp[P[i].second] << endl;
    return 0;
}

Measured memory_bytes: 3472
#include <iostream>
#include <vector>
#include <algorithm>
#include <queue>

using namespace std;

int n;
using ll = long long;
vector<ll> a, b;

bool ta() {
    ll ds=0, dps = 0;
    for (auto i=0;i<n;i++) {
        ll d = b[i]-a[i];
        ds += d;
        if (d > 0) {
            dps+= d/2 + d%2;
        }
    }
    return dps <= ds;
}

int main() {
    cin>>n;
    a.resize(n); b.resize(n);
    for (auto &v:a)
        cin>>v;
    for(auto &v:b)
        cin>>v;
    
    cout << (ta() ? "Yes" : "No");
    
    return 0;
}



Measured memory_bytes: 384
#include <iostream>
#include <cmath>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef unsigned int uint;
typedef pair<int,int> pii;
const int maxn=2222;
const ll modn=1e9+7;
const int inf=2e9+7;
const double PI = acos(-1.0);
const double eps=1e-8;
inline int lowbit(int x){return x&-x;}
inline ll lowbit(ll x) {return x&-x;}
inline int CountOneBinary(ll num){int ans=0;while(num){if(num&1) ans+=1;num>>=1;}return ans;}
inline void read(int &x){char c;x=0;for(c=getchar();c>'9'||c<'0';c=getchar());for(;c>='0'&&c<='9';c=getchar()) x=x*10+c-'0';}
inline void read(ll &x){char c;x=0;for(c=getchar();c>'9'||c<'0';c=getchar());for(;c>='0'&&c<='9';c=getchar()) x=x*10+c-'0';}
inline ll qpow(ll x,ll y){ll ans=1;while(y){if(y&1) ans=ans*x%modn;x=x*x%modn;y>>=1;}return ans;}
inline double qpow(double x,ll y){double ans=1;while(y){if(y&1) ans=ans*x;x=x*x;y>>=1;}return ans;}
int main()
{
    ll k;
    while(scanf("%lld",&k)==1) printf("%lld\n",k/2*((k+1)/2));
}


Measured memory_bytes: 256
#include<iostream>
#include<cstdio>
#include<cmath>
using namespace std;
const int N=1e6+5;
int a[N],tag[N*10];
int f(int n){
    if(n&1) return 3*n+1;
    return n/2;
}
int main(){
   cin>>a[1];tag[a[1]]=1;
   for(int i=2;;i++){
        a[i]=f(a[i-1]);
        if(tag[a[i]]){
            cout<<i;
            return 0;
        }
        tag[a[i]]=1;
   }
}


Measured memory_bytes: 2304
import sys

def solve():
    for line in sys.stdin:
        W = int(line)
        pows = []
        idx = 0
        while W > 0:
            r = W % 2
            W = W // 2
            if not r == 0:
                end = ' ' if W > 0 else ''
                print(r*pow(2, idx), end=end)
            idx += 1
        print()
    

if __name__ == "__main__":
    solve()



Measured memory_bytes: 5612
H,W=map(int,input().split())
Map=[]
for i in range(H):
  Map.append(input())
for i in range(H):
  for j in range(W):
    if Map[i][j]=='#':
      if i-1>=0 and i+1<H and j-1>=0 and j+1<W:
        if Map[i-1][j]!='#' and Map[i+1][j]!='#' and Map[i][j-1]!='#' and Map[i][j+1]!='#':
          print('No')
          exit()
print('Yes')

Measured memory_bytes: 9092
#define LOCAL
#include <iostream>
#include <map>
#include <iterator>
#include <bits/stdc++.h>
#include <stdbool.h>
#include <math.h>
#define io() ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
#define pb push_back
#define show(x)     cout << (#x) << ":" << x << endl;
#define show2(x,y)  cout << (#x) << ":" << x << " " << (#y) << ":" << y << endl;
#define ll long long
#define ld long double
#define mp make_pair
#define all(v) v.begin(), v.end()
#define rall(v) v.rbegin(), v.rend()
#define rep(i,a,b) for(int (i)=(a);(i) < (b); (i)++)
using namespace std;

template<class T> ostream& operator<<(ostream &os, vector<T> V){os << "[ "; for(auto v  : V) os << v << " "; return os << "]";}
template<class T> ostream& operator<<(ostream &os, set<T> V){os << "[ "; for(auto v  : V) os << v << " "; return os << "]";}
template<class T , class R > ostream& operator<<(ostream &os, map<T , R> V){os << "[ "; for(auto v  : V) os << "(" << v.first << ":" << v.second << ")"; return os << "]";}
template<class T , class R > ostream& operator<<(ostream &os, pair<T , R> V){return os << "(" << V.first << "," << V.second << ")";}
 
#define cerr cout
#ifdef LOCAL
    #define TRACE
#endif
#ifdef TRACE
    #define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
    template <typename Arg1>
    void __f(const char* name, Arg1&& arg1){cerr << "T->";cerr << name << " : " << arg1 << endl;}
    template <typename Arg1, typename... Args>
    void __f(const char* names, Arg1&& arg1, Args&&... args){cerr << "T->";const char* comma = strchr(names + 1, ','); cerr.write(names, comma - names) << " : " << arg1<<" | "; __f(comma+1, args...);}
    clock_t clk=clock();
    #define checktime() cout<<"\nTime Elapsed : "<<float(clock()-clk)/CLOCKS_PER_SEC<<endl
#else
    #define trace(...);
    #define checktime();
#endif

#define d0(x) cout<<(x)<<" "
#define d1(x) cout<<(x)<<"\n"
#define d2(x,y) cout<<(x)<<" "<<(y)<<"\n"
#define d3(x,y,z) cout<<(x)<<" "<<(y)<<" "<<(z)<<"\n"
#define d4(a,b,c,d) cout<<(a)<<" "<<(b)<<" "<<(c)<<" "<<(d)<<"\n"
#define d5(a,b,c,d,e) cout<<(a)<<" "<<(b)<<" "<<(c)<<" "<<(d)<<" "<<(e)<<"\n"
#define d6(a,b,c,d,e,f) cout<<(a)<<" "<<(b)<<" "<<(c)<<" "<<(d)<<" "<<(e)<<" "<<(f)<<"\n"
#define print(a) for(auto x:a) cout<<x<<" "; cout<<"\n"; 
// Use max({a,b,c,d,....}) instead
// #define max3(a,b,c) max(max((a),(b)),(c))
// #define max4(a,b,c,d) max(max((a),(b)),max((c),(d)))
const ll MOD = 1000 * 1000 * 1000 + 7;
const ll MOD1 = 998244353;
void solve(){
	int n;
	cin>>n;
	int x=n;
	int c1=0,c2=0,c3=0,c4=0;
	rep(i,0,n){
		string s;
		cin>>s;
		if(s=="AC")
			c1++;
		else if(s=="WA")
			c2++;
		else if(s=="TLE")
			c3++;
		else
		{
			c4++;
		}
		
	}
	cout<<"AC x "<<c1<<endl;
	cout<<"WA x "<<c2<<endl;
	cout<<"TLE x "<<c3<<endl;
	cout<<"RE x "<<c4<<endl;
}

int main() {
    io();
   //int t;
   // cin >> t;
    //rep(i,0,t){
        solve();
    //}
    return 0;
}

Measured memory_bytes: 3676
from bisect import bisect_left
n = int(input())
l = list(map(int,input().split()))
l.sort()
cnt = 0

for i in range(0,n-2):
    for j in range(i+1,n-1):
        cnt += bisect_left(l,l[i]+l[j])-j-1

print(cnt)

Measured memory_bytes: 3188
import java.io.InputStream;
import java.io.PrintStream;
import java.util.Arrays;
import java.util.Scanner;

public class Main {
	InputStream in = System.in;
	PrintStream out = System.out;

	public void _main(String[] args) {
		Scanner sc = new Scanner(in);

		long[] a = nextLongArray(sc, 3);

		sc.close();

		Arrays.sort(a);

		if(a[2] %2 == 0) {
			out.println(0);
		}else {
			out.println(a[0]*a[1]);
		}

	}

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

	@SuppressWarnings("unused")
	private long[] nextLongArray(Scanner sc, int n) {
		long[] result = new long[n];
		for (int i = 0; i < n; i++) {
			result[i] = sc.nextLong();
		}
		return result;
	}
}


Measured memory_bytes: 21844
a,b = [int(i) for i in input().split()]
c = {int(input()) for _ in range(b) }
mod = 1000000007

memo = [1] * (a+1)

for i in c:
    memo[i] = 0

for i in range(a+1):
    if i > 1:
        memo[i] = (memo[i-1] + memo[i-2])%mod*memo[i]
        
print(memo[a])


Measured memory_bytes: 11884
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.regex.Pattern;

public class Main {

	public static void main(String[] args) throws NumberFormatException,
			IOException {
		BufferedReader reader = new BufferedReader(new InputStreamReader(
				System.in));
		StringBuilder builder = new StringBuilder();
		String line;
		while ((line = reader.readLine()) != null) {
			if (line.isEmpty()) {
				break;
			}
			String maru = getNum('o', line);
			String batu = getNum('x', line);
			if (check(maru)) {
				System.out.println("o");
			} else if (check(batu)) {
				System.out.println("x");
			} else {
				System.out.println("d");
			}
		}

	}

	private static boolean check(String a) {
		Pattern b = Pattern.compile("1.*5.*9");
		Pattern c = Pattern.compile("3.*5.*7");
		Pattern d = Pattern.compile("1.*4.*7");
		Pattern e = Pattern.compile("2.*5.*8");
		Pattern f = Pattern.compile("3.*6.*9");

		if (a.contains("123") || a.contains("456") || a.contains("789")) {
			return true;
		}
		if (b.matcher(a).find() || c.matcher(a).find() || d.matcher(a).find()
				|| e.matcher(a).find() || f.matcher(a).find()) {
			return true;
		}

		return false;
	}

	private static String getNum(char a, String line) {
		char[] chs = line.toCharArray();
		for (int i = 0; i < chs.length; i++) {
			if (chs[i] == a) {
				chs[i] = (char) (i + 1 + '0');
			}
		}
		return String.valueOf(chs);
	}
}

Measured memory_bytes: 16988
#include<stdio.h>

int main(void){
  int n , a , b;
  scanf("%d %d %d",&n ,&a ,&b);


    if((b-a)%2 == 0){
    printf("Alice\n");
    }

    else{
      printf("Borys\n");
    }

  return 0;
}

Measured memory_bytes: 1664
#include "bits/stdc++.h"
using namespace std;
using ll = long long;
#define rep(i, begin, n) for (int i = begin; i < n; i++)
#define repe(i, begin, n) for (int i = begin; i <= n; i++)
#define repr(i, begin, n) for (int i = begin; i > begin - n; i--)
#define repre(i, begin, end) for (int i = begin; i >= end; i--)

template <class T>
inline bool chmax(T& a, T b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}

template <class T>
inline bool chmin(T& a, T b) {
  if (a > b) {
    a = b;
    return 1;
  }
  return 0;
}

const int inf = 1000000007;
const int MOD = 1000000007;
const long long INF = 1000000000000000007;

// -------------------------------------------------------
int A, B;

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

Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <math.h>
#include <map>
using namespace std;

int main(){
int n;cin>>n;string s;cin>>s;
int ans=0,m=0;
for(int i=0;i<n;i++){
    if(s[i]=='I')m++;
    else m--;
    ans=max(ans,m);
}
cout<<ans;
}

Measured memory_bytes: 380
#include <iostream>
using namespace std;
int main(){
    int n;
    cin>>n;
    int fib[50];
    fib[0]=1;fib[1]=1;
    for(int i=2;i<=n;i++)fib[i]=fib[i-1]+fib[i-2];
    cout<<fib[n]<<endl;



return 0;
}


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

int main()
{
	int a, b, c, d;
	cin >> a >> b;
	c = 0;
	for (int i = 0; i < b; i++) {
		cin >> d;
		c = c + d;
	}
if (a<c||a==c) {
	cout << "Yes";
	}
	else {
	cout << "No";
	}
	return 0;
}

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

int main(){
  int a,b;
  cin >> a >> b;
  if(b!=100)
    cout << int(pow(100,a)*b) << endl;
  else
    cout << int(pow(100,a)*(b+1)) << endl;
  return 0;
}

Measured memory_bytes: 3768
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
const int MOD =1e9+7;
using ll=long long;
using Graph = vector<vector<int>>;

int main() {
    int n; 
    cin >> n;
    Graph G(n);
    
    rep(i,n){
        int N; cin >> N; N--;
        int k; cin >> k;
        rep(j,k){
            int v; cin >> v; v--;
            G[N].push_back(v);
        } 
    }

    vector<int> dist(n, -1);
    queue<int> que;
    dist[0] = 0;
    que.push(0);

    while(!que.empty()){
        int v = que.front(); que.pop();

        for(int nv :G[v]){
            if(dist[nv] != -1) continue;

            dist[nv] = dist[v] + 1;
            que.push(nv);
        }
    }
    rep(i,n){
        cout << i+1 <<" "<< dist[i] << endl;
    }
}


Measured memory_bytes: 3152
<?php
//$N = (int)trim(fgets(STDIN));
$S = trim(fgets(STDIN));
$T = trim(fgets(STDIN));
//list($N,$K) = array_map('intval',explode(" ",trim(fgets(STDIN))));
//$A = array_map('intval',explode(" ",trim(fgets(STDIN))));

$len = strlen($S);
$t=0;
for($i=0;$i<$len;$i++) {
  if ($S[$i]!=$T[$i]) {
    $t++;
  }
}
printf("%d\n",$t);


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

using namespace std;
const int mod = 1e9 + 7;
const long long INF = 1e18;
#define PI 3.141592653589793
#define REP(i, n) for(int i = 0;i < n;++i)
long long H,W,K,N,D;
long long x[1000000],y[1000000];

int main()
{
  int count=0;
  cin>>N>>D;
  for(int i=0;i<N;i++){
    cin>>x[i]>>y[i];
  }

  for(int i=0;i<N;i++){
    if((x[i]*x[i])+(y[i]*y[i])<=D*D)count++;
  }
  cout<<count;
  return 0;
}





Measured memory_bytes: 6780
fun main(args: Array<String>) {
    c()
}

fun a() {
    when(readLine()) {
        "ABC" -> println("ARC")
        "ARC" -> println("ABC")
        else -> Unit
    }
}

fun b() {
    val (N, K) = readLine()!!.split(" ").map { it.toInt() }.let { it[0] to it[1] }
    val set = (1 .. N).toMutableSet()
    repeat(K) {
        val d = readLine()!!.toInt()
        val As = readLine()!!.split(" ").map { it.toInt() }
        set.removeAll(As)
    }
    println(set.count())
}

fun c() {
    val (N, M) = readLine()!!.split(" ").map { it.toInt() }.let { it[0] to it[1] }
    val H = readLine()!!.split(" ").map { it.toLong() }
    val set = (0 until N).toMutableSet()
    repeat(M) {
        val (A, B) = readLine()!!.split(" ").map { it.toInt() - 1 }.let { it[0] to it[1] }
        when {
            H[A] == H[B] -> {
                set.remove(A)
                set.remove(B)
            }
            H[A] > H[B] -> {
                set.remove(B)
            }
            H[A] < H[B] -> {
                set.remove(A)
            }
        }
    }
    println(set.count())
}

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

int main() {
    double n;
    cin >> n;
    vector<double> v(n);
    rep(i, n) cin >> v[i];
    sort(v.begin(), v.end());
    double ans = v[0];
    for(int i = 1; i < n; i++) {
        ans = (ans + v[i]) / 2;
    }
    cout << fixed << setprecision(5) << ans << endl;
    return 0;
}

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

a = list(map(int, input().split()))


import numpy as np
a = np.array(a)

cnt = sum(a < 0)
b = np.abs(a)

if cnt % 2 == 0:
    print(sum(b))
else:
    print(sum(b) - 2 * min(b))

Measured memory_bytes: 17232
#include<iostream>
#include<algorithm>
#include<math.h>
#include<queue>
#include<vector>
#include<climits>
#include<map>
#include<string>
#include<functional>
#include<iomanip>
#include<deque>
#include<random>
#include<set>
#include<bitset>
#include<cassert>

using namespace std;
typedef long long ll;
typedef double lldo;
#define mp make_pair
#define pub push_back
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define sz(x) int(x.size())
#define chmax(x,y) x = max(x,y)
ll gcd(ll a, ll b) { if (a % b == 0) { return b; } else  return gcd(b, a % b); }
ll lcm(ll a, ll b) { if (a == 0) { return b; }return a / gcd(a, b) * b; }
template<class T>ll LBI(vector<T>& ar, T in) { return lower_bound(ar.begin(), ar.end(), in) - ar.begin(); }
template<class T>ll UBI(vector<T>& ar, T in) { return upper_bound(ar.begin(), ar.end(), in) - ar.begin(); }

ll n, a[200005] = {}, cnt[200005] = {};

int main() {
	cin >> n;
	rep(i, n) {
		cin >> a[i];
		cnt[a[i]]++;
	}
	vector<ll> b(n);
	rep(i, n) {
		cin >> b[i];
		cnt[b[i]]++;
		if (cnt[b[i]] > n) {
			cout << "No" << endl;
			return 0;
		}
	}
	cout << "Yes" << endl;
	reverse(b.begin(), b.end());
	ll j1 = 0, j2 = n - 1;
	rep(i, n) {
		if (a[i] == b[i]) {
			if (b[j1] != a[i] && b[i] != a[j1]) {
				swap(b[i], b[j1]);
				j1++;
			}
			else {
				swap(b[i], b[j2]);
				j2--;
			}
		}
	}
	rep(i, n)cout << b[i] << endl;
	return 0;
}

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

int main(){
    int a[3];
for(int b=0;b<=2;b++){
  cin >> a[b] ;
}
for(int c=0;c<=1;c++){
    for(int d=c+1;d<=2;d++){
        if (a[c]>=a[d]){
            a[3]= a[c];
            a[c]= a[d];
            a[d] = a[3];
        }
    }
}
a[3] = a[0] + a[1];
cout << a[3];
}

Measured memory_bytes: 256
#include <iostream>
#include <ios> 
#include <vector>
#include <string>
#include <algorithm>
#include <functional>
#include <queue>
#include <set>
#include <cmath>
#include <map>
#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
#define rep1(i,n) for(int i=1;i<=(int)(n);i++)

using namespace std;
typedef long long int lli;
//const int MAX=;

int main(){
	string S;
	cin>>S;
	int N=(int)S.length();
	int ans=1000;
	rep(i,N-2){
		int a,b,c;
		a=S[i]-'0';
		b=S[i+1]-'0';
		c=S[i+2]-'0';
		int x=100*a+10*b+c;
		ans=min(ans,abs(x-753));
	}
	cout<<ans;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
using namespace std;
int main(){
  int n,m,a[50],b[50];
  cin >> n >> m;
  for(int i;i<m;i++) cin >> a[i] >> b[i];
  vector<int> road(n);
  rep(i,n) road[i]=0;
  rep(i,m) {
    road[a[i]-1] += 1;
    road[b[i]-1] += 1;
  }
  rep(i,n) cout << road[i] << endl;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define r(i,n) for(int i=0;i<n;i++)
using namespace std;
string t[1030][3],s[3];
int n,m;
bool ch(){
  for(int i=n-1;i>=0;i--){
    int f=0;
    r(j,2)r(k,8){
      if(t[i][j+1][k]=='?')continue;
      if(t[i][j+1][k]!=s[j][k])f++;
    }
    if(t[i][0]=="permit"&&!f)return 1;
    if(t[i][0]=="deny"&&!f)return 0;
  }
  return 0;
}
main(){
  while(cin>>n>>m,n||m){
    vector<string>v;
    r(i,n)r(j,3)cin>>t[i][j];
    r(i,m){
      r(j,3)cin>>s[j];
      if(ch())r(j,3)v.push_back(s[j]);
    }
    cout<<v.size()/3<<endl;
    r(i,v.size()/3){
      r(j,3){
        if(j)cout<<' ';
        cout<<v[i*3+j];
      }
      cout<<endl;
    }
  }
}

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


using namespace std;
typedef long long ll;
#define REP(i,n) for(int i=0; i<int(n); i++)
#define FOR(i,m,n) for(int i=int(m); i<int(n); i++)
#define ALL(obj) (obj).begin(),(obj).end()
#define VI vector<int>
#define VLL vector<long long>
#define VVI vector<vector<int>>
#define VVLL vector<vector<long long>>
#define VC vector<char>
#define VS vector<string>
#define VVC vector<vector<char>>
#define VB vector<bool>
#define VVB vector<vector<bool>>
#define fore(i,a) for(auto &i:a)

typedef pair <int, int> P;
template<class T> bool chmax(T &a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> bool chmin(T &a, T b) { if (a > b) { a = b; return true; } return false; }
const int  INF = 1 << 30;
const ll INFL = 1LL << 60;
const ll mod = 1000000007;




int main() {
	ll n, k;
	cin >> n >> k;

	VVLL dp(105, VLL(400000,0));

	int h = 1;

	VLL v;

	for (; h*h <= n; h++) {
		v.push_back(h);
		v.push_back(n / h);
	}
	v.push_back(0);
	
	sort(ALL(v));


	dp[0][0] = 1;
	REP(i, k+1) {
		REP(j, v.size()) {
			dp[i][j + 1] += dp[i][j];
			dp[i][j + 1] %= mod;
		}
		REP(j, v.size() - 1) {
			dp[i + 1][j] = dp[i][v.size() - 2 - j] * (v[j + 1] - v[j]) % mod;
		}
	}

	ll ans = 0;


	cout << dp[k][v.size()] << endl;

}

Measured memory_bytes: 331904
#include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
#include <utility>
#include <map>
#include <climits>
#include <set>
#include <deque>

#define DEBUG(x) cout << "> " << #x << ": " << x << "\n";

using namespace std;

template <typename T>
std::ostream &operator <<(std::ostream &out, vector<T> &v) {

	for (typename vector<T>::size_type i = 0; i < v.size(); ++i)
		out << v[i] << " ";
	out << "\n";

    return out;

}

int main() {

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

	string s;
	cin >> s;

	for (size_t i = 0; i < s.size(); i += 2) {
		if (s[i] == 'L') {
			cout << "No\n";
			return 0;
		}
	}

	for (size_t i = 1; i < s.size(); i += 2) {
		if (s[i] == 'R') {
			cout << "No\n";
			return 0;
		}
	}

	cout << "Yes\n";


	return 0;

}

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

#define loop(i,n) for(int i = 0;i < int(n);i++)
#define rloop(i,n) for(int i = int(n);i >= 0;i--)
#define range(i,a,b) for(int i = int(a);i <= int(b);i++)
#define SZ(c) int(c.size())
#define ALL(c) c.begin(), c.end()
#define RALL(c) c.rbegin(), c.rend()
#define PI acos(-1)
#define pb push_back
#define mp make_pair
#define fr first
#define sc second
#define sfi1(v) scanf("%d",&v)
#define sfi2(v1,v2) scanf("%d %d",&v1,&v2)
#define sfi3(v1,v2,v3) scanf("%d %d %d",&v1,&v2,&v3)
#define sfll1(v) scanf("%I64d",&v);
#define sfll2(v1,v2) scanf("%I64d %I64d",&v1,&v2)
#define sfll3(v1,v2,v3) scanf("%I64d %I64d %I64d",&v1,&v2,&v3)
#define endl '\n'

typedef vector<int> vi;
typedef vector<pair<int,int> > vii;
typedef long long ll;
typedef pair<int, int> pii;



int main()
{

#ifndef ONLINE_JUDGE
	//freopen("in.in", "r", stdin);
	//freopen("out.in", "w", stdout);
#endif
	ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);

    int a , b;
    cin >> a >> b;
    cout << max({a + b , a - b, a * b}) << endl;

    return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <string>
#include <cstring>
#include <queue>
#include <set>
#include <stack>
#include <map>
#include <unordered_map>
#include <cmath>
#include <utility> // pair make_pair
#include <algorithm>
#include <functional>
#include <iomanip>
#include <numeric>
#include <climits> // LLONG_MAX, LLONG_MIN, INT_MIN, INT_MAX
#include <assert.h>

#define m0(x) memset(x,0,sizeof(x))
#define m1(x) memset(x,63,sizeof(x))
#define fill(x,y) memset(x,y,sizeof(x))
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define chmin(x, y) x = min(x, y)
#define ll long long
#define ld long double
//#define int ll
#define INF INT_MAX/10
#define MOD 1000000007

using namespace std;
using Pi = pair<int, int>;
using Graph = vector<vector<int> >;
using WeightGraph = vector<vector<Pi> >;

int Input[100100];

// factorize
// return a vector of (prime, n)
vector<pair<ll, ll> > prime_factorize(ll n) {
  vector<pair<ll, ll> > res;
  for (ll p = 2; p * p <= n; p++) {
    if (n %p != 0) continue;
    int num = 0;
    while (n % p == 0) {
      num++;
      n /= p;
    }
    res.push_back(make_pair(p,num));
  }
  if (n != 1) res.push_back(make_pair(n, 1));
  return res;
}

// enumerate divisors
vector<int> enum_div(int n) {
  vector<int> res;
  for (int i = 1; i * i <= n; i++) {
    if (n % i == 0) {
      res.push_back(i);
      if (i * i != n) {
        res.push_back(n/i);
      }
    } 
  }
  sort(res.begin(), res.end());
  return res;
}

int main() {
  int N; cin >> N;
  int ans = 0;
  rep(i, N+1) {
    if (i % 2 == 0) continue;
    vector<int> F = enum_div(i);
    if (F.size() == 8) {
      ans++;
    }
  }
  cout << ans << endl;
}


Measured memory_bytes: 764
def resolve():
    S = input()
    Si = int(S, base=2)
    pt1 = int("".join([str(i % 2) for i in range(len(S))]), base=2)
    pt2 = int("".join([str(i % 2) for i in range(1, len(S) + 1)]), base=2)
    print(min(bin(Si ^ pt1)[2:].count("1"), bin(Si ^ pt2)[2:].count("1")))


resolve()


Measured memory_bytes: 9600
#include <algorithm>
#include <iostream>
#include <vector>
#include <string>
#include <climits> // FOO_MAX, FOO_MIN
#include <cmath> 
#include <cstdlib> // abs(int)

#define roundup(n,d) ( ((n) + ((d)-1)) / (d) )
#define ll long long
#define assign_max(into, compared) (into = max((into), (compared))) 
#define assign_min(into, compared) (into = min((into), (compared))) 

using namespace std;

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

    vector<int> dp (N+1, INT_MAX);
    dp[0] = 0;
    for(int i = 0;i < N;i++){
        assign_min(dp[i+1], dp[i]+1);
        for(int j = 6;i+j <= N;j *= 6){
            assign_min(dp[i+j], dp[i]+1);
        }

        for(int j = 9;i+j <= N;j *= 9){
            assign_min(dp[i+j], dp[i]+1);
        }
    }
    cout << dp[N] << endl;
}

Measured memory_bytes: 3208
// cities to vapori-
// corner cases // int vs ll // cin vs scanf // clear structures // statement // doublesz
#include <bits/stdc++.h>
#define pb push_back
#define fst first
#define snd second
#define sz(x) int(x.size())
#define fill(x,v) memset(x,v,sizeof(x))
#define REP(i,a,b) for(int i = int(a); i < int(b); ++i)
#define trace(x) cout << #x << " = " << x << endl
#define fastio ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
using namespace std;
typedef long long ll;
typedef pair<int,int> ii;
const int N = 2048;

char a[N][N];
int rp[N][N],lp[N][N];
int up[N][N], dw[N][N];

int main(){

	fastio;
	int n,m;
	cin >> n >> m;
	REP(i,1,n+1){
		REP(j,1,m+1){
			cin >> a[i][j];
		}
	}

	fill(rp,0); fill(lp,0);
	fill(up,0); fill(dw,0);

	for(int i = 1; i <= n; ++i){
		for(int j = m; j >= 1; --j){
			if(a[i][j] == '#') continue;
			rp[i][j] = 1 + rp[i][j+1];
		}
	}

	for(int i = 1; i <= n; ++i){
		for(int j = 1; j <= m; ++j){
			if(a[i][j] == '#') continue;
			lp[i][j] = 1 + lp[i][j-1];
		}
	}

	for(int j = 1; j <= m; ++j){
		for(int i = 1; i <= n; ++i){
			if(a[i][j] == '#') continue;
			up[i][j] = 1 + up[i-1][j];
		}
	}

	for(int j = 1; j <= m; ++j){
		for(int i = n; i >= 1; --i){
			if(a[i][j] == '#') continue;
			dw[i][j] = 1 + dw[i+1][j];
		}
	}

	int ans = 0;
	for(int i = 1; i <= n; ++i){
		for(int j = 1; j <= m; ++j){
			if(a[i][j] == '#') continue;
			int now = up[i][j] + dw[i][j] + rp[i][j] + lp[i][j] - 3;
			ans = max(ans,now);
		}
	}

	cout << ans << endl;

	return 0;
}


Measured memory_bytes: 73156
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
 
public class Main{

	public static void main(String[] args) throws IOException
	{
		int n,nTaro=0,nHana=0;
		String str;

		BufferedReader br = new BufferedReader(new InputStreamReader(System.in) );
		
        n = Integer.parseInt(br.readLine() );
        
        for(int i=0; i<n; i++)
        {
            str = br.readLine();
            
            String[] strTH = str.split(" ",2);
            
            if(0 < strTH[0].compareTo(strTH[1]) ) nTaro += 3;
            else if(strTH[0].equals(strTH[1]) )
            {
                nTaro++;
                nHana++;
            }
            else nHana += 3;
            
        }
        
        System.out.println(nTaro + " " +nHana);
            
	}
}

Measured memory_bytes: 25692
H,W,K=[int(s) for s in input().split()]
ls=[[] for _ in range(H)]
for i in range(H):
  ls[i]=input()

ans=0
for i in range(2**H):
  for j in range(2**W):
    count=0
    for h in range(H):
      for w in range(W):
        if ls[h][w]=='#':
          if (2**h)&i==0 and (2**w)&j==0:
            count+=1
    if count==K:
      ans+=1
print(ans)
            

Measured memory_bytes: 9208
#include <bits/stdc++.h>
#define REP(i,a,b) for(int i=a;i<b;i++)
using namespace std;
int main()
{
    long long a, b, x;
    cin >> a >> b >> x;
    if (a % x == 0)
        cout << (b / x) - (a / x) + 1 << endl;
    else
        cout << (b / x) - (a / x) << endl;
}


Measured memory_bytes: 256
import java.io.*;

class Main {
	public static final int N = 10000;

	public static void main (String args[]) {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String buf;

		int list[] = new int[N+1];
		list[1] = 1;
		for (int i=2;i<=N;i++) list[i] = 0;
		for (int i=2;i<=N;i++) {
			for (int j=2;i*j<=N;j++) {
				list[i*j] = 1;
			}
		}

		try {
			while ((buf = br.readLine())!=null) {
				int n = Integer.parseInt(buf);
				int count = 0;
				for (int i=2;i<=n;i++) {
					if (list[i]==0&&list[n-i+1]==0) count++;
				}
				System.out.println(count);
			}
		} catch (Exception e) {
			e.printStackTrace();
		}
	}
}

Measured memory_bytes: 19148