結果
| 問題 |
No.1935 Water Simulation
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2022-05-27 20:43:37 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 411 bytes |
| コンパイル時間 | 1,971 ms |
| コンパイル使用メモリ | 193,996 KB |
| 最終ジャッジ日時 | 2025-01-29 15:41:31 |
|
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 7 WA * 22 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
int main()
{
vector<int> c(4);
for (int &x : c)
cin >> x;
int n; cin >> n;
vector<int> a(4); a[0] = c[0];
if (n >= 396)
n = n % 4 + 396;
for (int i = 0; i < n; i ++)
{
int j = (i + 1) % 4;
int x = min(a[i % 4], c[j] - a[j]);
a[j] += x;
a[i % 4] -= x;
}
for (int x : a)
cout << x << ' ';
cout << '\n';
return 0;
}