結果
問題 |
No.3041 非対称じゃんけん
|
ユーザー |
|
提出日時 | 2025-02-28 22:23:33 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 608 bytes |
コンパイル時間 | 2,124 ms |
コンパイル使用メモリ | 195,776 KB |
実行使用メモリ | 8,232 KB |
最終ジャッジ日時 | 2025-02-28 22:23:53 |
合計ジャッジ時間 | 19,279 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | AC * 6 WA * 21 TLE * 3 |
コンパイルメッセージ
main.cpp: In function ‘int main()’: main.cpp:27:26: warning: format ‘%d’ expects argument of type ‘int’, but argument 2 has type ‘std::size_t’ {aka ‘long unsigned int’} [-Wformat=] 27 | printf("%d\n",dp.count()-tag); | ~^ ~~~~~~~~~~~~~~ | | | | 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,tag; 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; tag=1; for(i=1;i<=n;i++) { tmp=dp; dp|=(tmp<<a[i]); dp|=(tmp<<b[i]); dp|=(tmp<<c[i]); if(a[i]==0 || b[i]==0 || c[i]==0) tag=0; printf("%d\n",dp.count()-tag); } return 0; }