結果
| 問題 | No.3711 Udon, Tempura |
| コンテスト | |
| ユーザー |
tnakao0123
|
| 提出日時 | 2026-09-13 15:58:41 |
| 言語 | C++17 (gcc 15.3.0 + boost 1.92.0 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 2 ms / 2,000 ms |
| + 441µs | |
| コード長 | 783 bytes |
| 記録 | |
| コンパイル時間 | 315 ms |
| コンパイル使用メモリ | 77,696 KB |
| 実行使用メモリ | 6,400 KB |
| 最終ジャッジ日時 | 2026-09-13 15:58:46 |
| 合計ジャッジ時間 | 2,486 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 34 |
ソースコード
/* -*- coding: utf-8 -*-
*
* 3711.cc: No.3711 Udon, Tempura - yukicoder
*/
#include<cstdio>
#include<bitset>
#include<algorithm>
using namespace std;
/* constant */
const int MAX_N = 100;
const int MAX_M = 100;
const int MAX_U = 100000;
const int MAX_T = 1000;
const int MAX_S = MAX_U + MAX_M * MAX_T;
/* typedef */
using btst = bitset<MAX_S + 1>;
/* global variables */
int us[MAX_N], ts[MAX_M];
/* subroutines */
/* main */
int main() {
int n, m;
scanf("%d%d", &n, &m);
for (int i = 0; i < n; i++) scanf("%d", us + i);
for (int i = 0; i < m; i++) scanf("%d", ts + i);
btst dp;
dp[0] = 1;
for (int i = 0; i < m; i++) dp |= (dp << ts[i]);
btst b;
for (int i = 0; i < n; i++) b |= (dp << us[i]);
printf("%d\n", (int)b.count());
return 0;
}
tnakao0123