結果
問題 |
No.2517 Right Triangles on Circle
|
ユーザー |
|
提出日時 | 2023-10-27 21:32:40 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 330 ms / 2,000 ms |
コード長 | 444 bytes |
コンパイル時間 | 1,717 ms |
コンパイル使用メモリ | 176,952 KB |
実行使用メモリ | 31,616 KB |
最終ジャッジ日時 | 2024-09-25 13:36:42 |
合計ジャッジ時間 | 6,472 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 29 |
コンパイルメッセージ
main.cpp: In function 'int main()': main.cpp:17:13: warning: structured bindings only available with '-std=c++17' or '-std=gnu++17' [-Wc++17-extensions] 17 | for(auto[a,c] : A){ | ^
ソースコード
#include <bits/stdc++.h> using namespace std; int main(){ ios_base::sync_with_stdio(false); cin.tie(nullptr); int N,M; cin >> N >> M; map<int,int> A; for(int i=0; i<N; i++){ int a; cin >> a; A[a] = 1; } if(M%2){cout << 0 << endl; return 0;} long long answer = 0; for(auto[a,c] : A){ if(c == 0) continue; if(A[a+M/2] == 1) answer += N-2; } cout << answer << endl; }