結果

問題 No.1083 余りの余り
ユーザー chocoruskchocorusk
提出日時 2020-06-19 21:59:48
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
MLE  
実行時間 -
コード長 946 bytes
コンパイル時間 1,886 ms
コンパイル使用メモリ 133,180 KB
実行使用メモリ 724,704 KB
最終ジャッジ日時 2023-09-16 14:13:35
合計ジャッジ時間 12,701 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 19 ms
52,560 KB
testcase_01 AC 20 ms
52,484 KB
testcase_02 AC 20 ms
52,524 KB
testcase_03 AC 19 ms
52,428 KB
testcase_04 AC 21 ms
52,964 KB
testcase_05 AC 1,099 ms
187,588 KB
testcase_06 AC 20 ms
52,536 KB
testcase_07 AC 20 ms
52,472 KB
testcase_08 AC 20 ms
52,480 KB
testcase_09 AC 19 ms
52,440 KB
testcase_10 AC 20 ms
52,476 KB
testcase_11 AC 20 ms
52,608 KB
testcase_12 AC 19 ms
52,484 KB
testcase_13 AC 20 ms
52,440 KB
testcase_14 AC 19 ms
52,396 KB
testcase_15 AC 20 ms
52,504 KB
testcase_16 AC 19 ms
52,440 KB
testcase_17 AC 19 ms
52,412 KB
testcase_18 AC 1,106 ms
210,900 KB
testcase_19 AC 232 ms
91,040 KB
testcase_20 AC 24 ms
53,364 KB
testcase_21 AC 28 ms
54,180 KB
testcase_22 AC 19 ms
52,424 KB
testcase_23 AC 2,690 ms
397,480 KB
testcase_24 MLE -
testcase_25 -- -
testcase_26 -- -
testcase_27 -- -
testcase_28 -- -
testcase_29 -- -
testcase_30 -- -
testcase_31 -- -
testcase_32 -- -
testcase_33 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <cstdio>
#include <cstring>
#include <iostream>
#include <string>
#include <cmath>
#include <bitset>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <algorithm>
#include <complex>
#include <unordered_map>
#include <unordered_set>
#include <random>
#include <cassert>
#include <fstream>
#include <utility>
#include <functional>
#include <time.h>
#include <stack>
#include <array>
#include <list>
#define popcount __builtin_popcount
using namespace std;
typedef long long int ll;
typedef pair<int, int> P;
int n, k;
int a[22];
set<int> st[1<<20];
int main()
{
    cin>>n>>k;
    for(int i=0; i<n; i++) cin>>a[i];
  st[0].insert(k);
    for(int i=0; i<(1<<n)-1; i++){
        for(int j=0; j<n; j++){
            if(i&(1<<j)) continue;
            for(auto x:st[i]){
                st[i^(1<<j)].insert(x%a[j]);
            }
        }
    }
    cout<<*st[(1<<n)-1].rbegin()<<endl;
    return 0;
}
0