akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
#include<bits/stdc++.h>
using namespace std;
using ll = long long;

vector<ll> printDivisors(ll n)
{
    vector<ll>k;
    // Note that this loop runs till square root
    for (ll i=1; i<=sqrt(n); i++)
    {
        if (n%i == 0)
        {
            // If divisors are equal, print only one
            if (n/i == i)
                k.push_back(i);

            else // Otherwise print both
               {
                   k.push_back(i);
                   k.push_back(n/i);
               }
        }
    }
    return k;
}

int main()
{
   ll n;
   cin>>n;
   vector<ll>a;
   map<ll,ll>m;
   for(ll i=0;i<n;i++){
    ll temp;
    cin>>temp;
    a.push_back(temp);


    if(!m.count(temp))m[temp]=1;
    else m[temp]++;

   }
   ll cnt=n;
  for(auto x:m){
        ll p=x.first;
  ll q=x.second;
  if(q>1)cnt-=q;

  else if(q==1){
    vector<ll>k=printDivisors(p);
    for(auto y:k){
        if(m.count(y)&&y!=p){
                cnt--;
        break;

        }
    }

  }
  }

   cout<<cnt;
    return 0;
}


Measured memory_bytes: 17240
#include <bits/stdc++.h>
#define REP(i, n) for (int i = 0; i < n; ++i)
#define REPR(i, n) for (int i = n - 1; i >= 0; --i)
#define FOR(i, a, b) for (int i = a; i < b; ++i)
#define FORR(i, a, b) for (int i = b - 1; i >= a; --i)
#define SORT(v) sort(v.begin(), v.end())
#define SORTR(v) sort(v.rbegin(), v.rend())
#define REV(v) reverse(v.begin(), v.end())
#define ITER(itr, v) for (auto itr = v.begin(); itr != v.end(); ++itr)
#define LB(v, x) (lower_bound(v.begin(), v.end(), x) - v.begin())
#define UB(v, x) (upper_bound(v.begin(), v.end(), x) - v.begin())
#define SZ(v) (int)v.size()
using namespace std;
using ll = long long;
using P = pair<int, int>;

ll f(ll a, ll b, ll x) { return a * x / b - a * (x / b); }

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

    ll A, B, N;
    cin >> A >> B >> N;
    ll x = N / B * B;
    ll y = x - 1;
    x = min(N, x + B - 1);
    cout << max(f(A, B, x), f(A, B, y)) << endl;

    return 0;
}


Measured memory_bytes: 3604
#include <bits/stdc++.h>
#define fr first
#define se second
#define r_0 return 0
#define ll long long
#define pb push_back
#define TIME ios_base::sync_with_stdio(0);
using namespace std;

const long long INF = 1e7;
const long long N = 5e5 + 7;
const long long mod = 1e9 + 7;
const long double eps = 1E-7;

long long cnt, n, m , x , k , z , mn = 1e9 , mn1 = 1e9;
long long a , b , c;
string s;
int main(){
    TIME
    cin >> s;
    if( s.size() % 2 )
        return cout << "No" , 0;
    for( int i = 0;i < s.size() - 1;i ++ ){
        if( s[i] == 'h' and s[i + 1] == 'i' )
            i ++;
        else
            return cout << "No" , 0;
    }
    cout << "Yes";
}


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

using namespace std;

const int DIM = 1e5 + 7;

int v[DIM];

main()
{
	int n, k, q;
	cin >> n >> k >> q;
	
	int sum = q;
	
	while(q--)
	{
		int x;
		cin >> x;
		
		v[x]++;
	}
	
	for(int i = 1; i <= n; i++)
		if(k - sum + v[i] > 0)
		{
			cout << "Yes\n";
		}
		else
		{
			cout << "No\n";
		}
}

Measured memory_bytes: 1024
#include<cstdio>
#include<algorithm>
#include<vector>
#include<queue>
using namespace std;
struct data{
    int w,l,p;
    char name;
    data(int a,int b,int c,char d):w(a),l(b),p(c),name(d){}
    data(){}
    bool operator<(const data &d)const{
        if(w!=d.w)return w<d.w;
        if(l!=d.l)return l>d.l;
        return p>d.p;
    }
};
int main(){
    int n;
    while(scanf("%d",&n),n){
        vector<data>V;
        for(int i=0;i<n;i++){
            char c;
            scanf(" %c",&c);
            int w,l;
            w=l=0;
            for(int j=0;j<n-1;j++){
                int val;
                scanf("%d",&val);
                if(val==2)continue;
                if(!val)w++;
                else l++;
            }
            V.push_back(data(w,l,i,c));
        }
        sort(V.rbegin(),V.rend());
        for(int i=0;i<n;i++){
            printf("%c\n",V[i].name);
        }

    }
    return 0;
}

Measured memory_bytes: 1040
#include <iostream>
#include <algorithm>
#include <vector>
#include <string>
#include <queue>
#include <cstring>
#include <cmath>

using std::cin;
using std::cout;
using std::cerr;
using std::endl;

using ll = long long;

// xor segment tree
template <typename T>
class SegmentTree {
private:
  int n;
  T _init;
  std::vector<T> seg;
 
  int size (int N) {
    int ret;
    for (ret = 1; ret < N; ret <<= 1);
    return ret;
  }
 
  T query(int a, int b, int k, int l, int r) {
    if (r <= a or b <= l) return _init;
    if (a <= l and r <= b) return seg[k];
 
    T vl = query(a, b, k * 2 + 1, l, (l + r) / 2);
    T vr = query(a, b, k * 2 + 2, (l + r) / 2, r);
    return (vl ^ vr);
  }
 
public:
  SegmentTree (int N, T i = 0) : n(size(N)), seg(size(N) * 2, i), _init(i) {}
  SegmentTree () {}
 
  void Init(int N, int i = 0) {
      n = size(N);
      seg.resize(size(N) * 2 - 1, i);
      _init = i;
  }
 
  void Update (int k, T val) {
    k += n - 1;
    seg[k] = val;
    while (k > 0) {
      k = (k - 1) / 2;
      // 適宜変更
      seg[k] = (seg[k * 2 + 1] ^ seg[k * 2 + 2]);
    }
  }
 
  // [l, r) 半開区間であることに注意!!! ... [l, r]ならfind(l, r + 1)
  T Find(int l, int r) {
    return query(l, r, 0, 0, n);
  }
};

int main() {
  int N;
  std::vector<int> a;
  SegmentTree<int> xor_;

  cin >> N;
  a.resize(N);
  xor_.Init(N);
  for (int i = 0; i < N; ++i) {
    cin >> a[i];
    xor_.Update(i, a[i]);
  }

  int a_sum[200001] = {0};

  for (int i = 0; i < N; ++i) {
    if (i == 0) {
      a_sum[i] = a[i];
    }
    else {
      a_sum[i] = a_sum[i - 1] + a[i];
    }
  }

  ll ans = 0;

  // (l, r] 右端を固定
  // 左端を二分探索
  // これだと O(Nlog^2(N))
  // 左端を固定してしゃくとりすると速い
  for (int r = 0; r < N; ++r) {
    int ng = -1, ok = r, m;

    while (ok - ng > 1) {
      m = (ok + ng) / 2;

      int tmp_xor = xor_.Find(m, r + 1);
      int sum_ = a_sum[r] - (m == 0 ? 0 : a_sum[m - 1]);

      if (tmp_xor == sum_) {
        ok = m;
      }
      else {
        ng = m;
      }
    }

    ans += (r - ok + 1);
  }

  cout << ans << endl;

  return 0;
}


