結果
問題 | No.1679 マスゲーム |
ユーザー | aspi |
提出日時 | 2021-09-10 21:46:31 |
言語 | C++17 (gcc 12.3.0 + boost 1.83.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 467 bytes |
コンパイル時間 | 2,609 ms |
コンパイル使用メモリ | 209,008 KB |
実行使用メモリ | 8,356 KB |
最終ジャッジ日時 | 2023-09-05 05:31:38 |
合計ジャッジ時間 | 7,277 ms |
ジャッジサーバーID (参考情報) |
judge11 / judge14 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 1 ms
4,380 KB |
testcase_01 | AC | 1 ms
4,376 KB |
testcase_02 | AC | 1 ms
4,384 KB |
testcase_03 | WA | - |
testcase_04 | WA | - |
testcase_05 | WA | - |
testcase_06 | WA | - |
testcase_07 | WA | - |
testcase_08 | WA | - |
testcase_09 | WA | - |
testcase_10 | WA | - |
testcase_11 | WA | - |
testcase_12 | WA | - |
testcase_13 | WA | - |
testcase_14 | WA | - |
testcase_15 | WA | - |
testcase_16 | WA | - |
testcase_17 | AC | 2 ms
4,376 KB |
testcase_18 | WA | - |
testcase_19 | WA | - |
testcase_20 | AC | 2 ms
4,380 KB |
testcase_21 | WA | - |
testcase_22 | AC | 3 ms
4,376 KB |
testcase_23 | AC | 2 ms
4,384 KB |
testcase_24 | WA | - |
testcase_25 | WA | - |
testcase_26 | WA | - |
testcase_27 | WA | - |
ソースコード
#include<bits/stdc++.h> using namespace std; int main() { long long N, A, B, T, ans = 0; map<int, int>ma; vector<int>Xpoints; cin >> N; for (int i = 0; i < N; i++) { cin >> A >> B >> T; if (A == 0) { if (ma.count(B - T))ma[B + T]++; else ma[B - T] = 1; } else Xpoints.push_back(B - T); } for (int t : Xpoints) { if (ma.count(t))ans += ma[t]; } cout << ans << endl; }