QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#191615#5259. Skills in PillstimreizinWA 0ms3392kbC++20798b2023-09-30 03:08:372023-09-30 03:08:38

Judging History

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

  • [2023-09-30 03:08:38]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3392kb
  • [2023-09-30 03:08:37]
  • 提交

answer

#include <vector>
#include <queue>
#include <list>
#include <iostream>
#include <array>
#include <string>
#include <numeric>
#include <algorithm>
#include <cmath>

using namespace std;

using ll = long long;

int main()
{
    int k, j, n;
    cin >> k >> j >> n;
    if (j > k)
        swap(j, k);
    int res = 0;
    int cnt1 = 0, cnt2 = 0;
    for (int i = 0; i < n; ++i)
    {
        ++cnt1;
        ++cnt2;
        if (cnt1 == j && cnt2 == k)
        {
            res += 2;
            cnt1 = 1;
            cnt2 = 0;
        }
        if (cnt1 == j)
        {
            ++res;
            cnt1 = 0;
        }
        if (cnt2 == k)
        {
            ++res;
            cnt2 = 0;
        }
    }
    cout << res << '\n';
    return 0;
}


詳細信息

Test #1:

score: 0
Wrong Answer
time: 0ms
memory: 3392kb

input:

3 9 20

output:

9

result:

wrong answer 1st lines differ - expected: '8', found: '9'