結果
問題 | No.3041 非対称じゃんけん |
ユーザー |
|
提出日時 | 2025-02-28 22:27:58 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
TLE
|
実行時間 | - |
コード長 | 563 bytes |
コンパイル時間 | 1,846 ms |
コンパイル使用メモリ | 196,500 KB |
実行使用メモリ | 6,824 KB |
最終ジャッジ日時 | 2025-02-28 22:28:22 |
合計ジャッジ時間 | 20,367 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | AC * 25 TLE * 5 |
コンパイルメッセージ
main.cpp: In function ‘int main()’: main.cpp:26:26: warning: format ‘%d’ expects argument of type ‘int’, but argument 2 has type ‘std::size_t’ {aka ‘long unsigned int’} [-Wformat=] 26 | printf("%d\n",dp.count()); | ~^ ~~~~~~~~~~ | | | | int std::size_t {aka long unsigned int} | %ld main.cpp:13:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 13 | scanf("%d%d",&n,&f); | ~~~~~^~~~~~~~~~~~~~ main.cpp:14:32: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 14 | for(i=1;i<=n;i++) scanf("%d",&a[i]); | ~~~~~^~~~~~~~~~~~ main.cpp:15:32: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 15 | for(i=1;i<=n;i++) scanf("%d",&b[i]); | ~~~~~^~~~~~~~~~~~ main.cpp:16:32: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 16 | for(i=1;i<=n;i++) scanf("%d",&c[i]); | ~~~~~^~~~~~~~~~~~
ソースコード
#include <bits/stdc++.h>using namespace std;typedef long long ll;const int INF=0x3f3f3f3f;const ll LLINF=0x3f3f3f3f3f3f3f3fLL;const int mod=998244353;const int MAX=1.5e4+10;const int N=9e5+1;int a[MAX],b[MAX],c[MAX];int main(){int n,f,i;scanf("%d%d",&n,&f);for(i=1;i<=n;i++) scanf("%d",&a[i]);for(i=1;i<=n;i++) scanf("%d",&b[i]);for(i=1;i<=n;i++) scanf("%d",&c[i]);bitset<N> dp,tmp;dp[0]=1;for(i=1;i<=n;i++){tmp=dp;dp.reset();dp|=(tmp<<a[i]);dp|=(tmp<<b[i]);dp|=(tmp<<c[i]);printf("%d\n",dp.count());}return 0;}