QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#338460 | #5158. Interview Question | abdelaleem | WA | 0ms | 3584kb | C++14 | 669b | 2024-02-25 22:14:17 | 2024-02-25 22:14:19 |
Judging History
answer
#include <bits/stdc++.h>
#define nl '\n'
#define ll long long
#define loop(n) for(int i = n ; i < n; i++)
using namespace std;
void solve() {
int s, e;
cin >> s >> e;
int a = 0, b = 0;
for (int i = s; i <= e; ++i) {
string ss;
cin >> ss;
if (isdigit(ss[0])) continue;
ss[0] = toupper(ss[0]);
if (ss[0] == 'F')
a = i - a;
if (ss[0] == 'B' || ss.size() == 8)
b = i - b;
}
if (!a) a = e + 1;
if (!b) b = e + 1;
cout << a << ' ' << b;
}
int main() {
ios_base::sync_with_stdio(false);
cin.tie(nullptr);
int t = 1;
// cin >> t;
while (t--) {
solve();
}
return 0;
}
詳細信息
Test #1:
score: 100
Accepted
time: 0ms
memory: 3528kb
input:
7 11 7 8 Fizz Buzz 11
output:
9 10
result:
ok
Test #2:
score: 0
Accepted
time: 0ms
memory: 3584kb
input:
49999 50002 49999 FizzBuzz 50001 Fizz
output:
2 50000
result:
ok
Test #3:
score: -100
Wrong Answer
time: 0ms
memory: 3584kb
input:
8 11 Buzz Buzz FizzBuzz Buzz
output:
10 2
result:
FAIL Mismatch at position 9: expected Buzz, got 9