QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#96293#5158. Interview QuestionAhmed_Abdelmegeed#WA 2ms3444kbC++20528b2023-04-13 18:52:402023-04-13 18:52:44

Judging History

你现在查看的是最新测评结果

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2023-04-13 18:52:44]
  • 评测
  • 测评结果:WA
  • 用时:2ms
  • 内存:3444kb
  • [2023-04-13 18:52:40]
  • 提交

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]