結果

問題 No.3041 非対称じゃんけん
ユーザー tokitsukaze
提出日時 2025-02-28 22:20:24
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 606 bytes
コンパイル時間 1,994 ms
コンパイル使用メモリ 196,672 KB
実行使用メモリ 6,824 KB
最終ジャッジ日時 2025-02-28 22:20:59
合計ジャッジ時間 18,938 ms
ジャッジサーバーID
(参考情報)
judge5 / judge6
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 6 WA * 21 TLE * 3
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:21:18: warning: format ‘%d’ expects argument of type ‘int’, but argument 2 has type ‘std::size_t’ {aka ‘long unsigned int’} [-Wformat=]
   21 |         printf("%d\n",dp.count());
      |                 ~^    ~~~~~~~~~~
      |                  |            |
      |                  int          std::size_t {aka long unsigned int}
      |                 %ld
main.cpp:28:26: warning: format ‘%d’ expects argument of type ‘int’, but argument 2 has type ‘std::size_t’ {aka ‘long unsigned int’} [-Wformat=]
   28 |                 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]);
      |                           ~~~~~^~~~~~~~~~~~

ソースコード

diff #
プレゼンテーションモードにする

#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[a[1]]=1;
dp[b[1]]=1;
dp[c[1]]=1;
printf("%d\n",dp.count());
for(i=2;i<=n;i++)
{
tmp=dp;
dp|=(tmp<<a[i]);
dp|=(tmp<<b[i]);
dp|=(tmp<<c[i]);
printf("%d\n",dp.count());
}
return 0;
}
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
0