結果
| 問題 |
No.2561 みんな大好きmod 998
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2023-12-02 15:52:11 |
| 言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 571 bytes |
| コンパイル時間 | 1,004 ms |
| コンパイル使用メモリ | 92,260 KB |
| 実行使用メモリ | 10,752 KB |
| 最終ジャッジ日時 | 2024-09-26 19:25:31 |
| 合計ジャッジ時間 | 6,869 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | TLE * 1 -- * 43 |
ソースコード
#include <iostream>
#include <vector>
#include <numeric>
int main() {
int n, k, cnt = 0;
std::cin >> n >> k;
std::vector<int> a(n);
for(auto &el: a) {
std::cin >> el;
}
for(int i = 0; i < 1 << n; ++i) {
std::vector<long long> x;
for(int j = 0; j < n; ++j) {
if(i >> j & 1) {
x.emplace_back(a[j]);
}
}
if(std::ssize(x) == k) {
const long long sum = std::accumulate(x.begin(), x.end(), 0LL);
if(sum % 998 >= sum % 998244353) {
cnt++;
cnt %= 998;
}
}
}
std::cout << cnt << '\n';
}