結果

問題 No.3041 非対称じゃんけん
ユーザー Carpenters-Cat
提出日時 2025-02-28 22:14:17
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
TLE  
実行時間 -
コード長 483 bytes
コンパイル時間 3,622 ms
コンパイル使用メモリ 252,152 KB
実行使用メモリ 6,824 KB
最終ジャッジ日時 2025-02-28 22:14:41
合計ジャッジ時間 20,245 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 28 TLE * 2
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:17:26: warning: format ‘%d’ expects argument of type ‘int’, but argument 2 has type ‘std::size_t’ {aka ‘long unsigned int’} [-Wformat=]
   17 |                 printf("%d\n", ans.count());
      |                         ~^     ~~~~~~~~~~~
      |                          |              |
      |                          int            std::size_t {aka long unsigned int}
      |                         %ld
main.cpp:8:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
    8 |         scanf(" %d %d", &N, &F);
      |         ~~~~~^~~~~~~~~~~~~~~~~~
main.cpp:10:31: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   10 |         for (int& a : A) scanf(" %d", &a);
      |                          ~~~~~^~~~~~~~~~~
main.cpp:11:31: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   11 |         for (int& b : B) scanf(" %d", &b);
      |                          ~~~~~^~~~~~~~~~~
main.cpp:12:31: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   12 |         for (int& c : C) scanf(" %d", &c);
      |                          ~~~~~^~~~~~~~~~~

ソースコード

diff #

#include <bits/stdc++.h>
#include <atcoder/all>
using namespace std;
using namespace atcoder;
using ll = long long;
int main () {
	int N, F;
	scanf(" %d %d", &N, &F);
	std::vector<int> A(N), B(N), C(N);
	for (int& a : A) scanf(" %d", &a);
	for (int& b : B) scanf(" %d", &b);
	for (int& c : C) scanf(" %d", &c);
	bitset<900001> ans;
	ans[0] = 1;
	for (int i = 0; i < N; i ++) {
		ans = (ans << A[i]) | (ans << B[i]) | (ans << C[i]);
		printf("%d\n", ans.count());
	}
	cout << flush;
}
0