結果

問題 No.387 ハンコ
ユーザー roiti46roiti46
提出日時 2016-10-10 16:52:51
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 924 ms / 5,000 ms
コード長 847 bytes
コンパイル時間 1,465 ms
コンパイル使用メモリ 162,980 KB
実行使用メモリ 7,808 KB
最終ジャッジ日時 2024-05-01 18:54:52
合計ジャッジ時間 10,317 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 924 ms
7,808 KB
testcase_01 AC 923 ms
7,748 KB
testcase_02 AC 743 ms
6,940 KB
testcase_03 AC 741 ms
6,944 KB
testcase_04 AC 292 ms
6,940 KB
testcase_05 AC 574 ms
7,296 KB
testcase_06 AC 774 ms
7,680 KB
testcase_07 AC 738 ms
6,940 KB
testcase_08 AC 746 ms
6,940 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
template<typename T> using Graph = vector<vector<T>>;

#define REP(i, a, b) for (int i = (int)(a); i < (int)(b); i++)
#define rep(i, a) REP(i, 0, a)
#define EACH(i, a) for (auto i: a)
#define ITR(x, a) for (__typeof(a.begin()) x = a.begin(); x != a.end(); x++)
#define ALL(a) (a.begin()), (a.end())
#define HAS(a, x) (a.find(x) != a.end())
#define endl '\n'

int N;
vector<int> a[100010];
bitset<200020> bs;
bitset<200020> ts;

int main(void) {
  cin.tie(0);
  ios::sync_with_stdio(false);

  cin >> N;
  int ai, bi;
  rep(i, N) cin >> ai, a[ai].push_back(i);
  rep(i, N) cin >> bi, bs[i] = bi;

  rep(i, 100010) if (a[i].size()) {
    bitset<200020> t;
    for (auto v: a[i]) t |= bs << v;
    ts ^= t;
  }

  rep(i, 2*N - 1) printf("%s\n", ts[i] ? "ODD":"EVEN");
  return 0;
}
0