結果
| 問題 |
No.1083 余りの余り
|
| コンテスト | |
| ユーザー |
IKyopro
|
| 提出日時 | 2020-06-19 21:30:23 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 521 bytes |
| コンパイル時間 | 2,759 ms |
| コンパイル使用メモリ | 193,200 KB |
| 最終ジャッジ日時 | 2025-01-11 05:47:49 |
|
ジャッジサーバーID (参考情報) |
judge2 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 27 WA * 4 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
template <class T> using vec = vector<T>;
template <class T> using vvec = vector<vec<T>>;
int main(){
cin.tie(0);
ios::sync_with_stdio(false);
int N,K;
cin >> N >> K;
vec<int> A(N);
for(auto& x:A) cin >> x;
vec<int> dp(1<<N);
dp[0] = K;
for(int S=0;S<(1<<N);S++){
for(int i=0;i<N;i++) if(!(S>>i&1)){
dp[S^(1<<i)] = max(dp[S^(1<<i)],dp[S]%A[i]);
}
}
cout << dp[(1<<N)-1] << "\n";
}
IKyopro