QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#96293 | #5158. Interview Question | Ahmed_Abdelmegeed# | WA | 2ms | 3444kb | C++20 | 528b | 2023-04-13 18:52:40 | 2023-04-13 18:52:44 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
int main() {
int l,r;
cin >> l >> r;
cin.ignore();
string s;
getline(cin, s);
stringstream ss(s);
string cur;
int a = 0, b = 0;
while(ss >> cur)
{
if(cur == "Fizz")
a = __gcd(a, l);
if(cur == "Buzz")
b = __gcd(b, l);
if(cur == "FizzBuzz")
{
a = __gcd(a,l);
b = __gcd(b, l);
}
++l;
}
cout << a << " " << b;
}
详细
Test #1:
score: 100
Accepted
time: 0ms
memory: 3444kb
input:
7 11 7 8 Fizz Buzz 11
output:
9 10
result:
ok
Test #2:
score: 0
Accepted
time: 2ms
memory: 3364kb
input:
49999 50002 49999 FizzBuzz 50001 Fizz
output:
2 50000
result:
ok
Test #3:
score: 0
Accepted
time: 1ms
memory: 3412kb
input:
8 11 Buzz Buzz FizzBuzz Buzz
output:
10 1
result:
ok
Test #4:
score: -100
Wrong Answer
time: 1ms
memory: 3432kb
input:
10 15 10 11 12 13 14 15
output:
0 0
result:
wrong answer Integer parameter [name=a] equals to 0, violates the range [1, 1000000]