Measured memory_bytes: 3968
package main

import (
	"bufio"
	"fmt"
	"io"
	"os"
	"sort"
	"strconv"
)

const (
	initialBufSize = 100000
	maxBufSize     = 1000000
)

var sc *bufio.Scanner

func initScanner(r io.Reader) *bufio.Scanner {
	buf := make([]byte, initialBufSize)

	sc := bufio.NewScanner(r)
	sc.Buffer(buf, maxBufSize)
	sc.Split(bufio.ScanWords) // bufio.ScanLines
	return sc
}

func main() {
	sc = initScanner(os.Stdin)
	fmt.Println(resolve(parseProblem()))
}

type pair struct{ f, s int }

type pairs []pair

func (p pairs) Len() int {
	return len(p)
}

func (p pairs) Less(i, j int) bool {
	return p[i].f < p[j].f
}

func (p pairs) Swap(i, j int) {
	p[i], p[j] = p[j], p[i]
}

func parseProblem() int {
	n := scanInt(sc)
	m := scanInt(sc)
	ps := make([]pair, n)
	for i := 0; i < n; i++ {
		a := scanInt(sc)
		b := scanInt(sc)
		ps[i] = pair{f: a, s: b}
	}
	sort.Sort(pairs(ps))
	rest := m
	budget := 0
	for _, store := range ps {
		if store.s <= rest {
			budget += store.f * store.s
			rest -= store.s
		} else {
			budget += store.f * rest
			rest = 0
			break
		}
	}
	return budget
}

func resolve(n int) int {
	return n
}

// snip-scan-funcs
func scanInt(sc *bufio.Scanner) int {
	sc.Scan()
	i, _ := strconv.Atoi(sc.Text())
	return int(i)
}
func scanString(sc *bufio.Scanner) string {
	sc.Scan()
	return sc.Text()
}


Measured memory_bytes: 5124
s = input()
x = s[0]
j = len(s)
sc=1
i=1
while(i<j):
    if(i==j-1):
        if(x==s[i]):
            
            break
        else:
            sc=sc+1
            break
    if(x!=s[i]):
        x=s[i]
        sc=sc+1
        i=i+1
    else:
        x=s[i:i+2]
        sc=sc+1
        i=i+2
print(sc)

Measured memory_bytes: 3500
import numpy as np
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
k = int(input())

flg = True
if np.abs(a-b) > k:
    flg = False
if np.abs(a-c) > k:
    flg = False
if np.abs(a-d) > k:
    flg = False
if np.abs(a-e) > k:
    flg = False
if np.abs(b-c) > k:
    flg = False
if np.abs(b-d) > k:
    flg = False
if np.abs(b-e) > k:
    flg = False
if np.abs(c-d) > k:
    flg = False
if np.abs(c-e) > k:
    flg = False
if np.abs(d-e) > k:
    flg = False
    
if flg:
    print('Yay!')
else:
    print(":(")

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

int main() {
  int N, A;
  cin >> N;
  
  for(int i = 0; i < N; i++){
    string S;
    cin >> S;
    if(S == "Y"){
      cout << "Four" << endl;
      break;
    }
    else if(i+1 == N){
      cout << "Three" << endl;
    }
  }
}

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

// Shrotening
#define fst first
#define snd second
#define pb push_back
#define mp std::make_pair

// Loop
#define FOR(i,a,b) for(auto i=(a);i<(b);++i)
#define RFOR(i,a,b) for(auto i=(a);i>=(b);--i)

#define REP(i,a) for(long i=0;i<(a);++i)
#define RREP(i,a) for(long i=(a);i>=0;--i)

#define EACH(i,a) for(auto (i)=(a).begin(),_END=(a).end();i!=_END;++i)
#define REACH(i,a) for(auto (i)=(a).rbegin(),_END=(a).rend();i!=_END;++i)

//Algorithm
#define ALL(a) (a).begin(), a.end()
#define RALL(a) (a).rbegin(), a.rend()
#define EXIST(a,x) ((a).find(x)!=(a).end())
#define SORT(a) std::sort((a).begin(), (a).end())
#define UNIQUE(a) std::sort((a).begin(), a.end()), a.erase(std::unique((a).begin(), a.end()), a.end());
#define SUM(a) std::accumulate((a).begin(), (a).end(), 0);

#define fcout(n) std::cout << std::fixed << std::setprecision((n))

//Setting
#define OPT std::cin.tie(0);std::ios::sync_with_stdio(false);

//debug message
bool debug = true;
#define MSG(s)   if(debug){std::cout << s << std::endl;}
#define DEBUG(x) if(debug){std::cout << "debug(" << #x << "): " << x << std::endl;}

//alias
typedef long long LL;
typedef std::pair<int,int> PII;

typedef std::vector<char> VC;
typedef std::vector<int>  VI;
typedef std::vector<long> VL;
typedef std::vector<long long> VLL;
typedef std::vector<PII> VPII;

typedef std::vector< VC > VC2;
typedef std::vector< VI > VI2;
typedef std::vector< VL > VL2;
typedef std::vector< VLL > VLL2;

std::string S;
int main() {
    std::cin >> S;
    if(S[0] == '9' || S[1] == '9') {
        std::cout << "Yes" << std::endl;
    } else {
        std::cout << "No" << std::endl;
    }
}

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

using namespace std;

int main()
{
    ios::sync_with_stdio(false);
    cin.tie(NULL); cout.tie(NULL);
    int n;
    cin >> n;
    map<string,int> m;
    int best=0;
    for(int i=0;i<n;i++)
    {
        string s;
        cin >> s;
        m[s]++;
        best=max(best,m[s]);
    }
    set<string> res;
    for(auto p:m)
    {
        if(p.second==best) res.insert(p.first);
    }
    for(string t:res) cout << t << "\n";
    return 0;
}


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


int main() {
	int n, a, min, max;
	long long sum;
	cin >> n >> a;
	min = a; max = a; sum = a;
	for(int i = 1;i < n;i++){
		cin >> a;
		if(min > a) min = a;
		if(max < a) max = a;
		sum += a;
	}
	cout << min << " " << max << " " << sum << endl;
	return 0;
}

Measured memory_bytes: 1164
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

//Atcoder用


/*
 * BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String[] abc = br.readLine().split(" ");
		int a = Integer.parseInt(abc[0]);
		int b = Integer.parseInt(abc[1]);
		int c = Integer.parseInt(abc[2]);
 */
public class Main {
	public static void main(String[] args)throws IOException{
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String[] abc = br.readLine().split(" ");
		int a = Integer.parseInt(abc[0]);
		int b = Integer.parseInt(abc[1]);
		System.out.println(a-b+1);
	}

}

