結果
問題 |
No.1470 Mex Sum
|
ユーザー |
![]() |
提出日時 | 2021-04-04 11:11:09 |
言語 | C++17(gcc12) (gcc 12.3.0 + boost 1.87.0) |
結果 |
CE
(最新)
AC
(最初)
|
実行時間 | - |
コード長 | 529 bytes |
コンパイル時間 | 658 ms |
コンパイル使用メモリ | 62,224 KB |
最終ジャッジ日時 | 2025-01-20 11:04:43 |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
コンパイルエラー時のメッセージ・ソースコードは、提出者また管理者しか表示できないようにしております。(リジャッジ後のコンパイルエラーは公開されます)
ただし、clay言語の場合は開発者のデバッグのため、公開されます。
ただし、clay言語の場合は開発者のデバッグのため、公開されます。
コンパイルメッセージ
main.cpp:3:10: fatal error: testlib.h: No such file or directory 3 | #include "testlib.h" | ^~~~~~~~~~~ compilation terminated.
ソースコード
#include <bits/stdc++.h> using namespace std; #include "testlib.h" long long x, y, z; int main() { registerValidation(); int n; n = inf.readInt(2, 200000); inf.readEoln(); vector a(n, 0); for(int i = 0; i < n; i++) { if(i) inf.readSpace(); a[i] = inf.readInt(1, 1000000000); } inf.readEoln(); inf.readEof(); x = count(a.begin(), a.end(), 1); y = count(a.begin(), a.end(), 2); z = n - x - y; cout << x * y * 3 + (x * (x - 1) / 2 + x * z) * 2 + (z * y + z * (z - 1) / 2 + y * (y - 1) / 2) << endl; return 0; }