結果
| 問題 | No.1083 余りの余り |
| コンテスト | |
| ユーザー |
umezo
|
| 提出日時 | 2020-06-19 22:48:24 |
| 言語 | C++17 (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 550 bytes |
| 記録 | |
| コンパイル時間 | 1,764 ms |
| コンパイル使用メモリ | 272,092 KB |
| 実行使用メモリ | 7,968 KB |
| 最終ジャッジ日時 | 2026-06-10 20:48:14 |
| 合計ジャッジ時間 | 10,094 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge2_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 2 TLE * 1 -- * 28 |
ソースコード
#define _GLIBCXX_DEBUG
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define ALL(v) v.begin(), v.end()
typedef long long ll;
#include <bits/stdc++.h>
using namespace std;
const int MOD=1e9+7;
int main() {
cin.tie(0);
ios::sync_with_stdio(false);
int n,k;
cin>>n>>k;
vector<int> A(n);
rep(i,n) cin>>A[i];
vector<int> B(n);
rep(i,n) B[i]=i;
int max=0;
int x;
do{
x=k;
rep(i,n){
x=x%(A[B[i]]);
}
if(x>max) max=x;
}while(next_permutation(ALL(B)));
cout<<max<<endl;
return 0;
}
umezo