結果
問題 |
No.118 門松列(2)
|
ユーザー |
|
提出日時 | 2020-04-12 04:57:27 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 610 bytes |
コンパイル時間 | 1,339 ms |
コンパイル使用メモリ | 71,392 KB |
最終ジャッジ日時 | 2025-01-09 17:37:23 |
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 4 WA * 22 |
ソースコード
#include <iostream> #include <vector> using lint = long long; constexpr int X = 100; void solve() { std::vector<lint> cnt(X, 0); int n; std::cin >> n; while (n--) { int x; std::cin >> x; ++cnt[--x]; } lint ans = 0; for (int k = 0; k < X; ++k) { for (int j = 0; j < k; ++j) { for (int i = 0; i < j; ++i) { ans += cnt[i] * cnt[j] * cnt[k]; } } } std::cout << ans << std::endl; } int main() { std::cin.tie(nullptr); std::ios::sync_with_stdio(false); solve(); return 0; }