QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#191615 | #5259. Skills in Pills | timreizin | WA | 0ms | 3392kb | C++20 | 798b | 2023-09-30 03:08:37 | 2023-09-30 03:08:38 |
Judging History
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'