結果
| 問題 |
No.1083 余りの余り
|
| コンテスト | |
| ユーザー |
SSRS
|
| 提出日時 | 2020-06-19 23:27:46 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 482 bytes |
| コンパイル時間 | 1,572 ms |
| コンパイル使用メモリ | 172,444 KB |
| 実行使用メモリ | 6,948 KB |
| 最終ジャッジ日時 | 2024-07-03 15:50:44 |
| 合計ジャッジ時間 | 2,673 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 29 WA * 2 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
int main(){
ios::sync_with_stdio(false);
cin.tie(nullptr);
random_device rnd;
mt19937 mt(rnd());
int N, K;
cin >> N >> K;
vector<int> A(N);
for (int i = 0; i < N; i++){
cin >> A[i];
}
int ans = 0;
for (int i = 0; i < 100; i++){
vector<int> B = A;
shuffle(B.begin(), B.end(), mt);
int X = K;
for (int j = 0; j < N; j++){
X %= B[j];
}
ans = max(ans, X);
}
cout << ans << "\n";
}
SSRS