buggy_code
stringlengths
11
625k
fixed_code
stringlengths
17
625k
bug_type
stringlengths
2
4.45k
language
int64
0
8
token_count
int64
5
200k
#include <algorithm> #include <bits/stdc++.h> #include <iostream> #include <string> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define all(x) (x).begin(), (x).end() #define ll long long const ll MOD = 100000007; const ll INF = 1000000101001; int main() { int a, b, c, d, k; cin >> a >>...
#include <algorithm> #include <bits/stdc++.h> #include <iostream> #include <string> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define all(x) (x).begin(), (x).end() #define ll long long const ll MOD = 100000007; const ll INF = 1000000101001; int main() { int a, b, c, d, k; cin >> a >>...
[["-", 8, 9, 0, 1, 0, 11, 12, 2, 63, 22], ["+", 0, 1, 0, 11, 12, 16, 31, 23, 0, 25], ["+", 0, 1, 0, 11, 12, 16, 12, 23, 0, 24]]
1
109
#include <bits/stdc++.h> using namespace std; int main() { int H1, M1, H2, M2, K; cin >> H1 >> M1 >> H2 >> M2 >> K; cout << (H2 * 60 + M1 - H1 * 60 - M2) - K << endl; }
#include <bits/stdc++.h> using namespace std; int main() { int H1, M1, H2, M2, K; cin >> H1 >> M1 >> H2 >> M2 >> K; cout << (H2 * 60 + M2 - H1 * 60 - M1) - K << endl; }
[["-", 31, 23, 0, 16, 31, 16, 31, 16, 12, 22], ["+", 31, 23, 0, 16, 31, 16, 31, 16, 12, 22], ["-", 31, 16, 12, 16, 31, 23, 0, 16, 12, 22], ["+", 31, 16, 12, 16, 31, 23, 0, 16, 12, 22]]
1
55
#include <bits/stdc++.h> using namespace std; using ll = long long; using ld = long double; using vi = vector<int>; using vll = vector<ll>; using P = pair<int, int>; constexpr int INF = 1e9; constexpr ll INFLL = 1e18; constexpr int MOD = 1e9 + 7; const ld PI = acosl(-1); #define rep(i, n) for (int i = 0; i < (n); ++...
#include <bits/stdc++.h> using namespace std; using ll = long long; using ld = long double; using vi = vector<int>; using vll = vector<ll>; using P = pair<int, int>; constexpr int INF = 1e9; constexpr ll INFLL = 1e18; constexpr int MOD = 1e9 + 7; const ld PI = acosl(-1); #define rep(i, n) for (int i = 0; i < (n); ++...
[["-", 31, 16, 12, 23, 0, 16, 12, 118, 28, 22], ["+", 31, 16, 12, 23, 0, 16, 12, 118, 28, 22]]
1
182
#include <bits/stdc++.h> inline int read() { char c = getchar(); int x = 0, s = 1; while (c < '0' || c > '9') { if (c == '-') s = -1; c = getchar(); } while (c >= '0' && c <= '9') { x = x * 10 + c - '0'; c = getchar(); } return x * s; } using namespace std; #define NewNode (TreeNode ...
#include <bits/stdc++.h> inline int read() { char c = getchar(); int x = 0, s = 1; while (c < '0' || c > '9') { if (c == '-') s = -1; c = getchar(); } while (c >= '0' && c <= '9') { x = x * 10 + c - '0'; c = getchar(); } return x * s; } using namespace std; #define NewNode (TreeNode ...
[["+", 12, 16, 31, 16, 31, 16, 31, 2, 63, 22], ["-", 12, 16, 31, 16, 12, 23, 0, 16, 31, 22], ["-", 12, 16, 31, 16, 12, 23, 0, 16, 17, 33], ["+", 12, 16, 31, 16, 12, 23, 0, 16, 17, 33], ["+", 12, 16, 31, 16, 12, 23, 0, 16, 12, 22]]
1
272
#include <iostream> using namespace std; int main() { int h1, m1, h2, m2, k, m, h, t; cin >> h1 >> m2 >> h2 >> m2 >> k; m = h1 * 60 + m1; h = h2 * 60 + m2; h = h - k; cout << (h - m) << endl; return 0; }
#include <iostream> using namespace std; int main() { int h1, m1, h2, m2, k, m, h; cin >> h1 >> m1 >> h2 >> m2 >> k; m = h1 * 60 + m1; h = h2 * 60 + m2; h = h - k; cout << (h - m) << endl; return 0; }
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 0, 21], ["-", 0, 30, 0, 14, 8, 9, 0, 43, 49, 22], ["-", 0, 16, 31, 16, 31, 16, 31, 16, 12, 22], ["+", 0, 16, 31, 16, 31, 16, 31, 16, 12, 22]]
1
76
h1,m1,h2,m2,k=input().split() h1 = int(h1) m1 = int(m1) h2 = int(h2) m2 = int(m2) k = int(k) if h1 > h2: h2 += 24 h = h2 - h1 hm = h * 60 print(hm + m1 - m2 - k)
h1,m1,h2,m2,k=input().split() h1 = int(h1) m1 = int(m1) h2 = int(h2) m2 = int(m2) k = int(k) if h1 > h2: h2 += 24 h = h2 - h1 hm = h * 60 print(hm - m1 + m2 - k)
[["-", 3, 4, 0, 657, 31, 657, 31, 657, 17, 72], ["-", 3, 4, 0, 657, 31, 657, 31, 657, 12, 22], ["+", 3, 4, 0, 657, 31, 657, 31, 657, 12, 22], ["+", 0, 652, 3, 4, 0, 657, 31, 657, 17, 72]]
5
75
#include <stdio.h> #include <string.h> //strcmp、strncmp関数を使うために必要 int main(void) { int h1, h2, m1, m2, k, tmp, ans, i; scanf("%d%d%d%d%d", &h1, &m1, &h2, &m2, &k); h2 = h2 - h1; m2 = m2 - m1; tmp = h2 * 60 + m2; // printf("%d\n",tmp); if (tmp == k) { printf("0\n"); } else { ans = tmp - tmp % k...
#include <stdio.h> #include <string.h> //strcmp、strncmp関数を使うために必要 int main(void) { int h1, h2, m1, m2, k, tmp, ans, i; scanf("%d%d%d%d%d", &h1, &m1, &h2, &m2, &k); h2 = h2 - h1; m2 = m2 - m1; tmp = h2 * 60 + m2; // printf("%d\n",tmp); if (tmp == k) { printf("0\n"); } else { ans = tmp - k; ...
[["-", 0, 1, 0, 11, 12, 16, 12, 16, 31, 22], ["-", 0, 1, 0, 11, 12, 16, 12, 16, 17, 109]]
0
112
#include <bits/stdc++.h> using namespace std; using ll = long long; using veci = vector<int>; using vecf = vector<double>; #define rep(i, n) for (int i = 0; i < (int)(n); i++) int main() { int h1, h2, m1, m2, k; cin >> h1 >> m1 >> h2 >> m2 >> k; int diff; if (m2 >= m1) { diff = 60 * (h2 - h1) + m2 - m1; ...
#include <bits/stdc++.h> using namespace std; using ll = long long; using veci = vector<int>; using vecf = vector<double>; #define rep(i, n) for (int i = 0; i < (int)(n); i++) int main() { int h1, h2, m1, m2, k; cin >> h1 >> m1 >> h2 >> m2 >> k; int diff; if (m2 >= m1) { diff = 60 * (h2 - h1) + m2 - m1; ...
[["-", 0, 11, 12, 16, 12, 23, 0, 16, 31, 22], ["-", 0, 11, 12, 16, 12, 23, 0, 16, 17, 33], ["+", 0, 11, 12, 16, 12, 23, 0, 16, 17, 33], ["+", 0, 11, 12, 16, 12, 23, 0, 16, 12, 22]]
1
124
function main(input) { // 入力値の分離 param = input.split(" "); var hour = param[2] - param[0]; var min = param[3] - param[1]; if (min < 0) { hour -= 1; min = min * (-1); } const limit = (hour * 60) + min var result = limit - param[4]; console.log(result); } main(require('fs').readFileSync('/dev/st...
function main(input) { // 入力値の分離 param = input.split(" "); var hour = param[2] - param[0]; var min = param[3] - param[1]; if (min < 0) { hour -= 1; min = min * (-1); min = 60 - min; } const limit = (hour * 60) + min var result = limit - param[4]; console.log(result); } main(require('fs').r...
[["+", 0, 57, 64, 556, 0, 1, 0, 11, 31, 22], ["+", 0, 57, 64, 556, 0, 1, 0, 11, 0, 32], ["+", 64, 556, 0, 1, 0, 11, 12, 16, 31, 555], ["+", 64, 556, 0, 1, 0, 11, 12, 16, 17, 33], ["+", 64, 556, 0, 1, 0, 11, 12, 16, 12, 22], ["+", 8, 556, 0, 57, 64, 556, 0, 1, 0, 35]]
2
114
import sys import math import itertools import collections import heapq import numpy as np rl = sys.stdin.readline h1, m1, h2, m2, k = map(int, rl().split()) m = h260 + m2 - h160 - m1 print(m-k)
import sys import math import itertools import collections import heapq import numpy as np rl = sys.stdin.readline h1, m1, h2, m2, k = map(int, rl().split()) m = h2*60 + m2 - h1*60 - m1 print(m-k)
[["-", 0, 662, 12, 657, 31, 657, 31, 657, 31, 22], ["+", 12, 657, 31, 657, 31, 657, 31, 657, 31, 22], ["+", 12, 657, 31, 657, 31, 657, 31, 657, 17, 48], ["+", 12, 657, 31, 657, 31, 657, 31, 657, 12, 612], ["-", 0, 1, 0, 662, 12, 657, 31, 657, 12, 22], ["+", 0, 662, 12, 657, 31, 657, 12, 657, 31, 22], ["+", 0, 662, 12, ...
5
58
h1,m1,h2,m2,k =(int(x) for x in input().split()) hrtom= (h2-h1) if (m2-m1 < 0) and (h2-h1 >=0) : min = (h2-h1)*60 - (m2-m1) - k print(min) elif (m2-m1 >= 0) and (h2-h1 >=0 ): min = (h2-h1)*60 + (m2-m1) - k print(min) else: print('0')
h1,m1,h2,m2,k =(int(x) for x in input().split()) hrtom= (h2-h1) if (m2-m1 < 0) and (h2-h1 >=0) : min = (h2-h1)*60 + (m2-m1) - k print(min) elif (m2-m1 >= 0) and (h2-h1 >=0 ): min = (h2-h1)*60 + (m2-m1) - k print(min) else: print('0')
[["-", 0, 1, 0, 662, 12, 657, 31, 657, 17, 33], ["+", 0, 1, 0, 662, 12, 657, 31, 657, 17, 72]]
5
117
#include <iostream> using namespace std; int main(void) { int H1, M1, H2, M2, K, A, O; cin >> H1 >> M1 >> H2 >> M2 >> K; A = H2 - H1; O = M2 - M1; A = A * 60; A = A - O - K; cout << A << endl; }
#include <iostream> using namespace std; int main(void) { int H1, M1, H2, M2, K, A, O; cin >> H1 >> M1 >> H2 >> M2 >> K; A = H2 - H1; O = M2 - M1; A = A * 60; A = A + O - K; cout << A << endl; }
[["-", 0, 1, 0, 11, 12, 16, 31, 16, 17, 33], ["+", 0, 1, 0, 11, 12, 16, 31, 16, 17, 72]]
1
72
#include <cmath> #include <iostream> using namespace std; int main() { int H1, H2, M1, M2, K; cin >> H1 >> M1 >> H2 >> M2 >> K; int time1, time2, time3; time1 = abs(H2 - H1) * 60; time2 = abs(M2 - M1); time3 = time1 + time2; if (K >= time3) { cout << 0 << endl; } else if (K < time3) { cout <...
#include <cmath> #include <iostream> using namespace std; int main() { int H1, H2, M1, M2, K; cin >> H1 >> M1 >> H2 >> M2 >> K; int time1, time2, time3; time1 = (H2 - H1) * 60; time2 = M2 - M1; time3 = time1 + time2; if (K >= time3) { cout << 0 << endl; } else if (K < time3) { cout << time3 ...
[["-", 0, 1, 0, 11, 12, 16, 31, 2, 63, 22], ["-", 8, 9, 0, 1, 0, 11, 12, 2, 63, 22], ["-", 0, 1, 0, 11, 12, 2, 3, 4, 0, 24], ["-", 0, 1, 0, 11, 12, 2, 3, 4, 0, 25]]
1
104
#include <bits/stdc++.h> using namespace std; typedef long long ll; int main() { int H1, M1, H2, M2, K; cin >> H1 >> M1 >> H2 >> M2 >> K; cout << (H2 * 60 + M2) - (H1 * 60 + M2) - K << endl; }
#include <bits/stdc++.h> using namespace std; typedef long long ll; int main() { int H1, M1, H2, M2, K; cin >> H1 >> M1 >> H2 >> M2 >> K; cout << (H2 * 60 + M2) - (H1 * 60 + M1) - K << endl; }
[["-", 12, 16, 31, 16, 12, 23, 0, 16, 12, 22], ["+", 12, 16, 31, 16, 12, 23, 0, 16, 12, 22]]
1
62
h1,m1,h2,m2,k = map(int,input().split()) print(h2*60+m2 - h1*60+m1 - k)
h1,m1,h2,m2,k = map(int,input().split()) print(h2*60+m2 - k - h1*60-m1)
[["+", 3, 4, 0, 657, 31, 657, 31, 657, 12, 22], ["+", 0, 652, 3, 4, 0, 657, 31, 657, 17, 33], ["-", 0, 652, 3, 4, 0, 657, 31, 657, 17, 72], ["-", 0, 652, 3, 4, 0, 657, 31, 657, 12, 22], ["-", 0, 1, 0, 652, 3, 4, 0, 657, 12, 22], ["+", 0, 1, 0, 652, 3, 4, 0, 657, 12, 22]]
5
38
#include <bits/stdc++.h> using namespace std; int main() { int H1, M1, H2, M2, K; cin >> H1 >> M1 >> H2 >> M2 >> K; int N; //回数 N = ((H2 * 60 + M2) - (H1 * 60 + M1) - K) / K; cout << N * K << endl; }
#include <bits/stdc++.h> using namespace std; int main() { int H1, M1, H2, M2, K; cin >> H1 >> M1 >> H2 >> M2 >> K; int N; N = ((H2 * 60 + M2) - (H1 * 60 + M1)) - K; cout << N << endl; }
[["-", 0, 11, 12, 16, 31, 23, 0, 16, 17, 33], ["-", 0, 11, 12, 16, 31, 23, 0, 16, 12, 22], ["-", 8, 9, 0, 1, 0, 11, 12, 16, 17, 85], ["+", 8, 9, 0, 1, 0, 11, 12, 16, 17, 33], ["-", 0, 1, 0, 16, 31, 16, 12, 16, 17, 48], ["-", 0, 1, 0, 16, 31, 16, 12, 16, 12, 22]]
1
71
H = list(map(int,input().split())) h = H[2]-H[0] m = H[3]-H[1] if h < 0: h = h + 24 if m < 0: h -= 1 m *= -1 mini = h*60 + m - H[4] if mini < 0: mini = 24*60 -mini print(mini)
H = list(map(int,input().split())) h = H[2]-H[0] m = H[3]-H[1] if h < 0: h = h + 24 if m < 0: h -= 1 m = 60 + m mini = h*60 + m - H[4] if mini < 0: mini = 24*60 + mini print(mini)
[["-", 0, 57, 64, 196, 0, 1, 0, 677, 17, 108], ["-", 64, 196, 0, 1, 0, 677, 12, 664, 17, 33], ["-", 64, 196, 0, 1, 0, 677, 12, 664, 28, 612], ["+", 0, 57, 64, 196, 0, 1, 0, 662, 0, 32], ["+", 64, 196, 0, 1, 0, 662, 12, 657, 31, 612], ["+", 64, 196, 0, 1, 0, 662, 12, 657, 17, 72], ["+", 64, 196, 0, 1, 0, 662, 12, 657, 1...
5
89
#include <bits/stdc++.h> using namespace std; #define ll long long #define P pair<int, int> #define rep(i, n) for (int i = 0; i < (n); i++) #define asort(x) sort(x.begin(), x.end()) int main() { int h1, h2, m1, m2, k, res; cin >> h1 >> m1 >> h2 >> m2 >> k; res = (h2 - h1) * 60; if (m1 <= m2) { res += m2 -...
#include <bits/stdc++.h> using namespace std; #define ll long long #define P pair<int, int> #define rep(i, n) for (int i = 0; i < (n); i++) #define asort(x) sort(x.begin(), x.end()) int main() { int h1, h2, m1, m2, k, res; cin >> h1 >> m1 >> h2 >> m2 >> k; res = (h2 - h1) * 60; if (m1 <= m2) { res += m2 -...
[["+", 0, 11, 12, 16, 31, 16, 12, 23, 0, 24], ["+", 12, 16, 31, 16, 12, 23, 0, 16, 31, 13], ["+", 12, 16, 31, 16, 12, 23, 0, 16, 17, 33], ["+", 0, 11, 12, 16, 31, 16, 12, 23, 0, 25], ["-", 0, 9, 0, 1, 0, 11, 12, 16, 12, 13], ["+", 0, 9, 0, 1, 0, 11, 12, 16, 12, 13]]
1
105
h1, m1, h2, m2, k = gets.split.map(&:to_i) time1 = (h2 - h1) * 60 - (m2 - m1) time2 = m2 - m1 if h1 == h2 if time2 > k puts time2 - k elsif time2 < k puts 0 end elsif h1 != h2 if time1 > k puts time1 - k elsif time1 < k puts 0 end end
h1, m1, h2, m2, k = gets.split.map(&:to_i) time1 = (h2 - h1) * 60 + (m2 - m1) time2 = m2 - m1 if h1 == h2 if time2 > k puts time2 - k elsif time2 <= k puts 0 end elsif h1 != h2 if time1 > k puts time1 - k elsif time1 <= k puts 0 end end
[["-", 36, 36, 0, 493, 0, 662, 12, 738, 17, 33], ["+", 36, 36, 0, 493, 0, 662, 12, 738, 17, 72], ["-", 64, 749, 0, 121, 75, 759, 15, 738, 17, 18], ["+", 64, 749, 0, 121, 75, 759, 15, 738, 17, 19]]
4
78
#include <bits/stdc++.h> #define REP(i, n) for (int i = 0; i < (n); ++i) template <class T> inline bool chmin(T &a, T b) { if (a > b) { a = b; return true; } return false; } template <class T> inline bool chmax(T &a, T b) { if (a < b) { a = b; return true; } return false; } using namespace s...
#include <bits/stdc++.h> #define REP(i, n) for (int i = 0; i < (n); ++i) template <class T> inline bool chmin(T &a, T b) { if (a > b) { a = b; return true; } return false; } template <class T> inline bool chmax(T &a, T b) { if (a < b) { a = b; return true; } return false; } using namespace s...
[["-", 31, 16, 12, 16, 31, 16, 31, 23, 0, 24], ["-", 12, 16, 31, 16, 31, 23, 0, 16, 12, 22], ["-", 31, 16, 12, 16, 31, 16, 31, 23, 0, 25], ["-", 0, 16, 31, 16, 12, 16, 31, 16, 17, 85], ["-", 0, 16, 31, 16, 12, 16, 31, 16, 12, 22], ["-", 0, 1, 0, 16, 31, 16, 12, 16, 17, 48]]
1
262
H_1, M_1, H_2, M_2, K = map(int, input().split()) H_ = H_2 * 60 + M_2 - K H = H_ - (H_1*60+M_2) print(H)
H_1, M_1, H_2, M_2, K = map(int, input().split()) H_ = H_2 * 60 + M_2 - K H = H_ - (H_1*60+M_1) print(H)
[["-", 0, 662, 12, 657, 12, 23, 0, 657, 12, 22], ["+", 0, 662, 12, 657, 12, 23, 0, 657, 12, 22]]
5
46
#include <bits/stdc++.h> using namespace std; //#include <bits/stdc++.h> // using namespace std; int main() { int h1, m1, h2, m2, k; cin >> h1 >> m1 >> h2 >> m2 >> k; int ans = ((h2 * 60 + m2) - (h1 * 60 + m1)) / k; cout << ans; }
#include <bits/stdc++.h> using namespace std; int main() { int h1, m1, h2, m2, k; cin >> h1 >> m1 >> h2 >> m2 >> k; int ans = ((h2 * 60 + m2) - (h1 * 60 + m1)) - k; cout << ans << endl; }
[["-", 8, 9, 0, 43, 49, 50, 51, 16, 17, 85], ["+", 8, 9, 0, 43, 49, 50, 51, 16, 17, 33], ["+", 0, 14, 8, 9, 0, 1, 0, 16, 17, 151], ["+", 0, 14, 8, 9, 0, 1, 0, 16, 12, 22]]
1
64
/** * code generated by JHelper * More info: https://github.com/AlexeyDmitriev/JHelper * @author */ #include <fstream> #include <iostream> #include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); ++i) using namespace std; typedef long long ll; typedef pair<int, int> P; template <class T> inline bool c...
/** * code generated by JHelper * More info: https://github.com/AlexeyDmitriev/JHelper * @author */ #include <fstream> #include <iostream> #include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); ++i) using namespace std; typedef long long ll; typedef pair<int, int> P; template <class T> inline bool c...
[["-", 8, 9, 0, 57, 64, 1, 0, 11, 17, 107], ["-", 0, 57, 64, 1, 0, 11, 12, 16, 31, 13], ["-", 0, 57, 64, 1, 0, 11, 12, 16, 17, 33], ["-", 64, 1, 0, 11, 12, 16, 12, 2, 63, 22], ["+", 8, 9, 0, 57, 64, 1, 0, 11, 17, 32], ["+", 0, 57, 64, 1, 0, 11, 12, 16, 31, 22], ["+", 0, 57, 64, 1, 0, 11, 12, 16, 17, 72]]
1
253
#include <bits/stdc++.h> #include <iostream> using namespace std; int main() { int h1, h2, m1, m2, k; cin >> h1 >> m1 >> h2 >> m2 >> k; int total = 0; if (m1 <= m2) total = (h2 - h1) * 60 + m2 - m1; else total = (h2 - h1) * 60 - m2 + m1; if (k <= total) printf("%d\n", total - k); else prin...
#include <bits/stdc++.h> #include <iostream> using namespace std; int main() { int h1, h2, m1, m2, k; cin >> h1 >> m1 >> h2 >> m2 >> k; int total = 0; if (m1 <= m2) total = (h2 - h1) * 60 + m2 - m1; else total = (h2 - h1 - 1) * 60 + 60 - m1 + m2; if (k <= total) printf("%d\n", total - k); else...
[["+", 31, 16, 31, 16, 31, 23, 0, 16, 17, 33], ["+", 31, 16, 31, 16, 31, 23, 0, 16, 12, 13], ["-", 0, 1, 0, 11, 12, 16, 31, 16, 17, 33], ["-", 0, 1, 0, 11, 12, 16, 31, 16, 12, 22], ["+", 0, 11, 12, 16, 31, 16, 31, 16, 12, 13], ["+", 0, 1, 0, 11, 12, 16, 31, 16, 17, 33], ["+", 75, 76, 0, 1, 0, 11, 12, 16, 17, 72], ["+",...
1
104
t=list(input()) for i in range(len(t)): if t[i]=="?": t[i]=D print(t[i],end="")
t=list(input()) for i in range(len(t)): if t[i]=="?": t[i]="D" print(t[i],end='')
[["+", 64, 196, 0, 1, 0, 662, 12, 557, 0, 654], ["+", 64, 196, 0, 1, 0, 662, 12, 557, 0, 655], ["-", 0, 652, 3, 4, 0, 653, 51, 557, 0, 654], ["-", 0, 652, 3, 4, 0, 653, 51, 557, 0, 655], ["+", 0, 652, 3, 4, 0, 653, 51, 557, 0, 654], ["+", 0, 652, 3, 4, 0, 653, 51, 557, 0, 655]]
5
47
#include <bits/stdc++.h> using namespace std; #define itn int using ll = int64_t; #define rep(i, n) for (int i = 0; i < (int)(n); i++) using vi = vector<int>; using vll = vector<ll>; /*//再帰関数木構造定型 int complete_time(vector<vector<int>> &children, int x) { // ベースケース if (children.at(x).size() == 0) { return 1; //...
#include <bits/stdc++.h> using namespace std; #define itn int using ll = int64_t; #define rep(i, n) for (int i = 0; i < (int)(n); i++) using vi = vector<int>; using vll = vector<ll>; /*//再帰関数木構造定型 int complete_time(vector<vector<int>> &children, int x) { // ベースケース if (children.at(x).size() == 0) { return 1; //...
[["+", 0, 14, 8, 9, 0, 1, 0, 16, 31, 22], ["+", 0, 14, 8, 9, 0, 1, 0, 16, 17, 152], ["+", 0, 14, 8, 9, 0, 1, 0, 16, 12, 22], ["+", 0, 30, 0, 14, 8, 9, 0, 1, 0, 35], ["-", 0, 9, 0, 57, 15, 339, 51, 11, 17, 32], ["+", 0, 9, 0, 57, 15, 339, 51, 16, 17, 60]]
1
92
/**Function Template**/ #include <bits/stdc++.h> using namespace std; typedef long long int ll; typedef pair<ll, ll> pint; const int MAX = 510000; const int MOD = 1000000007; #define rep(i, n) for (ll i = ll(0); i < ll(n); i++) #define Rep(i, n) for (ll i = ll(1); i < ll(n); i++) #define ALL(a) (a).begin(), (a).end() #...
/**Function Template**/ #include <bits/stdc++.h> using namespace std; typedef long long int ll; typedef pair<ll, ll> pint; const int MAX = 510000; const int MOD = 1000000007; #define rep(i, n) for (ll i = ll(0); i < ll(n); i++) #define Rep(i, n) for (ll i = ll(1); i < ll(n); i++) #define ALL(a) (a).begin(), (a).end() #...
[["+", 0, 30, 0, 14, 8, 9, 0, 9, 0, 46], ["-", 0, 30, 0, 14, 8, 9, 0, 9, 0, 46]]
1
1,257
T = input() count = 0 for c in T: count += 1 if c == '?' and T[count-2] == 'D': c = 'P' print(c, end="") elif c == '?': c = 'D' print(c, end="") else: print(c, end="")
T = input() count = 0 for c in T: count += 1 if c == '?' and T[count-1] == 'D': c = 'P' print(c, end="") elif c == '?': c = 'D' print(c, end="") else: print(c, end="")
[["-", 15, 679, 12, 666, 0, 206, 206, 657, 12, 612], ["+", 15, 679, 12, 666, 0, 206, 206, 657, 12, 612]]
5
80
#include <bits/stdc++.h> using namespace std; int main() { string t; cin >> t; int n = t.size(); for (int i = 1; i < n; i++) { if (t[i] == '?') t[i] = 'D'; } cout << t << endl; return 0; }
#include <bits/stdc++.h> using namespace std; int main() { string t; cin >> t; int n = t.size(); for (int i = 0; i < n; i++) { if (t[i] == '?') t[i] = 'D'; } cout << t << endl; return 0; }
[["-", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13], ["+", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13]]
1
73
#include <bits/stdc++.h> using namespace std; #define rep(i, s, n) for (int i = s; i <= n; i++) int main() { string str; cin >> str; int length = 0; while (str[length] != 0) length++; if (str[0] == '?') str[0] = 'P'; rep(i, 1, length) { if (str[i] == '?') { str[i] = 'D'; } } co...
#include <bits/stdc++.h> using namespace std; #define rep(i, s, n) for (int i = s; i <= n; i++) int main() { string str; cin >> str; int length = 0; while (str[length] != 0) length++; if (str[0] == '?') str[0] = 'D'; rep(i, 1, length) { if (str[i] == '?') { str[i] = 'D'; } } co...
[["-", 0, 57, 64, 1, 0, 11, 12, 103, 0, 125], ["+", 0, 57, 64, 1, 0, 11, 12, 103, 0, 125]]
1
105
if __name__ == "__main__": T = input() ans = T ans = ans.replace("??", 'PD') ans = ans.replace("P?", 'PD') ans = ans.replace("?D", 'PD') ans = ans.replace("?", 'D') print(ans)
if __name__ == "__main__": T = input() ans = T ans = ans.replace("P?", 'PD') ans = ans.replace("??", 'PD') ans = ans.replace("?D", 'PD') ans = ans.replace("?", 'D') print(ans)
[["-", 0, 662, 12, 652, 3, 4, 0, 557, 0, 6], ["+", 0, 662, 12, 652, 3, 4, 0, 557, 0, 6]]
5
75
#include <bits/stdc++.h> using namespace std; int main() { string T; cin >> T; for (int i = 0; i < T.size(); i++) { if (T.at(i) = '?') { T.at(i) = 'D'; } } cout << T << endl; }
#include <bits/stdc++.h> using namespace std; int main() { string T; cin >> T; for (int i = 0; i < T.size(); i++) { if (T.at(i) == '?') { T.at(i) = 'D'; } } cout << T << endl; }
[["-", 8, 9, 0, 57, 15, 339, 51, 11, 17, 32], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 60]]
1
71
#include <iostream> #include <string> using namespace std; int main() { int n, count = 0; string s; cin >> s; n = s.size(); for (int i = 1; i < n; i++) { if (s[i] == '?') s[i] = 'D'; } cout << s << endl; return 0; }
#include <iostream> #include <string> using namespace std; int main() { int n, count = 0; string s; char pref, next; cin >> s; n = s.size(); for (int i = 0; i < n; i++) { if (s[i] == '?') s[i] = 'D'; } cout << s << endl; return 0; }
[["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 49, 22], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 0, 21], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 0, 35], ["-", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13], ["+", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13]]
1
81
#include <bits/stdc++.h> using namespace std; int main() { string t; cin >> t; for (int i = 0; i < t.size(); i++) { if (t.at(i) == '?') { t.at(i) = 'P'; } } for (int i = 0; i < t.size(); i++) { cout << t.at(i); } cout << endl; }
#include <bits/stdc++.h> using namespace std; int main() { string t; cin >> t; for (int i = 0; i < t.size(); i++) { if (t.at(i) == '?') { t.at(i) = 'D'; } } for (int i = 0; i < t.size(); i++) { cout << t.at(i); } cout << endl; }
[["-", 64, 9, 0, 1, 0, 11, 12, 103, 0, 125], ["+", 64, 9, 0, 1, 0, 11, 12, 103, 0, 125]]
1
98
#include <bits/stdc++.h> using namespace std; #define N 20 #define endl "\n" #define IO \ ios_base::sync_with_stdio(0); \ cin.tie(0); \ ...
#include <bits/stdc++.h> using namespace std; #define N 20 #define endl "\n" #define IO \ ios_base::sync_with_stdio(0); \ cin.tie(0); \ ...
[["-", 0, 1, 0, 11, 12, 41, 75, 103, 0, 125], ["+", 0, 1, 0, 11, 12, 41, 75, 103, 0, 125]]
1
114
ret = "" for i in range(len(T)): if T[i]=="?": ret += "D" else: ret += T[i] print(ret)
T = input() ret = "" for i in range(len(T)): if T[i]=="?": ret += "D" else: ret += T[i] print(ret)
[["+", 36, 36, 0, 656, 0, 1, 0, 662, 31, 22], ["+", 36, 36, 0, 656, 0, 1, 0, 662, 0, 32], ["+", 0, 656, 0, 1, 0, 662, 12, 652, 63, 22], ["+", 0, 1, 0, 662, 12, 652, 3, 4, 0, 24], ["+", 0, 1, 0, 662, 12, 652, 3, 4, 0, 25]]
5
42
#include <bits/stdc++.h> #include <math.h> using namespace std; int main() { string T; cin >> T; for (int i = 0; i < T.size(); i++) { if (T.at(i) == '?') T.at(i) = 'D'; cout << T.at(i) << endl; } }
#include <bits/stdc++.h> #include <math.h> using namespace std; int main() { string T; cin >> T; for (int i = 0; i < T.size(); i++) { if (T.at(i) == '?') T.at(i) = 'D'; cout << T.at(i); } }
[["-", 0, 7, 8, 9, 0, 1, 0, 16, 17, 151], ["-", 0, 7, 8, 9, 0, 1, 0, 16, 12, 22]]
1
76
<?php $input = fgets(STDIN); $input_array = str_split( $input); $ans=""; foreach($input_array as $i => $char){ // if($char==="?"&&($input_array[$i-1]==="P")){ // $ans = $ans+"D"; // }elseif($char==="?"&&($input_array[$i-1]==="D")){ // $ans = $ans+$char; if($char==="?"){ $ans = $ans+"D"; }else{ $ans...
<?php $input = fgets(STDIN); $input_array = str_split( $input); $ans=""; foreach($input_array as $i => $char){ // if($char==="?"&&($input_array[$i-1]==="P")){ // $ans = $ans+"D"; // }elseif($char==="?"&&($input_array[$i-1]==="D")){ // $ans = $ans+$char; if($char==="?"){ $ans = $ans."D"; }else{ $ans...
[["-", 8, 9, 0, 1, 0, 11, 12, 16, 17, 72], ["+", 8, 9, 0, 1, 0, 11, 12, 16, 17, 131]]
6
78
T = input() l = list(T) l_replace = ["D" if i == "?" else i for i in l] print(l_replace)
T = input() l = list(T) l_replace = ["D" if i == "?" else i for i in l] print(''.join(l_replace))
[["+", 3, 4, 0, 652, 63, 319, 500, 557, 0, 654], ["+", 3, 4, 0, 652, 63, 319, 500, 557, 0, 655], ["+", 0, 652, 3, 4, 0, 652, 63, 319, 0, 131], ["+", 0, 652, 3, 4, 0, 652, 63, 319, 319, 22], ["+", 0, 652, 3, 4, 0, 652, 3, 4, 0, 24], ["+", 0, 652, 3, 4, 0, 652, 3, 4, 0, 25]]
5
34
#include <bits/stdc++.h> using namespace std; int main() { string s; cin >> s; for (int i = 1; i < s.length(); i++) { if (s.at(i) == '?') { s.at(i) = 'D'; } } cout << s << endl; }
#include <bits/stdc++.h> using namespace std; int main() { string s; cin >> s; for (int i = 0; i < s.length(); i++) { if (s.at(i) == '?') { s.at(i) = 'D'; } } cout << s << endl; }
[["-", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13], ["+", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13]]
1
71
#include <iomanip> #include <iostream> #include <string> typedef long long ll; using namespace std; const ll INF = 1e9; const ll MOD = 1e9 + 7; #define repi(i, n, init) for (ll i = init; i < (n); i++) int main() { string s; cin >> s; int n = s.size(); repi(i, n, 1) { if (s[i] == '?') { s[i] = 'D'; ...
#include <iomanip> #include <iostream> #include <string> typedef long long ll; using namespace std; const ll INF = 1e9; const ll MOD = 1e9 + 7; #define repi(i, n, init) for (ll i = init; i < (n); i++) int main() { string s; cin >> s; int n = s.size(); repi(i, n, 0) { if (s[i] == '?') { s[i] = 'D'; ...
[["-", 8, 9, 0, 1, 0, 2, 3, 4, 0, 13], ["+", 8, 9, 0, 1, 0, 2, 3, 4, 0, 13]]
1
103
s = input() r1 = s.replace('?','D').count('D') + s.replace('?','D').count('PD') r2 = s.replace('?','P').count('P') + s.replace('?','P').count('PD') if r1 >= r2: print(s.replace('?','D')) else: print(s.replace('?','P'))
s = input() r1 = s.replace('?','D').count('D') + s.replace('?','D').count('PD') r2 = s.replace('?','P').count('D') + s.replace('?','P').count('PD') if r1 >= r2: print(s.replace('?','D')) else: print(s.replace('?','P'))
[["-", 12, 657, 31, 652, 3, 4, 0, 557, 0, 6], ["+", 12, 657, 31, 652, 3, 4, 0, 557, 0, 6]]
5
124
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define rep2(i, a, b) for (int i = (int)(a); i < (int)(b); i++) #define FOR(i) for (cin >> i; i > 0; i--) #define elif else if #define pb push_back #define ll long long #define mp make_pair #define all(x) x.begin(), x.end() #define re(x) ...
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define rep2(i, a, b) for (int i = (int)(a); i < (int)(b); i++) #define FOR(i) for (cin >> i; i > 0; i--) #define elif else if #define pb push_back #define ll long long #define mp make_pair #define all(x) x.begin(), x.end() #define re(x) ...
[["-", 0, 9, 0, 57, 15, 339, 51, 11, 17, 32], ["+", 0, 9, 0, 57, 15, 339, 51, 16, 17, 60]]
1
117
T = input() T.replace("?","D")
T = input() print(T.replace("?","D"))
[["+", 36, 36, 0, 656, 0, 1, 0, 652, 63, 22], ["+", 0, 656, 0, 1, 0, 652, 3, 4, 0, 24], ["+", 0, 652, 3, 4, 0, 652, 3, 4, 0, 25]]
5
17
#include <bits/stdc++.h> using namespace std; int main() { string s; int cnt = 0; cin >> s; for (int i = 0; i < s.size(); i++) { if (s[i] == '?') s[i] = 'D'; if (s[i + 1] == '?') s[i + 1] = 'D'; if (s[i] == 'D') cnt++; if (s[i] == 'P' && s[i + 1] == 'D') cnt++; } co...
#include <bits/stdc++.h> using namespace std; int main() { string s; int cnt = 0; cin >> s; for (int i = 0; i < s.size(); i++) { if (s[i] == '?') s[i] = 'D'; if (s[i + 1] == '?') s[i + 1] = 'D'; if (s[i] == 'D') cnt++; if (s[i] == 'P' && s[i + 1] == 'D') cnt++; } co...
[["-", 8, 9, 0, 1, 0, 16, 31, 16, 12, 22], ["+", 8, 9, 0, 1, 0, 16, 31, 16, 12, 22]]
1
136
#include <bits/stdc++.h> using namespace std; int main() { //すべてをDに変えてみる string T; cin >> T; int l; l = T.size(); int x; x = 0; for (int i = 0; i < l; i++) { if (T.at(i) == '?' || T.at(i) == 'D') { x = x + 1; } } for (int i = 0; i < l - 1; i++) { if (T.at(i) == 'P' && T.at(i + ...
#include <bits/stdc++.h> using namespace std; int main() { //すべてをDに変えてみる string T; cin >> T; int l; l = T.size(); int x; x = 0; for (int i = 0; i < l; i++) { if (T.at(i) == '?' || T.at(i) == 'D') { x = x + 1; } } for (int i = 0; i < l - 1; i++) { if (T.at(i) == 'P' && T.at(i + ...
[["-", 8, 9, 0, 7, 15, 16, 12, 16, 17, 33], ["-", 8, 9, 0, 7, 15, 16, 12, 16, 12, 13]]
1
238
if m.count("?")>0 n=m.count("?") end s=[] count=0 sum=0 v=0 for i in 0..m.length if m[i]=="?" m[i]="D" end end puts m
m=gets.chomp if m.count("?")>0 n=m.count("?") end s=[] count=0 sum=0 v=0 for i in 0..m.length if m[i]=="?" m[i]="D" end end puts m
[["+", 36, 36, 36, 36, 0, 493, 0, 662, 31, 22], ["+", 36, 36, 36, 36, 0, 493, 0, 662, 0, 32], ["+", 36, 36, 0, 493, 0, 662, 12, 652, 486, 22], ["+", 36, 36, 0, 493, 0, 662, 12, 652, 17, 131], ["+", 36, 36, 0, 493, 0, 662, 12, 652, 735, 22]]
4
64
t = input() ans = [0]*(len(t)) for i,c in enumerate(t): if i !=0 and c =="?": ans[i] = "D" else: ans[i] = t[i] print(*ans,sep="")
t = input() ans = [0]*(len(t)) for i,c in enumerate(t): if c=="?": ans[i] = "D" else: ans[i] = t[i] print(*ans,sep="")
[["-", 8, 196, 0, 57, 15, 679, 31, 666, 0, 22], ["-", 8, 196, 0, 57, 15, 679, 31, 666, 667, 79], ["-", 8, 196, 0, 57, 15, 679, 31, 666, 0, 612], ["-", 0, 7, 8, 196, 0, 57, 15, 679, 17, 355]]
5
67
s = input() s = list(s) #s = list('PD?D??P') #print(s) nagasa = len(s) for m in range(nagasa): for i in s[m]: if i == '?': s[m] = 'D' else: pass print(s)
s = input() s = list(s) #s = list('PD?D??P') #print(s) nagasa = len(s) for m in range(nagasa): for i in s[m]: if i == '?': s[m] = 'D' else: pass print(''.join(s))
[["+", 3, 4, 0, 652, 63, 319, 500, 557, 0, 654], ["+", 3, 4, 0, 652, 63, 319, 500, 557, 0, 655], ["+", 0, 652, 3, 4, 0, 652, 63, 319, 0, 131], ["+", 0, 652, 3, 4, 0, 652, 63, 319, 319, 22], ["+", 0, 652, 3, 4, 0, 652, 3, 4, 0, 24], ["+", 0, 652, 3, 4, 0, 652, 3, 4, 0, 25]]
5
57
#include "bits/stdc++.h" #define rep(i, N) for (int i = 0; i < N; i++) typedef long long ll; const int mod = 1e9 + 7; using namespace std; int main(void) { string T; cin >> T; rep(i, T.length()) if (T[i] = '?') T[i] = 'D'; cout << T << endl; return 0; }
#include "bits/stdc++.h" #define rep(i, N) for (int i = 0; i < N; i++) typedef long long ll; const int mod = 1e9 + 7; using namespace std; int main(void) { string T; cin >> T; rep(i, T.length()) if (T[i] == '?') T[i] = 'D'; cout << T << endl; return 0; }
[["-", 8, 9, 0, 57, 15, 339, 51, 11, 17, 32], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 60]]
1
83
t = input() t_list = list(t) cnt = 0 for i in range(len(t_list)): if t_list[i] == '?': t_list[i] = 'D' print(t_list)
t = input() t_list = list(t) cnt = 0 for i in range(len(t_list)): if t_list[i] == '?': t_list[i] = 'D' print(''.join(t_list))
[["+", 3, 4, 0, 652, 63, 319, 500, 557, 0, 654], ["+", 3, 4, 0, 652, 63, 319, 500, 557, 0, 655], ["+", 0, 652, 3, 4, 0, 652, 63, 319, 0, 131], ["+", 0, 652, 3, 4, 0, 652, 63, 319, 319, 22], ["+", 0, 652, 3, 4, 0, 652, 3, 4, 0, 24], ["+", 0, 652, 3, 4, 0, 652, 3, 4, 0, 25]]
5
47
#include <bits/stdc++.h> using namespace std; int main() { string T; cin >> T; for (char c : T) { if (c == '?') { c = '?'; } cout << c; } cout << endl; }
#include <bits/stdc++.h> using namespace std; int main() { string T; cin >> T; for (char c : T) { if (c == '?') { c = 'D'; } cout << c; } cout << endl; }
[["-", 64, 9, 0, 1, 0, 11, 12, 103, 0, 125], ["+", 64, 9, 0, 1, 0, 11, 12, 103, 0, 125]]
1
52
#include <stdio.h> #include <string.h> int main() { int i, len; char str[200001]; scanf("%s", str); len = strlen(str); for (i = 0; i < len; i++) { if (str[i] == '?') { if (str[i - 1] == 'P') { str[i] = 'D'; } else { str[i] = 'P'; } } } printf("%s", str); ...
#include <stdio.h> #include <string.h> int main() { int i, len; char str[200001]; scanf("%s", str); len = strlen(str); for (i = 0; i < len; i++) { if (str[i] == '?') { if (str[i - 1] == 'P') { str[i] = 'D'; } else { str[i] = 'D'; } } } printf("%s", str); ...
[["-", 0, 9, 0, 1, 0, 11, 12, 103, 0, 125], ["+", 0, 9, 0, 1, 0, 11, 12, 103, 0, 125]]
0
113
#include <algorithm> #include <iostream> #include <string> #include <vector> #define REP(i, n) for (ll i = 0; i < n; i++) #define REPR(i, n) for (ll i = n; i >= 0; i--) #define FOR(i, m, n) for (ll i = m; i < n; i++) #define INF 2e9 #define ALL(v) v.begin(), v.end() #define DESC std::greater<int>() // sort 3rd arg us...
#include <algorithm> #include <iostream> #include <string> #include <vector> #define REP(i, n) for (ll i = 0; i < n; i++) #define REPR(i, n) for (ll i = n; i >= 0; i--) #define FOR(i, m, n) for (ll i = m; i < n; i++) #define INF 2e9 #define ALL(v) v.begin(), v.end() #define DESC std::greater<int>() // sort 3rd arg us...
[["-", 8, 9, 0, 57, 15, 339, 51, 11, 17, 32], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 60], ["-", 8, 9, 0, 57, 64, 9, 0, 37, 0, 38], ["-", 8, 9, 0, 57, 64, 9, 0, 37, 0, 13], ["-", 8, 9, 0, 57, 64, 9, 0, 37, 0, 35], ["+", 8, 9, 0, 57, 75, 76, 0, 9, 0, 46], ["-", 8, 9, 0, 57, 75, 76, 0, 9, 0, 46]]
1
472
#include <bits/stdc++.h> #define ll long long int using namespace std; #define m 998244353 long long int fastexpo(long long int a, long long int b) { long long int ans = 1; while (b) { if (b & 1) ans = (ans * a) % m; b = b / 2; a = (a * a) % m; } return ans; } int main() { string str; cin...
#include <bits/stdc++.h> #define ll long long int using namespace std; #define m 998244353 long long int fastexpo(long long int a, long long int b) { long long int ans = 1; while (b) { if (b & 1) ans = (ans * a) % m; b = b / 2; a = (a * a) % m; } return ans; } int main() { string str; cin...
[["-", 8, 9, 0, 7, 10, 43, 49, 50, 49, 22], ["+", 8, 9, 0, 7, 10, 43, 49, 50, 49, 22], ["-", 0, 14, 8, 9, 0, 7, 15, 16, 31, 22], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 31, 22], ["-", 0, 14, 8, 9, 0, 7, 26, 27, 28, 22], ["+", 0, 14, 8, 9, 0, 7, 26, 27, 28, 22], ["-", 15, 339, 51, 16, 31, 69, 341, 342, 0, 22], ["+", 15, 339, 5...
1
186
// SeeAlso: #include <bits/stdc++.h> using namespace std; typedef long long ll; typedef vector<int> vi; typedef vector<ll> vl; typedef pair<int, int> pii; typedef pair<ll, ll> pll; #define MAX 100000 #define NIL -1 #define MOD 1000000007 typedef int _loop_int; #define rep(i, n) for (int i = 0; i < n; i++) #define ...
// SeeAlso: #include <bits/stdc++.h> using namespace std; typedef long long ll; typedef vector<int> vi; typedef vector<ll> vl; typedef pair<int, int> pii; typedef pair<ll, ll> pll; #define MAX 100000 #define NIL -1 #define MOD 1000000007 typedef int _loop_int; #define rep(i, n) for (int i = 0; i < n; i++) #define ...
[["-", 0, 14, 8, 9, 0, 1, 0, 2, 63, 22], ["+", 0, 14, 8, 9, 0, 14, 49, 53, 49, 22], ["-", 8, 9, 0, 1, 0, 2, 3, 4, 0, 13], ["-", 8, 9, 0, 1, 0, 2, 3, 4, 0, 21], ["-", 0, 1, 0, 2, 3, 4, 0, 25, 0, 35]]
1
413
import java.math.*; import java.util.*; class Main { public static void main(String[] args) { try (Scanner sc = new Scanner(System.in)) { String str = sc.next(); str.replace("?", "D"); System.out.println(str); } catch (Exception e) { e.printStackTrace(); } } }
import java.math.*; import java.util.*; class Main { public static void main(String[] args) { try (Scanner sc = new Scanner(System.in)) { String str = sc.next(); str = str.replace("?", "D"); System.out.println(str); } catch (Exception e) { e.printStackTrace(); } } }
[["+", 0, 530, 8, 196, 0, 1, 0, 11, 17, 32], ["+", 8, 196, 0, 1, 0, 11, 12, 492, 500, 22]]
3
89
S=input() S=S.replace("?","D") S
S=input() S=S.replace("?","D") print(S)
[["+", 36, 36, 0, 656, 0, 1, 0, 652, 63, 22], ["+", 0, 656, 0, 1, 0, 652, 3, 4, 0, 24], ["+", 0, 656, 0, 1, 0, 652, 3, 4, 0, 25]]
5
20
t=list(input()) if t[-1]=='?': t[-1]='D' indexes = [i for i, x in enumerate(t) if x == '?'] for i in range(len(indexes)-1,0,-1): a=indexes[i] if t[a-1]=='P': t[a]='D' else: if t[a+1]=='D': t[a]='P' else: t[a]='D' a=t.index('?') if t[a-1]=='P': t[a]='D'...
t=list(input()) if t[-1]=='?': t[-1]='D' indexes = [i for i, x in enumerate(t) if x == '?'] for i in range(len(indexes)-1,0,-1): a=indexes[i] if t[a-1]=='P': t[a]='D' else: if t[a+1]=='D': t[a]='P' else: t[a]='D' if '?'in t: a=t.index('?') if t[a-1...
[["+", 36, 36, 36, 36, 0, 656, 0, 57, 0, 121], ["+", 0, 656, 0, 57, 15, 666, 0, 557, 0, 654], ["+", 0, 656, 0, 57, 15, 666, 0, 557, 0, 6], ["+", 0, 656, 0, 57, 15, 666, 0, 557, 0, 655], ["+", 36, 36, 0, 656, 0, 57, 15, 666, 667, 267], ["+", 36, 36, 0, 656, 0, 57, 15, 666, 0, 22], ["+", 36, 36, 36, 36, 0, 656, 0, 57, 0,...
5
196
function Main(t) { let characters = t.split(""); for (let i = 0; characters[i]; i++) if (characters[i] = "?") characters[i] = "D"; let joined = characters.join(""); console.log(joined); } Main(require("fs").readFileSync("/dev/stdin", "utf8"));
function Main(t) { let characters = t.split(""); for (let i = 0; characters[i]; i++) if (characters[i] == "?") characters[i] = "D"; let joined = characters.join(""); console.log(joined); } Main(require("fs").readFileSync("/dev/stdin", "utf8"));
[["-", 0, 7, 8, 57, 15, 23, 0, 11, 0, 32], ["+", 0, 7, 8, 57, 15, 23, 0, 16, 17, 60]]
2
92
#include <iostream> using namespace std; int main() { char a[200001]; int i = 0; cin >> a; for (;;) { if (a[i] == '\0') break; if (a[i] == '?') cout << 'D', i++; cout << a[i++]; } return 0; }
#include <iostream> using namespace std; int main() { char a[200001]; int i = 0; cin >> a; for (;;) { if (a[i] == '\0') break; if (a[i] == '?') cout << 'D', i++; else cout << a[i++]; } return 0; }
[["+", 0, 7, 8, 9, 0, 57, 75, 76, 0, 95]]
1
78
#include <stdio.h> int main(void) { char t[1000000]; scanf("%s", t); for (long int i = 1; t[i] != '\0'; i++) { if (t[i] == '?') { t[i] = 'D'; } } printf("%s\n", t); return 0; }
#include <stdio.h> int main(void) { char t[1000000]; scanf("%s", t); for (long int i = 0; t[i] != '\0'; i++) { if (t[i] == '?') { t[i] = 'D'; } } printf("%s\n", t); return 0; }
[["-", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13], ["+", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13]]
0
81
#include <stdio.h> #include <string.h> int main(int argc, char *argv[]) { char t[300000]; int i; memset(t, 0x00, sizeof(t)); scanf("%s\n", t); for (i = 0; t[i] != 0x00; i++) { if (t[i] == '?') t[i] = 'P'; } printf("%s\n", t); return (0); }
#include <stdio.h> #include <string.h> int main(int argc, char *argv[]) { char t[300000]; int i; memset(t, 0x00, sizeof(t)); scanf("%s\n", t); for (i = 0; t[i] != 0x00; i++) { if (t[i] == '?') t[i] = 'D'; } printf("%s\n", t); return (0); }
[["-", 0, 57, 64, 1, 0, 11, 12, 103, 0, 125], ["+", 0, 57, 64, 1, 0, 11, 12, 103, 0, 125]]
0
102
s = input() n = len(s) news = [] for l in s: news.append(l) s = news for i in range(1,n): if s[i] == '?': s[i] = 'D' print(''.join(s))
s = input() n = len(s) news = [] for l in s: news.append(l) s = news for i in range(n): if s[i] == '?': s[i] = 'D' print(''.join(s))
[["-", 0, 656, 0, 7, 12, 652, 3, 4, 0, 612], ["-", 0, 656, 0, 7, 12, 652, 3, 4, 0, 21]]
5
67
T=input() T=list(T) for i in range(len(T)): j=int(i) if T[j]=='?': T[j]='D' "".join(T) print(T)
T=input() T=list(T) for i in range(len(T)): j=int(i) if T[j]=='?': T[j]='D' T="".join(T) print(T)
[["+", 36, 36, 0, 656, 0, 1, 0, 662, 31, 22], ["+", 36, 36, 0, 656, 0, 1, 0, 662, 0, 32]]
5
57
// atcoder.cpp.cpp : このファイルには 'main' // 関数が含まれています。プログラム実行の開始と終了がそこで行われます。 // #include <iostream> #include <math.h> #include <random> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <time.h> using namespace std; // std::random_device rnd; //グロ変 int main() { char enter[10000000]; cin >> enter...
// atcoder.cpp.cpp : このファイルには 'main' // 関数が含まれています。プログラム実行の開始と終了がそこで行われます。 // #include <iostream> #include <math.h> #include <random> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <time.h> using namespace std; // std::random_device rnd; //グロ変 int main() { char enter[200000]; cin >> enter; ...
[["-", 0, 14, 8, 9, 0, 43, 49, 80, 81, 13], ["+", 0, 14, 8, 9, 0, 43, 49, 80, 81, 13], ["-", 0, 57, 15, 339, 51, 16, 12, 103, 0, 44], ["+", 0, 57, 15, 339, 51, 16, 12, 103, 0, 44], ["+", 0, 52, 8, 9, 0, 1, 0, 27, 28, 22], ["+", 0, 52, 8, 9, 0, 1, 0, 27, 17, 29], ["+", 8, 9, 0, 52, 8, 9, 0, 1, 0, 35]]
1
91
#include <bits/stdc++.h> using namespace std; typedef long long ll; int main() { string str; cin >> str; int j = 1; for (int i = 0; i < str.size(); i++) { if (str[i] == '?') str[i] = 'P'; } cout << str << endl; return 0; /*for(;j<str.size();j++) { if(str[j-1]=='?')str[j-1]='P'; ...
#include <bits/stdc++.h> using namespace std; typedef long long ll; int main() { string str; cin >> str; // int j=1; for (int i = 0; i < str.size(); i++) { if (str[i] == '?') str[i] = 'D'; } cout << str << endl; return 0; }
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["-", 0, 14, 8, 9, 0, 43, 49, 50, 49, 22], ["-", 0, 14, 8, 9, 0, 43, 49, 50, 0, 32], ["-", 0, 14, 8, 9, 0, 43, 49, 50, 51, 13], ["-", 0, 30, 0, 14, 8, 9, 0, 43, 0, 35], ["-", 0, 57, 64, 1, 0, 11, 12, 103, 0, 125], ["+", 0, 57, 64, 1, 0, 11, 12, 103, 0, 125]]
1
79
t = input() t.replace("?","D") print(t)
t = input() t = t.replace("?","D") print(t)
[["+", 36, 36, 0, 656, 0, 1, 0, 662, 0, 32], ["+", 0, 1, 0, 662, 12, 652, 63, 319, 500, 22]]
5
21
import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); // 入力値保持 String sin = sc.next(); String ans = sin.replaceAll("?", "D"); // 結果出力 System.out.println(ans); } }
import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); // 入力値保持 String sin = sc.next(); String ans = sin.replace("?", "D"); // 結果出力 System.out.println(ans); } }
[["-", 8, 196, 0, 503, 49, 200, 51, 492, 141, 22], ["+", 8, 196, 0, 503, 49, 200, 51, 492, 141, 22]]
3
71
#include <bits/stdc++.h> using namespace std; #define ll unsigned long long int int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); // freopen("input.txt","r",stdin); // freopen("output.txt","w",stdout); string S; cin >> S; int N = S.size(); if (S[0] == '?') S[0] = 'P'; for (int i = 1; i...
#include <bits/stdc++.h> using namespace std; #define ll unsigned long long int int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); // freopen("input.txt","r",stdin); // freopen("output.txt","w",stdout); string S; cin >> S; int N = S.size(); if (S[0] == '?') S[0] = 'D'; for (int i = 1; i...
[["-", 0, 57, 64, 1, 0, 11, 12, 103, 0, 125], ["+", 0, 57, 64, 1, 0, 11, 12, 103, 0, 125], ["-", 64, 9, 0, 1, 0, 11, 12, 103, 0, 125], ["+", 64, 9, 0, 1, 0, 11, 12, 103, 0, 125]]
1
109
import sys import math import itertools s = input() ans='' for i in range(len(s)): if(s[i]==''): ans+='D' else: ans += s[i] print(ans)
import sys import math import itertools s = input() ans='' for i in range(len(s)): if(s[i]=='?'): ans+='D' else: ans += s[i] print(ans)
[["+", 0, 57, 15, 23, 0, 666, 0, 557, 0, 6]]
5
54
t = input() t_replace = [t.replace('?', 'D')] print(t_replace)
t = input() t_replace = t.replace('?', 'D') print(t_replace)
[["-", 0, 656, 0, 1, 0, 662, 12, 634, 0, 70], ["-", 0, 656, 0, 1, 0, 662, 12, 634, 0, 73]]
5
25
#pragma GCC optimize("Ofast") #include <algorithm> #include <cstdio> #include <cstdlib> #include <iomanip> #include <iostream> #include <math.h> #include <queue> #include <string> #include <utility> #include <vector> using namespace std; string t; int main() { cin >> t; for (int i = 0; i < t.length() - 1; i++) {...
#pragma GCC optimize("Ofast") #include <algorithm> #include <cstdio> #include <cstdlib> #include <iomanip> #include <iostream> #include <math.h> #include <queue> #include <string> #include <utility> #include <vector> using namespace std; string t; int main() { cin >> t; for (int i = 0; i < t.size(); i++) { i...
[["-", 15, 16, 12, 16, 31, 2, 63, 118, 119, 120], ["+", 0, 7, 15, 16, 12, 2, 63, 118, 119, 120], ["-", 8, 9, 0, 7, 15, 16, 12, 16, 17, 33], ["-", 8, 9, 0, 7, 15, 16, 12, 16, 12, 13]]
1
87
#include <bits/stdc++.h> #define _USE_MATH_DEFINES #include <algorithm> #include <math.h> #define rep(i, n) for (int i = 0; i < (n); ++i) #define all(x) x.begin(), x.end() #define rall(x) x.rbegin(), x.rend() #define acc(v) accumulate(v.begin(), v.end(), 0) using namespace std; typedef long long ll; const int INF = 1e...
#include <bits/stdc++.h> #define _USE_MATH_DEFINES #include <algorithm> #include <math.h> #define rep(i, n) for (int i = 0; i < (n); ++i) #define all(x) x.begin(), x.end() #define rall(x) x.rbegin(), x.rend() #define acc(v) accumulate(v.begin(), v.end(), 0) using namespace std; typedef long long ll; const int INF = 1e...
[["-", 0, 1, 0, 2, 3, 4, 0, 16, 17, 33], ["-", 0, 1, 0, 2, 3, 4, 0, 16, 12, 13]]
1
120
T = str(input()) ans = '' for i,t in eumerate(T): if t != '?': ans += t else: ans += 'D' print(ans)
T = str(input()) ans = '' for t in T: if t != '?': ans += t else: ans += 'D' print(ans)
[["-", 36, 36, 0, 656, 0, 7, 31, 684, 0, 22], ["-", 36, 36, 0, 656, 0, 7, 31, 684, 0, 21], ["-", 36, 36, 0, 656, 0, 7, 12, 652, 63, 22], ["-", 0, 656, 0, 7, 12, 652, 3, 4, 0, 24], ["-", 0, 656, 0, 7, 12, 652, 3, 4, 0, 25]]
5
43
T=list(input()) T2=(T.replace('?', 'd')) print(T2)
T=input() T2=(T.replace('?', 'D')) print(T2)
[["-", 0, 656, 0, 1, 0, 662, 12, 652, 63, 22], ["-", 0, 1, 0, 662, 12, 652, 3, 4, 0, 24], ["-", 0, 1, 0, 662, 12, 652, 3, 4, 0, 25], ["-", 12, 23, 0, 652, 3, 4, 0, 557, 0, 6], ["+", 12, 23, 0, 652, 3, 4, 0, 557, 0, 6]]
5
28
t=list(input()) for i in range(1,len(t)): if t[i]=="?": t[i]="D" print("".join(t))
t=list(input()) for i in range(len(t)): if t[i]=="?": t[i]="D" print("".join(t))
[["-", 0, 656, 0, 7, 12, 652, 3, 4, 0, 612], ["-", 0, 656, 0, 7, 12, 652, 3, 4, 0, 21]]
5
49
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); String T = sc.next(); sc.close(); StringBuffer sb = new StringBuffer(); if (T.charAt(0) == '?') { sb.append('D'); for (int i = 0; i < T.length(); i++) { ...
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); String T = sc.next(); sc.close(); StringBuffer sb = new StringBuffer(); if (T.charAt(0) == '?') { sb.append('D'); for (int i = 1; i < T.length(); i++) { ...
[["-", 64, 196, 0, 7, 502, 503, 49, 200, 51, 499], ["+", 64, 196, 0, 7, 502, 503, 49, 200, 51, 499]]
3
258
t = input() max = 0 tmp = 0 t = t.replace('?', 'D') #print(t) # how many D tmp = t.count('D') # how many PD tmp += t.count('PD') max = tmp print(max)
t = input() #t = 'PD?D??P' max = 0 tmp = 0 t = t.replace('?', 'D') #print(t) # how many D tmp = t.count('D') # how many PD tmp += t.count('PD') max = tmp print(t)
[["-", 0, 656, 0, 1, 0, 652, 3, 4, 0, 22], ["+", 0, 656, 0, 1, 0, 652, 3, 4, 0, 22]]
5
55
import re def solve(stri): point = 0 # Dの数 for a in stri: if a == "D": point += 1 # PDの数 searched_pd = re.findall("PD",stri) point += len(searched_pd) return point T = input() T2 = re.sub('\?','D',T) print(solve(T2))
import re def solve(stri): point = 0 # Dの数 for a in stri: if a == "D": point += 1 # PDの数 searched_pd = re.findall("PD",stri) point += len(searched_pd) return point T = input() T2 = re.sub('\?','D',T) print(T2)
[["-", 0, 1, 0, 652, 3, 4, 0, 652, 63, 22], ["-", 0, 652, 3, 4, 0, 652, 3, 4, 0, 24], ["-", 0, 652, 3, 4, 0, 652, 3, 4, 0, 25]]
5
76
t = list(input()) for i in range(len(t)-1): if t[i] == "?": # t[i] = "D"x print("D",end = "") else: print(t[i],end = "")
t = list(input()) for i in range(len(t)): if t[i] == "?": # t[i] = "D"x print("D",end = "") else: print(t[i],end = "")
[["-", 0, 7, 12, 652, 3, 4, 0, 657, 17, 33], ["-", 0, 7, 12, 652, 3, 4, 0, 657, 12, 612]]
5
57
T = gets.chomp p T.gsub('?', 'D')
T = gets.chomp puts T.gsub('?', 'D')
[["-", 36, 36, 36, 36, 0, 493, 0, 652, 735, 22], ["+", 36, 36, 36, 36, 0, 493, 0, 652, 735, 22]]
4
18
#include <bits/stdc++.h> using namespace std; int main() { string t; cin >> t; for (int i = 0; i < t.size() - 1; i++) { if (t[i] == '?') { t[i] = 'D'; } } cout << t; }
#include <bits/stdc++.h> using namespace std; int main() { string t; cin >> t; for (int i = 0; i < t.size(); i++) { if (t[i] == '?') { t[i] = 'D'; } } cout << t; }
[["-", 8, 9, 0, 7, 15, 16, 12, 16, 17, 33], ["-", 8, 9, 0, 7, 15, 16, 12, 16, 12, 13]]
1
67
T = list(input()) N = len(T) for i in range(1,N): if T[i] == '?': T[i] = 'D' T="".join(T) print(T)
T = list(input()) N = len(T) for i in range(N): if T[i] == '?': T[i] = 'D' T="".join(T) print(T)
[["-", 0, 656, 0, 7, 12, 652, 3, 4, 0, 612], ["-", 0, 656, 0, 7, 12, 652, 3, 4, 0, 21]]
5
55
T=input() T=[str(t) for t in T] for a in range(len(T)): if T[a]=='?': if a-1>=0 and T[a-1]=='P': T[a]='D' elif a+1>len(T)-1: T[a]='D' else: T[a]='P' print(''.join(T))
T=input() T=[str(t) for t in T] for a in range(len(T)): if T[a]=='?': if a-1>=0 and T[a-1]=='P': T[a]='D' elif a+1>len(T)-1: T[a]='D' else: T[a]='D' print(''.join(T))
[["-", 8, 196, 0, 1, 0, 662, 12, 557, 0, 6], ["+", 8, 196, 0, 1, 0, 662, 12, 557, 0, 6]]
5
104
t = list(input()) for i in range(len(t)): if t[i]=='?': if i==0: t[i]='?' if t[i-1]=='D': t[i]='P' else: t[i]='D' print(''.join(t))
t = list(input()) for i in range(len(t)): if t[i]=='?': if i==0: t[i]='?' if t[i-1]=='P': t[i]='D' else: t[i]='D' print(''.join(t))
[["-", 64, 196, 0, 57, 15, 666, 0, 557, 0, 6], ["+", 64, 196, 0, 57, 15, 666, 0, 557, 0, 6], ["-", 64, 196, 0, 1, 0, 662, 12, 557, 0, 6], ["+", 64, 196, 0, 1, 0, 662, 12, 557, 0, 6]]
5
82
// // main.cpp // NOMURA_2020_B // // Created by Joe Mori on 2020/05/30. // Copyright © 2020 Joe Mori. All rights reserved. // #include <iostream> #include <string> int main() { // insert code here... std::string str; std::cin >> str; for (long long int i = 0; i < str.length(); i++) { if (str.at(i) == ...
// // main.cpp // NOMURA_2020_B // // Created by Joe Mori on 2020/05/30. // Copyright © 2020 Joe Mori. All rights reserved. // #include <iostream> #include <string> int main() { // insert code here... std::string str; std::cin >> str; for (long long int i = 0; i < str.length(); i++) { if (str.at(i) == ...
[["-", 64, 9, 0, 1, 0, 11, 12, 103, 0, 125], ["+", 64, 9, 0, 1, 0, 11, 12, 103, 0, 125]]
1
90
t = input() l = [_ for i in range(len(t))] for i in range(0, len(t)): if t[i] =="?": l[i] = "D" else: l[i] = t[i] print("".join(l))
t = input() l = ["" for i in range(len(t))] for i in range(0, len(t)): if t[i] =="?": l[i] = "D" else: l[i] = t[i] print("".join(l))
[["-", 0, 656, 0, 1, 0, 662, 12, 658, 8, 22], ["+", 0, 1, 0, 662, 12, 658, 8, 557, 0, 654], ["+", 0, 1, 0, 662, 12, 658, 8, 557, 0, 655]]
5
72
S = list(input()) ans = [0]*len(S) for i in range(len(S)): if S[i] == "?": ans[i] = "D" else: ans[i] = "P" S1 = "".join(ans) print(S1)
S = list(input()) ans = [0]*len(S) for i in range(len(S)): if S[i] == "?": ans[i] = "D" else: ans[i] = S[i] S1 = "".join(ans) print(S1)
[["-", 8, 196, 0, 1, 0, 662, 12, 557, 0, 654], ["-", 8, 196, 0, 1, 0, 662, 12, 557, 0, 6], ["-", 8, 196, 0, 1, 0, 662, 12, 557, 0, 655], ["+", 8, 196, 0, 1, 0, 662, 12, 206, 51, 22], ["+", 8, 196, 0, 1, 0, 662, 12, 206, 0, 70], ["+", 8, 196, 0, 1, 0, 662, 12, 206, 206, 22], ["+", 8, 196, 0, 1, 0, 662, 12, 206, 0, 73]]
5
70
#include <algorithm> #include <iostream> #include <string> using namespace std; int main() { string T; cin >> T; for (long long i = 0; i < 200001; i++) { if (T[i] == '?') { T[i] = 'D'; } } cout << T << endl; }
#include <algorithm> #include <iostream> #include <string> using namespace std; int main() { string T; cin >> T; for (long long i = 0; i < T.length(); i++) { if (T[i] == '?') { T[i] = 'D'; } } cout << T << endl; }
[["-", 0, 14, 8, 9, 0, 7, 15, 16, 12, 13], ["+", 0, 7, 15, 16, 12, 2, 63, 118, 28, 22], ["+", 0, 7, 15, 16, 12, 2, 63, 118, 17, 131], ["+", 0, 7, 15, 16, 12, 2, 63, 118, 119, 120], ["+", 0, 7, 15, 16, 12, 2, 3, 4, 0, 24], ["+", 0, 7, 15, 16, 12, 2, 3, 4, 0, 25]]
1
68
#include <algorithm> #include <climits> #include <cmath> #include <cstdio> #include <cstring> #include <functional> #include <iostream> #include <limits> #include <list> #include <map> #include <numeric> #include <queue> #include <set> #include <sstream> #include <string> #include <tuple> #include <type_traits> #includ...
#include <algorithm> #include <climits> #include <cmath> #include <cstdio> #include <cstring> #include <functional> #include <iostream> #include <limits> #include <list> #include <map> #include <numeric> #include <queue> #include <set> #include <sstream> #include <string> #include <tuple> #include <type_traits> #includ...
[["-", 8, 9, 0, 52, 15, 339, 51, 16, 17, 47], ["+", 8, 9, 0, 52, 15, 339, 51, 16, 17, 20]]
1
394
#include <stdio.h> #include <stdlib.h> #include <string.h> #define MOD 1000000007 #define INF 20000000000000 #define PI 3.14159265359 #define ull unsigned long long int main() { char t[200002] = {}, num = 0; scanf("%s", t); while (t[num] != '\0') { if (t[num] != '?') t[num] = 'D'; num++; } prin...
#include <stdio.h> #include <stdlib.h> #include <string.h> #define MOD 1000000007 #define INF 20000000000000 #define PI 3.14159265359 #define ull unsigned long long int main() { char t[200002] = {}; int num = 0; scanf("%s", t); while (t[num] != '\0') { if (t[num] == '?') t[num] = 'D'; num++; } ...
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 0, 21], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 0, 35], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["-", 8, 9, 0, 57, 15, 23, 0, 16, 17, 79], ["+", 8, 9, 0, 57, 15, 23, 0, 16, 17, 60]]
0
94
#define _GLIBCXX_DEBUG #include <bits/stdc++.h> using namespace std; #if __has_include(<boost/multiprecision/cpp_int.hpp>) #include <boost/multiprecision/cpp_int.hpp> #include <boost/multiprecision/cpp_dec_float.hpp> using bll = boost::multiprecision::cpp_int; using bdouble = boost::multiprecision::cpp_dec_float_100; u...
#define _GLIBCXX_DEBUG #include <bits/stdc++.h> using namespace std; #if __has_include(<boost/multiprecision/cpp_int.hpp>) #include <boost/multiprecision/cpp_int.hpp> #include <boost/multiprecision/cpp_dec_float.hpp> using bll = boost::multiprecision::cpp_int; using bdouble = boost::multiprecision::cpp_dec_float_100; u...
[["-", 0, 57, 64, 9, 0, 1, 0, 16, 17, 60], ["+", 0, 57, 64, 9, 0, 1, 0, 11, 17, 32]]
1
1,873
#include <bits/stdc++.h> using namespace std; #define int long long #define S second #define F first #define pb push_back #define all(c) (c).begin(), (c).end() #define rall(c) (c).rbegin(), (c).rend() #define lb lower_bound #define si(c) (int)((c).size()) #define lcm(a, b) (a * (b / __gcd(a, b))) #define inf (int)(1e1...
#include <bits/stdc++.h> using namespace std; #define int long long #define S second #define F first #define pb push_back #define all(c) (c).begin(), (c).end() #define rall(c) (c).rbegin(), (c).rend() #define lb lower_bound #define si(c) (int)((c).size()) #define lcm(a, b) (a * (b / __gcd(a, b))) #define inf (int)(1e1...
[["-", 8, 9, 0, 57, 64, 1, 0, 16, 17, 60], ["+", 8, 9, 0, 57, 64, 1, 0, 11, 17, 32]]
1
536
T = input() s = list(T) for i, x in enumerate(T): if x == "?": s[i] = "D" count = 0 flag = False for x in s: if x == "P": flag = True if x == "D": count += 1 if flag: count += 1 flag = False print(count)
T = input() s = list(T) for i, x in enumerate(T): if x == "?": s[i] = "D" count = 0 flag = False for x in s: if x == "P": flag = True if x == "D": count += 1 if flag: count += 1 flag = False print("".join(s))
[["-", 0, 656, 0, 1, 0, 652, 3, 4, 0, 22], ["+", 3, 4, 0, 652, 63, 319, 500, 557, 0, 654], ["+", 3, 4, 0, 652, 63, 319, 500, 557, 0, 655], ["+", 0, 652, 3, 4, 0, 652, 63, 319, 0, 131], ["+", 0, 652, 3, 4, 0, 652, 63, 319, 319, 22], ["+", 0, 652, 3, 4, 0, 652, 3, 4, 0, 24], ["+", 0, 652, 3, 4, 0, 652, 3, 4, 0, 22], ["+"...
5
80
#include <algorithm> // min, max, swap, sort, reverse, lower_bound, upper_bound #include <bitset> // bitset #include <cctype> // isupper, islower, isdigit, toupper, tolower #include <climits> #include <cstdint> // int64_t, int*_t #include <cstdio> // printf #include <deque> // deque #include <functional> #inc...
#include <algorithm> // min, max, swap, sort, reverse, lower_bound, upper_bound #include <bitset> // bitset #include <cctype> // isupper, islower, isdigit, toupper, tolower #include <climits> #include <cstdint> // int64_t, int*_t #include <cstdio> // printf #include <deque> // deque #include <functional> #inc...
[["-", 0, 9, 0, 57, 64, 1, 0, 16, 17, 60], ["+", 0, 9, 0, 57, 64, 1, 0, 11, 17, 32]]
1
145
#include <bits/stdc++.h> using namespace std; using ll = long long; using ld = long double; using vi = vector<int>; using vll = vector<ll>; using P = pair<int, int>; constexpr int INF = 1e9; constexpr ll INFLL = 1e18; constexpr int MOD = 1e9 + 7; const ld PI = acosl(-1); #define rep(i, n) for (int i = 0; i < (n); ++...
#include <bits/stdc++.h> using namespace std; using ll = long long; using ld = long double; using vi = vector<int>; using vll = vector<ll>; using P = pair<int, int>; constexpr int INF = 1e9; constexpr ll INFLL = 1e18; constexpr int MOD = 1e9 + 7; const ld PI = acosl(-1); #define rep(i, n) for (int i = 0; i < (n); ++...
[["-", 0, 57, 64, 1, 0, 16, 12, 103, 0, 125], ["+", 0, 57, 64, 1, 0, 16, 12, 103, 0, 125]]
1
150
import sys input = sys.stdin.readline # sys.setrecursionlimit(100000) def main(): S = int(input().strip()) return S.replace("?","D") if __name__ == "__main__": print(main())
import sys input = sys.stdin.readline # sys.setrecursionlimit(100000) def main(): S = input().strip() return S.replace("?","D") if __name__ == "__main__": print(main())
[["-", 8, 196, 0, 1, 0, 662, 12, 652, 63, 22], ["-", 0, 1, 0, 662, 12, 652, 3, 4, 0, 24], ["-", 12, 652, 3, 4, 0, 652, 3, 4, 0, 25]]
5
53
T = int(input()) print(T.replace('?', 'D'))
T = input() print(T.replace('?', 'D'))
[["-", 0, 656, 0, 1, 0, 662, 12, 652, 63, 22], ["-", 0, 1, 0, 662, 12, 652, 3, 4, 0, 24], ["-", 12, 652, 3, 4, 0, 652, 3, 4, 0, 25]]
5
23
#include <bits/stdc++.h> using namespace std; #define ll long long #define lvector vector<ll> #define cvector vector<char> #define svector vector<string> #define lque queue<ll> #define lpque priority_queue<ll> #define dlpque priority_queue<ll, lvector, greater<ll>> #define P pair<ll, ll> #define ALL(a) a.begin(), a.end...
#include <bits/stdc++.h> using namespace std; #define ll long long #define lvector vector<ll> #define cvector vector<char> #define svector vector<string> #define lque queue<ll> #define lpque priority_queue<ll> #define dlpque priority_queue<ll, lvector, greater<ll>> #define P pair<ll, ll> #define ALL(a) a.begin(), a.end...
[["+", 0, 14, 8, 9, 0, 43, 49, 50, 49, 22], ["+", 0, 14, 8, 9, 0, 43, 49, 50, 0, 32], ["+", 0, 14, 8, 9, 0, 43, 49, 50, 51, 13], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 0, 21], ["-", 8, 9, 0, 57, 64, 1, 0, 16, 17, 60], ["+", 8, 9, 0, 57, 64, 1, 0, 11, 17, 32]]
1
128