結果
| 問題 |
No.1486 ロボット
|
| コンテスト | |
| ユーザー |
merom686
|
| 提出日時 | 2021-04-23 21:25:29 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 7 ms / 2,000 ms |
| コード長 | 438 bytes |
| コンパイル時間 | 2,071 ms |
| コンパイル使用メモリ | 191,656 KB |
| 最終ジャッジ日時 | 2025-01-20 23:32:19 |
|
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 17 |
ソースコード
#include <bits/stdc++.h>
using ll = long long;
using namespace std;
int main() {
int a, b, c, d, e;
cin >> a >> b >> c >> d >> e;
int l = lcm(a + b, c + d);
int s = 0, t = 0;
for (int i = 0; i < l; i++) {
if (i % (a + b) < a && i % (c + d) < c) s++;
}
for (int i = 0; i < e % l; i++) {
if (i % (a + b) < a && i % (c + d) < c) t++;
}
cout << s * (e / l) + t << endl;
return 0;
}
merom686