結果
問題 |
No.1338 Giant Class
|
ユーザー |
![]() |
提出日時 | 2021-01-15 22:09:42 |
言語 | C++17(clang) (17.0.6 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 548 bytes |
コンパイル時間 | 5,589 ms |
コンパイル使用メモリ | 126,976 KB |
実行使用メモリ | 8,076 KB |
最終ジャッジ日時 | 2024-11-26 15:07:55 |
合計ジャッジ時間 | 4,334 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | WA * 2 |
other | WA * 21 |
ソースコード
#include <iostream> #include <unordered_map> int main() { int64_t height, width, nq; std::cin >> height >> width >> nq; std::unordered_map<size_t, int64_t> map; size_t now = width * height; int64_t h, w; for (size_t i = 0; i < nq; i++) { std::cin >> h >> w; auto f = map.find(w); if (f != map.end()) { auto &pair = *f; if (pair.second > h) { now -= pair.second - h; pair.second = h; } } else { now -= height - h; map[w] = h; } std::cout << now << std::endl; } }