結果
| 問題 | No.1486 ロボット |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2021-04-23 22:14:10 |
| 言語 | C++17 (gcc 15.2.0 + boost 1.90.0) |
| 結果 |
AC
|
| 実行時間 | 5 ms / 2,000 ms |
| コード長 | 505 bytes |
| 記録 | |
| コンパイル時間 | 561 ms |
| コンパイル使用メモリ | 79,592 KB |
| 実行使用メモリ | 6,400 KB |
| 最終ジャッジ日時 | 2026-06-19 22:53:59 |
| 合計ジャッジ時間 | 1,591 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 17 |
ソースコード
#include <iostream>
using namespace std;
void solve() {
int a, b, c, d, e;
cin >> a >> b >> c >> d >> e;
auto count = [&](int t) {
int ret = 0;
for (int i = 0; i < t; ++i) {
if (i % (a + b) < a &&
i % (c + d) < c) ++ret;
}
return ret;
};
auto t = (a + b) * (c + d);
cout << e / t * count(t) + count(e % t) << "\n";
}
int main() {
cin.tie(nullptr);
ios::sync_with_stdio(false);
solve();
return 0;
}