結果
| 問題 | No.1486 ロボット |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2024-03-22 10:37:21 |
| 言語 | C++17 (gcc 15.2.0 + boost 1.90.0) |
| 結果 |
AC
|
| 実行時間 | 5 ms / 2,000 ms |
| コード長 | 586 bytes |
| 記録 | |
| コンパイル時間 | 2,914 ms |
| コンパイル使用メモリ | 273,172 KB |
| 実行使用メモリ | 6,528 KB |
| 最終ジャッジ日時 | 2026-07-04 04:55:49 |
| 合計ジャッジ時間 | 4,093 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 17 |
ソースコード
#include <bits/stdc++.h>
#include <atcoder/all>
using namespace std;
using namespace atcoder;
using ll = long long;
using ld = long double;
int calc(int a, int b, int c, int d, int e) {
int cnt = 0;
for (int i = 0; i < e; i++) {
if (i % (a + b) < a && i % (c + d) < c) cnt++;
}
return cnt;
}
int main() {
int a, b, c, d, e;
cin >> a >> b >> c >> d >> e;
int lim = (a + b) * (c + d);
int ans = 0;
if (e > lim) {
int ans0 = calc(a, b, c, d, lim);
ans += ans0 * (e / lim);
e %= lim;
}
ans += calc(a, b, c, d, e);
cout << ans << endl;
return 0;
}