結果

問題 No.1972 Modulo Set
ユーザー keisuke6keisuke6
提出日時 2022-06-10 21:43:20
言語 C++23
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 397 bytes
コンパイル時間 3,709 ms
コンパイル使用メモリ 264,192 KB
実行使用メモリ 11,108 KB
最終ジャッジ日時 2023-10-21 05:00:28
合計ジャッジ時間 6,556 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,348 KB
testcase_01 AC 1 ms
4,348 KB
testcase_02 AC 2 ms
4,348 KB
testcase_03 AC 9 ms
4,348 KB
testcase_04 AC 15 ms
4,348 KB
testcase_05 WA -
testcase_06 AC 26 ms
4,348 KB
testcase_07 WA -
testcase_08 WA -
testcase_09 AC 3 ms
4,348 KB
testcase_10 WA -
testcase_11 AC 39 ms
4,348 KB
testcase_12 AC 7 ms
4,348 KB
testcase_13 AC 5 ms
4,348 KB
testcase_14 AC 4 ms
4,348 KB
testcase_15 AC 37 ms
4,348 KB
testcase_16 AC 37 ms
4,348 KB
testcase_17 AC 14 ms
4,348 KB
testcase_18 AC 2 ms
4,348 KB
testcase_19 AC 29 ms
4,348 KB
testcase_20 AC 36 ms
4,348 KB
testcase_21 AC 19 ms
4,348 KB
testcase_22 AC 25 ms
4,348 KB
testcase_23 AC 49 ms
8,316 KB
testcase_24 AC 21 ms
8,316 KB
testcase_25 AC 31 ms
9,304 KB
testcase_26 WA -
testcase_27 AC 52 ms
10,360 KB
testcase_28 RE -
testcase_29 RE -
testcase_30 RE -
testcase_31 RE -
testcase_32 RE -
testcase_33 AC 66 ms
11,108 KB
testcase_34 AC 59 ms
11,108 KB
testcase_35 AC 56 ms
11,108 KB
testcase_36 AC 57 ms
11,108 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#pragma GCC target("avx2")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
#include <bits/stdc++.h>
using namespace std;
#define int long long
signed main(){
  int N,M;
  cin>>N>>M;
  vector<int> S(M);
  for(int i=0;i<N;i++){
      int a;
      cin>>a;
      S[a%M]++;
  }
  int ans = (S[0] != 0);
  for(int i=1;M-i>=i;i++){
      ans += max(S[i],S[M-i]);
  }
  cout<<ans<<endl;
}
0