結果
| 問題 | No.521 Cheeses and a Mousetrap(チーズとネズミ捕り) |
| コンテスト | |
| ユーザー |
masakt
|
| 提出日時 | 2017-06-02 22:32:48 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 1,079 bytes |
| コンパイル時間 | 619 ms |
| コンパイル使用メモリ | 71,752 KB |
| 実行使用メモリ | 6,948 KB |
| 最終ジャッジ日時 | 2024-09-21 22:31:11 |
| 合計ジャッジ時間 | 1,446 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 16 WA * 12 |
ソースコード
#include <algorithm>
#include <iomanip>
#include <istream>
#include <map>
#include <numeric>
#include <ostream>
#include <set>
#include <sstream>
#include <string>
#include <utility>
#include <vector>
using namespace std;
// Powered by caide (code generator, tester, and library code inliner)
class Solution {
public:
void solve(std::istream& in, std::ostream& out) {
int n, k;
int ans = 0;
in >> n >> k;
if (k == 0 || k > n)
{
ans = 0;
}
else
{
int tmp = k
;
ans = n;
while (ans >= tmp)
{
ans--;
tmp += k;
}
}
out << ans;
}
};
void solve(std::istream& in, std::ostream& out)
{
out << std::setprecision(12);
Solution solution;
solution.solve(in, out);
}
#include <fstream>
#include <iostream>
int main() {
ios_base::sync_with_stdio(0);
cin.tie(0);
istream& in = cin;
ostream& out = cout;
solve(in, out);
return 0;
}
masakt