結果
| 問題 |
No.3041 非対称じゃんけん
|
| コンテスト | |
| ユーザー |
vjudge1
|
| 提出日時 | 2025-03-02 21:39:23 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 2,129 ms / 2,200 ms |
| コード長 | 642 bytes |
| コンパイル時間 | 2,258 ms |
| コンパイル使用メモリ | 196,668 KB |
| 実行使用メモリ | 8,608 KB |
| 最終ジャッジ日時 | 2025-03-02 21:39:41 |
| 合計ジャッジ時間 | 18,581 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 30 |
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:32:26: warning: format ‘%d’ expects argument of type ‘int’, but argument 2 has type ‘std::size_t’ {aka ‘long unsigned int’} [-Wformat=]
32 | 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:21:32: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
21 | for(i=1;i<=n;i++) scanf("%d",&a[i]);
| ~~~~~^~~~~~~~~~~~
main.cpp:22:32: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
22 | for(i=1;i<=n;i++) scanf("%d",&b[i]);
| ~~~~~^~~~~~~~~~~~
main.cpp:23:32: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
23 | 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);
/* n=1.5e4;
for(i=1;i<=n;i++)
{
a[i]=rand()%60+1;
b[i]=rand()%60+1;
c[i]=rand()%60+1;
}*/
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<<=a[i];
dp|=(tmp<<b[i]);
dp|=(tmp<<c[i]);
printf("%d\n",dp.count());
}
return 0;
}
vjudge1