Measured memory_bytes: 21972
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef pair<ll,ll> pl;
typedef vector<pl> vp;
#define fore(i,a,b) for(ll i=(a);i<=(b);++i)
#define rep(i,n) fore(i,0,(n)-1)
#define rfore(i,a,b) for(ll i=(b);i>=(a);--i)
#define rrep(i,n) rfore(i,0,(n)-1)
#define all(x) (x).begin(),(x).end()
const ll INF=1001001001;
const ll LINF=1001001001001001001;
const ll D4[]={0,1,0,-1,0};
const ll D8[]={0,1,1,0,-1,-1,1,-1,0};
template<class T>
bool chmax(T &a,const T &b){if(a<b){a=b;return 1;}return 0;}
template<class T>
bool chmin(T &a,const T &b){if(b<a){a=b;return 1;}return 0;}
template<class T>
ll sum(const T& a){return accumulate(all(a),0LL);}

void solve(){
    ll n;cin>>n;
    ll t=0,h=0;
    rep(i,n){
        string st,sh;cin>>st>>sh;
        if(st>sh)t+=3;
        else if(st<sh)h+=3;
        else t++,h++;
    }
    cout<<t<<" "<<h<<endl;
}

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



Measured memory_bytes: 3168
#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()
using ll = long long;
using P = pair<int, int>;

int main(){
    string s;
    cin >> s;
    map<char, int> mp;
    rep(i, s.size()) {
        mp[s[i]]++;
    }
    if (mp.size()==s.size()) puts("yes");
    else puts("no");
    return 0;
}

Measured memory_bytes: 256
from itertools import accumulate

class BIT:
  def __init__(self, size):
    self.bit = [0] * (size + 1)
    self.size = size

  def sum(self, i):
    i += 1
    s = 0
    while i > 0:
      s += self.bit[i]
      i -= i & -i
    return s

  def add(self, i, x):
    i += 1
    while i <= self.size:
      self.bit[i] += x
      i += i & -i

