提出 #66943480
ソースコード 拡げる
#include <bits/stdc++.h>
using namespace std;
const int M = 998244353;
long long exp(long long a, long long e = M - 2) {
long long r = 1;
while (e) {
if (e & 1) r = r * a % M;
a = a * a % M;
e >>= 1;
}
return r;
}
void gen(vector<vector<int>>& d, vector<vector<int>>& s, int i, vector<int>& c) {
if (i == d.size()) {
s.push_back(c);
return;
}
for (int x : d[i]) {
c.push_back(x);
gen(d, s, i + 1, c);
c.pop_back();
}
}
long long calc(vector<int>& sub) {
priority_queue<int> h;
for (int x : sub) h.push(x);
return h.top();
}
int main() {
int n;
cin >> n;
vector<vector<int>> d(n, vector<int>(6));
for (int i = 0; i < n; i++) {
for (int j = 0; j < 6; j++) {
cin >> d[i][j];
}
}
vector<vector<int>> s;
vector<int> c;
gen(d, s, 0, c);
long long r = 0, t = exp(exp(6, n));
for (auto& sub : s) {
long long p = calc(sub);
r = (r + p * t % M) % M;
}
cout << r << "\n";
return 0;
}
提出情報
| 提出日時 | |
|---|---|
| 問題 | E - E [max] |
| ユーザ | Naman____17 |
| 言語 | C++ 17 (Clang 16.0.6) |
| 得点 | 0 |
| コード長 | 1133 Byte |
| 結果 | RE |
| 実行時間 | 3526 ms |
| メモリ | 3622920 KiB |
コンパイルエラー
./Main.cpp:16:11: warning: comparison of integers of different signs: 'int' and 'size_type' (aka 'unsigned long') [-Wsign-compare]
if (i == d.size()) {
~ ^ ~~~~~~~~
1 warning generated.
ジャッジ結果
| セット名 | Sample | All | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
| 得点 / 配点 | 0 / 0 | 0 / 450 | ||||||||
| 結果 |
|
|
| セット名 | テストケース |
|---|---|
| Sample | 00_sample_00.txt, 00_sample_01.txt, 00_sample_02.txt |
| All | 00_sample_00.txt, 00_sample_01.txt, 00_sample_02.txt, 01_random_00.txt, 01_random_01.txt, 01_random_02.txt, 01_random_03.txt, 01_random_04.txt, 01_random_05.txt, 01_random_06.txt, 01_random_07.txt, 01_random_08.txt, 01_random_09.txt, 02_random2_00.txt, 02_random2_01.txt, 02_random2_02.txt, 02_random2_03.txt, 02_random2_04.txt, 02_random2_05.txt, 02_random2_06.txt, 03_handmade_00.txt, 03_handmade_01.txt, 03_handmade_02.txt, 03_handmade_03.txt, 03_handmade_04.txt, 03_handmade_05.txt |
| ケース名 | 結果 | 実行時間 | メモリ |
|---|---|---|---|
| 00_sample_00.txt | AC | 1 ms | 3468 KiB |
| 00_sample_01.txt | AC | 1 ms | 3444 KiB |
| 00_sample_02.txt | AC | 251 ms | 121388 KiB |
| 01_random_00.txt | RE | 2416 ms | 3618792 KiB |
| 01_random_01.txt | RE | 2015 ms | 3619060 KiB |
| 01_random_02.txt | RE | 1807 ms | 3619732 KiB |
| 01_random_03.txt | RE | 1605 ms | 3619164 KiB |
| 01_random_04.txt | TLE | 3526 ms | 3612248 KiB |
| 01_random_05.txt | RE | 1778 ms | 3619288 KiB |
| 01_random_06.txt | RE | 1953 ms | 3619248 KiB |
| 01_random_07.txt | RE | 1951 ms | 3619764 KiB |
| 01_random_08.txt | RE | 1829 ms | 3619048 KiB |
| 01_random_09.txt | RE | 1829 ms | 3619644 KiB |
| 02_random2_00.txt | RE | 1955 ms | 3622372 KiB |
| 02_random2_01.txt | RE | 1647 ms | 3622692 KiB |
| 02_random2_02.txt | RE | 2272 ms | 3622604 KiB |
| 02_random2_03.txt | RE | 1808 ms | 3622920 KiB |
| 02_random2_04.txt | RE | 1792 ms | 3622528 KiB |
| 02_random2_05.txt | RE | 1655 ms | 3622584 KiB |
| 02_random2_06.txt | RE | 1647 ms | 3622184 KiB |
| 03_handmade_00.txt | AC | 36 ms | 5704 KiB |
| 03_handmade_01.txt | AC | 1 ms | 3424 KiB |
| 03_handmade_02.txt | AC | 1 ms | 3500 KiB |
| 03_handmade_03.txt | RE | 1511 ms | 3622140 KiB |
| 03_handmade_04.txt | RE | 1561 ms | 3622624 KiB |
| 03_handmade_05.txt | RE | 1728 ms | 3621916 KiB |