N = int(input())
a = list(map(int, input().split()))
lb, ub = -1, 10**9
while ub - lb > 1:
  m = (lb + ub) // 2
  b = [0] * (N+1)
  for i in range(N):
    if a[i] <= m:
      b[i+1] = 1
  b = list(accumulate(b))
  bit_odd = BIT(2*N)
  bit_even = BIT(2*N)
  cnt = 0
  for i in range(N):
    x = N + b[i+1] - i//2 - 1
    y = N + b[i+1] - (i+1)//2 - 1
    if i % 2 == 0:
      bit_even.add(N + b[i] - i//2, 1)
      cnt += bit_even.sum(x) + bit_odd.sum(y)
    else:
      bit_odd.add(N + b[i] - i//2, 1)
      cnt += bit_even.sum(y) + bit_odd.sum(x)
  if cnt < N*(N+1)//4 + 1:
    lb = m
  else:
    ub = m
print(ub)

Measured memory_bytes: 212760
#include "bits/stdc++.h"
#define ll long long
#define rep2(i,a,b) for(int i=a;i<=b;++i)
#define rep(i,n) for(int i=0;i<n;i++)
#define pii pair<int,int>
#define ti3 tuple<int,int,int>
#define pq priority_queue<int>
#define pqg priority_queue<int,vector<int>,greater<int>>
ll int MOD=998244353;
#define N 300000
 
using namespace std;
string alphabet("abcdefghijklmnopqrstuvwxyz");

int gcd(int a,int b){
    if(a>b){
        return gcd(b,a);
    }
    if(a==0){
        return b;
    }
    return gcd(b%a,a);
}
main(){
    int n;
    ll int a[N];
    cin>>n;
    ll int sum=0;
    rep(i,n){
        cin>>a[i];
        sum+=a[i];
    }
    if(n==1){
        cout<<"Second";
        return 0;
    }
    if(n%2==0){
        if(sum%2) cout<<"First";
        else cout<<"Second";
        return 0;
    }
    if(n%2&&sum%2==0){
        cout<<"First";
        return 0;
    }
    int turn=0;
    while(1){
        int isodd=0;
        bool flag=false;
        rep(i,n){
            if(a[i]==1) {isodd=2;}
            if(a[i]%2==1){
                isodd++;
                a[i]=a[i]-1;
            }
        }
        if(isodd>1) break;
        int g=a[0];
        rep(i,n){
            g=gcd(g,a[i]);
        }
        rep(i,n){
            a[i]/=g;
        }
        ll int ssum=0;
        rep(i,n){
            ssum+=a[i];
        }
        if(ssum%2==0) break;
        turn++;
    }
    if(turn%2==1){
        cout<<"First";
    }
    else cout<<"Second";
    return 0;
}

Measured memory_bytes: 2560
#include<iostream>
#include<string>
#include<iomanip>
#include<vector>
#include<cmath>
#include<algorithm>
using namespace std;
#define int long long
#define rep(i,n) for(int i = 0; i < n; i++)
#define INF (long long)(1e18)
#define MOD (int)(1e9+7)
#define min(a,b) (a>b?b:a)
#define max(a,b) (a>b?a:b)
#define yn(f) (f?"Yes":"No")
#define YN(f) (f?"YES":"NO")


int a[110], sum;
signed main(){
	cout<<fixed<<setprecision(7);
	
	int N, ans = 0, temp = INF;
	
	cin>>N;
	
	for(int i = 0; i < N; i++){
		cin>>a[i];
		sum += a[i];
	}
	
	for(int i = 0; i < N; i++){
		if(abs(sum -a[i]*N) < temp){
			ans = i;
			temp = abs(sum -a[i]*N);
		}
	}
	
	cout<<ans<<endl;
	
	return 0;
}

Measured memory_bytes: 256
/************************************************
 * Au: Hany01
 * Date: Feb 10th, 2019
 * Prob: yahoo2019_d
 * Email: hany01dxx@gmail.com & hany01@foxmail.com
 * Inst: Yali High School
************************************************/

#include<bits/stdc++.h>

using namespace std;

typedef long long LL;
typedef unsigned long long ULL;
typedef long double LD;
typedef pair<int, int> PII;
#define Rep(i, j) for (register int i = 0, i##_end_ = (j); i < i##_end_; ++ i)
#define For(i, j, k) for (register int i = (j), i##_end_ = (k); i <= i##_end_; ++ i)
#define Fordown(i, j, k) for (register int i = (j), i##_end_ = (k); i >= i##_end_; -- i)
#define Set(a, b) memset(a, b, sizeof(a))
#define Cpy(a, b) memcpy(a, b, sizeof(a))
#define X first
#define Y second
#define PB(a) push_back(a)
#define MP(a, b) make_pair(a, b)
#define SZ(a) ((int)(a).size())
#define ALL(a) a.begin(), a.end()
#define INF (0x3f3f3f3f)
#define INF1 (2139062143)
#define debug(...) fprintf(stderr, __VA_ARGS__)
#define y1 WoXiHuanNiA

template <typename T> inline bool chkmax(T &a, T b) { return a < b ? a = b, 1 : 0; }
template <typename T> inline bool chkmin(T &a, T b) { return b < a ? a = b, 1 : 0; }
template <typename T> inline T read() {
	register T _, __; register char c_;
    for (_ = 0, __ = 1, c_ = getchar(); c_ < '0' || c_ > '9'; c_ = getchar()) if (c_ == '-') __ = -1;
    for ( ; c_ >= '0' && c_ <= '9'; c_ = getchar()) _ = (_ << 1) + (_ << 3) + (c_ ^ 48);
    return _ * __;
}
//EOT


const int MAXN = 2e5 + 5;
const LL oo = 1e18;

int n, A[MAXN];
LL dp[MAXN][5];

int main() {
#ifdef hany01
	freopen("yahoo2019_d.in", "r", stdin);
	freopen("yahoo2019_d.out", "w", stdout);
#endif

	For(i, 1, n = read<int>()) A[i] = read<int>();
	For(i, 1, n) {
		dp[i][0] = dp[i - 1][0] + A[i];
		dp[i][1] = min(dp[i - 1][0], dp[i - 1][1]) + (A[i] ? A[i] % 2 : 2);
		dp[i][2] = min(min(dp[i - 1][0], dp[i - 1][1]), dp[i - 1][2]) + ((A[i] % 2) ^ 1);
		dp[i][3] = min(dp[i - 1][0], min(dp[i - 1][1], min(dp[i - 1][2], dp[i - 1][3]))) + (A[i] ? A[i] % 2 : 2);
		dp[i][4] = min(dp[i - 1][0], min(dp[i - 1][1], min(dp[i - 1][2], min(dp[i - 1][3], dp[i - 1][4])))) + A[i];
	}
	printf("%lld\n", min(min(min(min(dp[n][0], dp[n][1]), dp[n][2]), dp[n][3]), dp[n][4]));

	return 0;
}

Measured memory_bytes: 8832
N = int(input())
S = input()

## 組み合わせの総数
ans = S.count('R') * S.count('B') * S.count('G')

## 除外
## j - i = k - j 
## k = 2*j -i

for i in range(0, N-2):
  for j in range(i+1, N-1):
    
    if 2*j-i >= N:
      break
    elif S[i] != S[j] and S[j] != S[2*j-i] and S[2*j-i] != S[i]:
      ans -= 1
  
print(ans)

Measured memory_bytes: 9212
def be_together(N: int, A: list) -> int:
    ave = sum(A) // N

    def f(y: int) -> int:
        return sum((a-y)**2 for a in A)

    return min(f(ave), f(ave + 1))


if __name__ == "__main__":
    N = int(input())
    A = [int(s) for s in input().split()]
    ans = be_together(N, A)
    print(ans)


Measured memory_bytes: 3060
n,a,b=map(int, input().split())
s=list(input())
num=0
num_f=0
qual=[]
for i in range(n):
  if num<a+b:
    if s[i]=='a':
      num+=1
      qual.append('Yes')     
    elif s[i]=='b' and num_f<b:
      num+=1
      num_f+=1
      qual.append('Yes')
    else:
      qual.append('No')   
  else:
    qual.append('No')
for i in range(n):
  print(qual[i])

Measured memory_bytes: 10544
#include <stdio.h>
#include<string.h>
int main()
{
    int n,r;
    scanf("%d %d",&n,&r);
    int nb=0;
    if (n>=10) {
        printf("%d",r);
    }
    else
    {
        nb = r + 100*(10 - n);
        printf("%d",nb);
    }
    return 0;
 }



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

#define INF 1.1e9
#define LINF 1.1e18
#define FOR(i,a,b) for (int i = (a); i < (b); ++i)
#define REP(i,n) FOR(i,0,n)
#define ALL(v) (v).begin(), (v).end()

typedef long long ll;
typedef pair<ll, int> P;

int n;
ll a[200000];

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

	cin>>n;
	REP(i,n) cin>>a[i];

	for(int i=n-1;i>0;i-=2) cout<<a[i]<<' '<<flush;
	if(n%2==0){
		for(int i=0;i<n-1;i+=2) cout<<a[i]<<' '<<flush;
	}
	else {
		cout<<a[0]<<' '<<flush;
		for(int i=1;i<n-1;i+=2) cout<<a[i]<<' '<<flush;
	}
	cout<<endl;

	return 0;
}


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

using namespace std;

#define fi first
#define se second
#define eb emplace_back
#define mt make_tuple
#define all(x) (x).begin(), (x).end()  
#define sz(x) int(x.size()) 
#define MOD 1000000007

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

const ll INF=LLONG_MAX;
const int mxn=2e5+5;
bool DEBUG=0;

int main()
{
    ios_base::sync_with_stdio(0); cin.tie(0);
    //freopen("input.txt","r",stdin); freopen("output.txt","w",stdout);
	int n,d; cin >> n >> d;
	int x,y;
	ll D = 1ll*d*d;
	int cnt=0;
	for(int i=0; i<n; i++){
		cin >> x >> y;
		x=abs(x); y=abs(y);
		ll dist = 1ll*x*x+1ll*y*y;
		if(dist<=D){
			//cerr<<x<<" "<<y<<" "<<dist<<"\n";
			cnt++;
		}
	}
	cout << cnt;
}
	
// READ & UNDERSTAND
// ll, int overflow, array bounds, memset(0)
// special cases (n=1?), n+1 (1-index)
// do smth instead of nothing & stay organized
// WRITE STUFF DOWN


Measured memory_bytes: 3624
import java.util.Scanner;

public class Main {
	private static Scanner sc=new Scanner(System.in);
	private static int n=sc.nextInt();
	private static int m=sc.nextInt();
	private static int[][] a=new int[n][m];
	private static int[] b=new int[m];
	public static void main(String[] args){
		for(int i=0;i<n;i++){
			for(int j=0;j<m;j++){
				a[i][j]=sc.nextInt();
			}
		}
		for(int i=0;i<m;i++){
			b[i]=sc.nextInt();
		}
		for(int i=0;i<n;i++){
			int sum=0;
			for(int j=0;j<m;j++){
				sum+=a[i][j]*b[j];
			}
			System.out.println(sum);
		}
	}
}

Measured memory_bytes: 40328
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.CompilerServices;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApp1
{
    class Program
    {
        static void Main(string[] args)
        {
            long[] NT = Console.ReadLine().Split(' ').Select(i => long.Parse(i)).ToArray();
            long resultC = 0;
            for (int j = 0; j < NT[0]; j++)
            {
                long[] ct = Console.ReadLine().Split(' ').Select(i => long.Parse(i)).ToArray();
                if (ct[1] <= NT[1])
                {
                    if (resultC != 0 && ct[0] < resultC)
                    {
                        resultC = ct[0];
                    }
                    else if(resultC == 0)
                    {
                        resultC = ct[0];
                    }
                }
            }
            if (resultC != 0)
            {
                Console.WriteLine(resultC);
            }
            else
            {
                Console.WriteLine("TLE");
            }
        }
    }
}
// 文字列の入力
//string s = Console.ReadLine();

// 整数の入力
//long n = long.Parse(Console.ReadLine());

// 文字列配列の入力
//string[] inputStrArray = Console.ReadLine().Split(' ');

// 整数配列の入力
//long[] inputLongArray = Console.ReadLine().Split(' ').Select(i => long.Parse(i)).ToArray();


Measured memory_bytes: 28068
#include <bits/stdc++.h>
using namespace std;
using i64 = long long;
#define rep(i,s,e) for(i64 (i) = (s);(i) < (e);(i)++)
#define all(x) x.begin(),x.end()
#define let auto const

template<typename... Types>
struct dynarr: std::vector<Types...> {
  using std::vector<Types...>::vector;
  using size_type = typename std::vector<Types...>::size_type;
  auto&& operator[](size_type i) { return this->at(i); }
  auto&& operator[](size_type i) const { return this->at(i); }
};

template<i64 M>
struct modint {
  i64 a;
  constexpr modint(const i64 x = 0) noexcept: a((x % M + M) % M) {}
  constexpr i64 value() const noexcept { return a; }
  constexpr modint& operator+=(const modint r) noexcept {
    a += r.a;
    if(a >= M) a -= M;
    return *this;
  }
  constexpr modint& operator=(const i64 r) {
    a = (r % M + M) % M;
    return *this;
  }
  constexpr modint& operator-=(const modint r) noexcept {
    a -= r.a;
    if(a < 0) a += M;
    return *this;
  }
  constexpr modint& operator*=(const modint r) noexcept {
    a = a * r.a % M;
    return *this;
  }
  constexpr modint& operator/=(modint r) noexcept {
    i64 ex = M - 2;
    while(ex) {
      if(ex & 1) {
        *this *= r;
      }
      r *= r;
      ex >>= 1;
    }
    return *this;
  }

  constexpr modint operator+(const modint r) const {
    return modint(*this) += r;
  }
  constexpr modint operator-(const modint r) const {
    return modint(*this) -= r;
  }
  constexpr modint operator*(const modint r) const {
    return modint(*this) *= r;
  }
  constexpr modint operator/(const modint r) const {
    return modint(*this) /= r;
  }
};

using fp = modint<(i64)(1e9 + 7)>;

const int MAX = 606060;

fp fac[MAX], finv[MAX];

void COMinit() {
  fac[0] = 1;
  for(i64 i = 1;i < MAX;i++) {
    fac[i] = fac[i - 1] * fp(i);
  }
  finv[MAX - 1] = fp(1) / fac[MAX - 1];
  for(i64 i = MAX - 2;i >= 0;i--) {
    finv[i] = finv[i + 1] * fp(i + 1);
  }
}

fp com(int n, int k){
    if (n < k) return 0;
    if (n < 0 || k < 0) return 0;
    return fac[n] * (finv[k] * finv[n - k]);
}

int main() {
    COMinit();
    i64 N, M, L, R;
    cin >> N >> M >> L >> R;
    // (1 - T)^(N - M)

    dynarr<fp> f(R + 1);
    rep(i,0,R + 1) {
      f[i] = com(N - M, i);
      if(i % 2 == 1) f[i] *= fp(-1);
    }

    // T^M * (1 - T)^(N - M)
    
    dynarr<fp> F(R + 1);
    rep(i,M,R + 1) {
      F[i] = f[i - M];
    }


    // P = sigma(k = 1 ~ inf) { F(T^k) }
    dynarr<fp> P(R + 1);
    for(i64 i = 1;i <= R;i++) {
      for(i64 k = 1;i * k <= R; k++) {
        P[i * k] += F[i];
      }
    }

    // (1 / (1 - T))^(N + 1)

    dynarr<fp> q(R + 1);
    rep(n,0,R + 1) {
      q[n] = com(n + (N + 1) - 1, (N + 1) - 1);
    }

    // (1 - T^M) * (1 / (1 - T))^(N + 1)
    
    dynarr<fp> Q(R + 1);
    rep(i, 0, R + 1) {
      Q[i] = q[i];
      if(i - M >= 0) Q[i] -= q[i - M];
    }

    fp Sr = 0;

    for(i64 i = 0;i <= R;i++) {
      Sr += P[i] * Q[R - i];
    }

    fp Sl = 0;
    L--;
    for(i64 i = 0;i <= L;i++) {
      Sl += P[i] * Q[L - i];
    }

    fp rev = (Sr - Sl) * com(N, M);
    fp al = q[R] - q[L];

    cout << (al - rev).value() << endl;
}



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

int main()
{
  string S, T;

  cin >> S >> T;

  if (T.substr(0, S.size()) == S && T.size() == S.size() + 1)
  {
    cout << "Yes" << endl;
  }
  else
  {
    cout << "No" << endl;
  }

  return 0;
}


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

int main() {
	int n;
	cin>>n;
	long long a[n];
	long long all = 0;
	for(int i=0;i<n;i++) {
		cin >> a[i];
		all ^= a[i];
	}
	
	for(int i=0;i<n;i++) {
		cout << (all ^ a[i]) << " ";
	}
	cout << "\n";
	return 0;
}

Measured memory_bytes: 5124
n = int(input())
c, s, f = [0, ], [0, ], [0, ]
for i in range(n - 1):
    tmp = input().split()
    c.append(int(tmp[0]))
    s.append(int(tmp[1]))
    f.append(int(tmp[2]))

for i in range(1, n):
    ans = 0
    for j in range(i, n):
        if ans <= s[j]:
            ans = s[j] + c[j]
        else:
            if ans%f[j] == 0:
                ans = ans//f[j]*f[j] + c[j]
            else:
                ans = ans//f[j]*f[j] + f[j] + c[j]
    print(ans)
print(0)

Measured memory_bytes: 41836
#include <algorithm>
#include <cassert>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <string>
#include <utility>
#include <vector>

using namespace std;
using ll = long long;

constexpr ll infl = 10000000000000007LL;
constexpr int inf = 1000000007;

int main() {
    string s;
    cin >> s;
    ll k;
    cin >> k;
    vector<ll> t;
    int beg = 0;
    for (int i = 1; i < s.size(); ++i) {
        if (s[i] != s[i - 1]) {
            t.push_back(i - beg);
            beg = i;
        }
    }
    t.push_back(s.size() - beg);
    ll ans = 0;

    if (t.size() > 1) {
        for (int i = 1; i < t.size() - 1; ++i) {
            ans += t[i] / 2;
        }
        ans *= k;
        if (s.front() != s.back()) {
            ans += t.front() / 2 * k;
            ans += t.back() / 2 * k;
        } else {
            ans += (t.front() + t.back()) / 2 * (k - 1);
            ans += t.front() / 2 + t.back() / 2;
        }
    } else {
        ans = t.front() * k / 2;
    }

    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
typedef long long ll;
#define MAXA 1000000000LL

int main() {
  ll n, k; cin >> n >> k;
  vector<ll> vm, vp;
  ll zero = 0;
  for (int i = 0; i < n; i++) {
    ll a; cin >> a;
    if (a < 0)
      vm.push_back(a);
    else if (a > 0)
      vp.push_back(a);
    else
      zero++;
  }
  sort(vm.begin(), vm.end());
  sort(vp.begin(), vp.end(), greater<ll>());

  auto f1 = [](vector<ll>& v1, vector<ll>& v2, ll x) {
    ll res = 0;
    int i = 0, j = v2.size()-1;
    while (i < v1.size() && j >= 0) {
      if (v1[i] * v2[j] <= x) {
        res += j + 1;
        i++;
      }
      else j--;
    }
    return res;
  };

  auto f2 = [](vector<ll>& v, ll x) {
    ll res = 0;
    int i = 0, j = v.size()-1;
    while (i < j) {
      if (v[i] * v[j] > x) {
        res += j - i;
        i++;
      }
      else j--;
    }
    return res;
  };

  ll way = n * (n-1) / 2;
  ll r = MAXA * MAXA, l = -r;
  while (r - l > 1) {
    ll c = (l + r) / 2;

    ll res;
    if (c < 0)
      res = f1(vm, vp, c);
    else if (c > 0)
      res = way - (f2(vm, c) + f2(vp, c));
    else {
      res = vm.size() * vp.size();
      res += (n-zero) * zero + zero * (zero-1) / 2;
    }

    if (res < k)
      l = c;
    else
      r = c;
  }
  cout << r << endl;
}

Measured memory_bytes: 2420
open System

let n, m, q =
    let l = Console.ReadLine().Split(' ') |> Array.map int
    l.[0], l.[1], l.[2]

let abcd =
    [ 1 .. q ]
    |> List.map (fun _ ->
        let l = Console.ReadLine().Split(' ') |> Array.map int
        l.[0], l.[1], l.[2], l.[3])

let ans =
    let total (arr: int []) =
        [ 0 .. q - 1 ]
        |> List.map (fun i ->
            let a, b, c, d = abcd.[i]
            if arr.[b - 1] - arr.[a - 1] = c then d else 0)
        |> List.sum

    let rec dfs (arr: int []) size =
        if size = n then
            total arr
        else
            let h =
                if size = 0 then 1 else arr.[size - 1]

            let mutable maximum = Int32.MinValue
            for i in h .. m do
                arr.[size] <- i
                maximum <- max maximum (dfs arr (size + 1))
            maximum

    dfs (Array.init n (fun _ -> 0)) 0

ans |> printfn "%d"


Measured memory_bytes: 43232
import sys
input=sys.stdin.readline

sys.setrecursionlimit(10**6)


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

A=[[] for i in range(N)]
c=[0]*N

for i in range(N-1):
    a,b=map(int,input().split())
    A[a-1].append(b-1)
    A[b-1].append(a-1)

for i in range(Q):
    p,x=map(int,input().split())
    c[p-1]+=x

def dfs(now,prev=-1):
    for next in A[now]:
        if next==prev:continue
        else:
            c[next]+=c[now]
            dfs(next,now)
dfs(0)
print(*c)


Measured memory_bytes: 268464
import sys
sys.setrecursionlimit(10**9)

def main():
    N = int(input())
    A = list(map(int,input().split()))

    A.sort()
    ans = 1
    for a in A:
        ans *= a
        if ans > 10**18:
          print(-1)
          exit()

    print(ans)



if __name__ == "__main__":
  main()


Measured memory_bytes: 84416
X = int(input())
A = 0
B = 0
clr_flg = False
score = 0
while score <= X and clr_flg == False:
    while score <= X:
        score = A**5 + B**5
        if score == X:
            clr_flg = True
            print(A,-B)
            break
        B += 1
    B = 0
    score = A**5 + B**5
    A += 1
A = 0
B = 0
while clr_flg == False:
    score = A**5 - B**5
    if score > X:
        B += 1
    elif score < X:
        A += 1
    else:
        print(A,B)
        break

Measured memory_bytes: 63744
#include <bits/stdc++.h>
using namespace std;
#define dump(x) cout << (x) << endl
typedef long long ll;
typedef vector<int> V;

int main() {
  int n, m, x, y;
  cin >> n >> m >> x >> y;
  V a(n), b(m);
  for (int i = 0; i < n; i++) cin >> a[i];
  for (int i = 0; i < m; i++) cin >> b[i];
  sort(a.begin(), a.end());
  sort(b.begin(), b.end());
  bool res = false;
  for (int z = x+1; z <= y; z++) {
    if( a.back() < z && z <= b.front() ) res = true;
  }
  dump(res ? "No War" : "War");
  return 0;
}


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

int main() {
	deque<int> dq; int tn, fn1, fn2, en; cin >> tn;
	for (int i = 0; i < tn; i++) {
		cin >> fn1;
		switch (fn1) {
		case 0: cin >> fn2 >> en;
			switch (fn2) {
			case 0: dq.push_front(en); break;
			case 1: dq.push_back(en); break;
			}
			break;
		case 1: cin >> en; cout << dq[en] << endl; break;
		case 2: cin >> fn2;
			switch (fn2) {
			case 0: dq.pop_front(); break;
			case 1: dq.pop_back(); break;
			}
			break;
		}
	}
	return 0;
}


Measured memory_bytes: 4672
#include <iostream>
#include <cstddef>
#include <vector>
#include <numeric>
#include <algorithm>
#include <cstdlib>
#include <string>
#include <math.h>
#include <map>
#include <set>
#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define REP(i, n) for (int i = 0, i##_len = (n); i < i##_len; ++i)
#define INF 1145141919
typedef long long int ll;
using namespace std;

template <typename T>
istream &operator>>(istream &is, vector<T> &vec)
{
    for (T &x : vec)
        is >> x;
    return is;
}

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

    vector<int> A(n);
    cin >> A;

    vector<int>::iterator minIt = min_element(A.begin(),A.end());

    int minIndex = distance(A.begin(),minIt);

    //cout << A[minIndex] << endl;

    //minIndex...A内の最小値イテレータ

    if((n-1)%(k-1)==0){
        cout << (n-1)/(k-1) << endl;
    }else{
        cout << (n-1)/(k-1)+1 << endl;
    }

    return 0;
}

Measured memory_bytes: 640
#pragma GCC optimize ("O3")
// #pragma GCC target ("avx")
#include<stdio.h>
#include<iostream>
#include<vector>
#include<algorithm>
#include<string>
#include<string.h>

#ifdef LOCAL
#define eprintf(...) fprintf(stderr, __VA_ARGS__)
#else
#define NDEBUG
#define eprintf(...) do {} while (0)
#endif
#include<cassert>

using namespace std;

typedef long long LL;
typedef vector<int> VI;

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

template<class T> inline void amin(T &x, const T &y) { if (y<x) x=y; }
template<class T> inline void amax(T &x, const T &y) { if (x<y) x=y; }
template<class Iter> void rprintf(const char *fmt, Iter begin, Iter end) {
    for (bool sp=0; begin!=end; ++begin) { if (sp) putchar(' '); else sp = true; printf(fmt, *begin); }
    putchar('\n');
}

int N, K;
LL A[200011];

void MAIN() {
    scanf("%d%d", &N, &K);
    REP (i, N) scanf("%lld", A+i);

    for (int i=K; i<N; i++) {
//	eprintf("%lld %lld\n", A[i-K], A[i]);
	if (A[i-K] < A[i]) puts("Yes");
	else puts("No");
    }

}

int main() {
    int TC = 1;
//    scanf("%d", &TC);
    REP (tc, TC) MAIN();
    return 0;
}



Measured memory_bytes: 5236
#include<stdio.h>
int main(void)
{
	int a[10],x,i,j;
	for(i=0;i<10;i++) {
		scanf("%d",&a[i]);

	}
	for(i=0;i<10;i++) {
		for(j=0;j<10;j++){
			if(a[i]>a[j]){
				x=a[j];
				a[j]=a[i];
				a[i]=x;
			}
		}
	}
	printf("%d\n",a[0]);
	printf("%d\n",a[1]);
	printf("%d\n",a[2]);
	return 0;
}


Measured memory_bytes: 2112
#include<stdio.h>
#include<math.h>

int main(){
  long n = 0;
  long m = 0;
  long i = 0;
  long best = -1;
  scanf("%ld %ld",&n,&m);
  for(i=1;i<=sqrt(m)+1;i++){
    if(m%i==0){
      if(i >= n && ((best-n)>(i-n) ||best == -1)){
        best = i;
      }
      if(m/i >= n && ((best-n)>((m/i)-n) ||best == -1)){
        best = m/i;
      }
    }
  }
  printf("%ld",m/best);
  return 0;
}

Measured memory_bytes: 128
#include <cstdio>
#include <vector>
#include <algorithm>
using namespace std;
int s[1000000];
int student[1000000];
int N;
vector<int> L;
bool check(int x,int r) {
	int start=0;
	int sum=0;
	for(int i=0;i<L.size();i++) {
		int low=lower_bound(s,s+N,L[i]-r)-s;
		int pos=max(low,start);
		int up=upper_bound(s,s+N,L[i])-s;
		sum+=(up-pos);
		start=up;
	}
	return (N-sum)<=x;
}
int main() {
	int Q;
	scanf("%d %d",&N,&Q);
	for(int i=0;i<N;i++) {
		scanf("%d",&s[i]);
		student[i]=s[i];
	}
	sort(s,s+N);
	for(int i=0;i<Q;i++) {
		char query[10];
		int a;
		scanf("%s %d",query,&a);
		if(query[0]=='A') {
			a--;
			L.insert(lower_bound(L.begin(),L.end(),student[a]),student[a]);
		}else if(query[0]=='R') {
			a--;
			L.erase(lower_bound(L.begin(),L.end(),student[a]));
		}else {
			int l=-1,r=1<<30;
			while(r-l>1) {
				int m=(l+r)/2;
				if(check(a,m)) {
					r=m;
				}else {
					l=m;
				}
			}
			if(check(a,r)) {
				printf("%d\n",r);
			}else {
				printf("NA\n");
			}
		}
	}
}

Measured memory_bytes: 8884
N,M = map(int,input().split())
ans = [N-1]*int(M**0.5+10)
MOD = 10**9 + 7
p = 2
M_copy = M
while p <= M_copy**0.5:
    if M%p == 0:
        M = M//p
        ans[p] += 1
    else:
        p += 1
if M != 1:
    ans[-1] += 1
out = 1
for r in ans:
    hoge = 1
    for i in range(min(N-1,r-N+1)):
        hoge *= r-i
        hoge //= i+1
    out *= hoge
    out %= MOD
print(out)

Measured memory_bytes: 3316
using System;
using System.Collections.Generic;
using System.Linq;
using System.IO;
//using System.Text;
//using System.Text.RegularExpressions;
//using System.Globalization;
//using System.Diagnostics;
using static System.Console;
//using System.Numerics;
//using static System.Math;
//using pair = Pair<int, int>;

class Program
{
    static void Main()
    {
        //SetOut(new StreamWriter(OpenStandardOutput()) { AutoFlush = false });
        new Program().solve();
        Out.Flush();
    }
    Scanner cin = new Scanner();
    readonly int[] dd = { 0, 1, 0, -1, 0 }; //→↓←↑
    readonly int mod = 1000000007;
    void chmax<T>(ref T a, T b) where T : IComparable<T> { a = a.CompareTo(b) < 0 ? b : a; }
    void chmin<T>(ref T a, T b) where T : IComparable<T> { a = a.CompareTo(b) < 0 ? a : b; }

    void solve()
    {
        int A = cin.nextint;
        int B = cin.nextint;
        int C = B - A;
        int D = C * (C - 1) / 2;
        WriteLine(D - A);
    }

}

class Scanner
{
    string[] s; int i;
    char[] cs = new char[] { ' ' };
    public Scanner() { s = new string[0]; i = 0; }
    public string[] scan { get { return ReadLine().Split(); } }
    public int[] scanint { get { return Array.ConvertAll(scan, int.Parse); } }
    public long[] scanlong { get { return Array.ConvertAll(scan, long.Parse); } }
    public double[] scandouble { get { return Array.ConvertAll(scan, double.Parse); } }
    public string next
    {
        get
        {
            if (i < s.Length) return s[i++];
            string st = ReadLine();
            while (st == "") st = ReadLine();
            s = st.Split(cs, StringSplitOptions.RemoveEmptyEntries);
            i = 0;
            return next;
        }
    }
    public int nextint { get { return int.Parse(next); } }
    public long nextlong { get { return long.Parse(next); } }
    public double nextdouble { get { return double.Parse(next); } }
}

Measured memory_bytes: 11092
/*..............IN THE NAME OF ALLAH.............*/
/**
*     => Md. Sajjat Hosen
*     => Department of Computer Science and Engineering
*     => Bangabandhu Sheikh Mujibur Rahman Science and Technology University
**/

/*..................! TRY ONCE MORE !..................*/

/*...Part - 01...*/

#include <bits/stdc++.h>
using namespace std ;

/*...Part - 02...*/

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

int Int(){int x ; scanf("%d",&x) ; return x ;}
ll Long(){ll x ; scanf("%lld",&x) ; return x ;}
float Float(){float x ; scanf("%f",&x) ; return x ;}
double Double(){double x ; scanf("%lf",&x); return x;}

/*...Part - 03...*/
/*....Debugger....*/

#define error(args...) { string _s = #args; replace(_s.begin(), _s.end(), ',', ' '); stringstream _ss(_s); istream_iterator<string> _it(_ss); err(_it, args); }
void err(istream_iterator<string> it) {cout << endl ;}
template<typename T, typename... Args>
void err(istream_iterator<string> it, T a, Args... args) {
    cerr << *it << " = " << a << ' ' ;
    err(++it, args...);
}

/*...Part - 04...*/
/*...Needed to change according to problem requirements...*/

const int N          = (int)2e5 + 5 ;
const int maxN       = (int)1e6 + 6 ;
const ll  Mod        = (ll)1e9 + 7 ;
const int inf        = (int)2e9 ;
const ll  Inf        = (ll)1e18 ;

/*..........................................................*/
/*...Part - 05...*/

#define     debug(x)    cerr << #x << " = " << x << '\n' ;
#define     rep(i,b,e)  for(__typeof(e) i = (b) ; i != (e + 1) - 2 * ((b) > (e))  ; i += 1 - 2 * ((b) > (e)))
#define     Int         Int()
#define     Long        Long()
#define     Float       Float()
#define     Double      Double()
#define     all(x)      x.begin() , x.end()
#define     sz(x)       (int)x.size()
#define     ff          first
#define     ss          second
#define     pb          push_back
#define     eb          emplace_back
#define     mem(a)      memset(a , 0 ,sizeof a)
#define     memn(a)     memset(a , -1 ,sizeof a)

/*...Part - 06...*/
/*...... ! Code start from here ! ......*/



int main(){
    //freopen("input.txt","r",stdin);
    int test = 1 , tc = 0 ;
    while(test--){
    	int n;
    	n = Int;
    	n++;
    	printf("%d\n", n / 2);
        
    }
    return 0 ;
}

/*...Always look at the part - 04...*/
/*...............END................*/

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

#define ll long long
#define REP(i,n) for(int i = 0; i < n; i++)
#define PI 3.141592653589
#define MOD 1000000007

using namespace std;

int gcd(int a, int b){return (a % b)? gcd(b, a % b) : b;}
int lcm(int a, int b){return a * b / gcd(a, b);}

void solve_A(){
    int h1, m1, h2, m2, k;
    cin >> h1 >> m1 >> h2 >> m2 >> k;

    int hour1 = h1 * 60 + m1;
    int hour2 = h2 * 60 + m2;
    cout << hour2 - hour1 - k << endl;
}

void solve_B(){
    string t;
    cin >> t;

    int n = t.size();
    
    for(int i = 0; i < n; i++){
        if(t[i] != '?') cout << t[i];
        else if(i != 0 && t[i-1] == 'P' && t[i] == '?'){
            cout << 'D';
        }
        else if(i != n-1 && t[i] == '?' && t[i+1] == 'D'){
            cout << 'P';
        } else cout << 'D';
    }
    cout << endl;
}

int main(void){
    solve_B();
    
    return 0;
}

Measured memory_bytes: 3760
#include <bits/stdc++.h>
#define int long long
#define mod (int)(1e9+7)
#define inf (int)(3e18+7)
#define rep(i,n) for(int i=0;i<n;i++)
#define REP(i,n) for(int i=1;i<n;i++)
#define P pair<int,int>
#define PiP pair<int,pair<int,int>>
#define all(v) v.begin(),v.end()
#define mkp make_pair
#define mkt make_tuple
#define prique(T) priority_queue<T,vector<T>,greater<T>>
#define vecunique(vec) sort(vec.begin(), vec.end());decltype(vec)::iterator result = std::unique(vec.begin(), vec.end());vec.erase(result, vec.end())
using namespace std;

bool prime(int x) {
	for (int i = 2; i * i <= x; i++) {
		if (x % i == 0)return false;
	}
	return x > 1;
}
int gcd(int x, int y) {
	if (y == 0)return x;
	return gcd(y, x % y);
}
int lcm(int x, int y) {
	return x / gcd(x, y) * y;
}
int kai(int x, int y) {
	int res = 1;
	for (int i = x - y + 1; i <= x; i++) {
		res *= i; res %= mod;
	}
	return res;
}
int mod_pow(int x, int y) {
	int res = 1;
	while (y > 0) {
		if (y & 1) {
			res = res * x % mod;
		}
		x = x * x % mod;
		y >>= 1;
	}
	return res;
}
int comb(int x, int y) {
	if (y > x)return 0;
	return kai(x, y) * mod_pow(kai(y, y), mod - 2) % mod;
}
/*--------Library Zone!--------*/


signed main() {
	int n, a, b; cin >> n >> a >> b;
	int ans = n + 1;
	n -= a - 1;
	a += (b - a) * (n / 2);
	if (n % 2)a++;
	cout << max(a, ans) << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
typedef long long ll;
const int INF = 1e9;
const int MOD = 1e9+7;
const ll LINF = 1e18;

using namespace std;

#define rep(i, a, b) for (int i = a; i < b; i++)
#define rrep(i, a, b) for (int i = a; i <= b; i++)
#define all(a)  begin((a)),end((a))
#define uniq(c) (c).erase(unique(all((c))), end((c)))

int main()
{
    int N; cin >> N;
    vector<int> D;
    rep (i, 0, N) {
        int d; cin >> d;
        D.push_back(d);
    }

    sort(D.begin(), D.end());
    int mean_idx = (D.size() / 2) - 1;
    int tmp = *lower_bound(D.begin()+mean_idx+1, D.end(), D[mean_idx]);
    cout << tmp - D[mean_idx] << endl;
}


Measured memory_bytes: 892
#include <cstdio>
#include <iostream>
#include <algorithm>
#include <string>
#include <cstring>
#include <vector>
#include <queue>
#include <set>
#include <map>
#include <cmath>
#include <iomanip>
#include <cassert>
#include <bitset>
using namespace std;

typedef pair<int, int> P;
#define rep(i, n) for (int i=0; i<(n); i++)
#define all(c) (c).begin(), (c).end()
#define uniq(c) c.erase(unique(all(c)), (c).end())
#define index(xs, x) (int)(lower_bound(all(xs), x) - xs.begin())
#define _1 first
#define _2 second
#define pb push_back
#define INF 1145141919LL
#define MOD 1000000007

int modpow(int x, int k) {
  int a = 1;
  while (k > 0) {
    if (k & 1) a = (1LL*a*x) % MOD;
    x = (1LL*x*x) % MOD;
    k >>= 1;
  }
  return a;
}
int gcd(int a, int b) {
  if (a > b) swap(a, b);
  if (a == 0) return b;
  return gcd(b%a, a);
}
int xGCD(int a, int b, int &x, int &y) {
  if(b == 0) {
     x = 1;
     y = 0;
     return a;
  }
  int x1, y1, gcd = xGCD(b, a % b, x1, y1);
  x = y1;
  y = x1 - (a / b) * y1;
  return gcd;
}

int S;
int num[11];
signed main() {
  ios::sync_with_stdio(false); cin.tie(0);
  num[1] = 9;
  for (int i=2; i<=10; i++) num[i] = 10LL*num[i-1];

  cin >> S;
  vector<int> ds;
  for (int d=1; d*d<=S; d++) if (S%d == 0) ds.pb(d), ds.pb(S/d);
  sort(all(ds)); uniq(ds);
  int s = 0;
  for (int f : ds) {
    int n = S/f;
    if (f <= 9 && n > num[f]) continue;
    s = (s + 9LL*modpow(10, f-1)+1+MOD-n) % MOD;
  }
  for (int a=10; a<=S; a++) {
    s += (S-1)/a-S/(a+1);
    if (s >= MOD) s -= MOD;
  }

  for (int a=1; a<=10; a++) {
    for (int b=a+1; b<=10; b++) {
      int g = gcd(a, b);
      long long c = S;
      for (int x=a+1; x<=b-1; x++) c -= 1LL*x*num[x];
      if (c <= 0 || c % g) continue;
      int x0, y0;
      xGCD(a, b, x0, y0);
      x0 *= c/g;
      y0 *= c/g;
      assert(a*x0+b*y0==c);
      int a2 = a/g, b2 = b/g;
      int lo = max((INF*b2+b2-x0)/b2, (INF*a2+y0-num[b]+a2-1)/a2)-INF;
      int hi = min((INF*b2+num[a]-x0)/b2, (INF*a2+y0-1)/a2)-INF;
      if (lo <= hi) s = (s+hi-lo+1) % MOD;
    }
  }
  cout << s << "\n";
  return 0;
}


Measured memory_bytes: 384