結果

問題 No.387 ハンコ
ユーザー umezoumezo
提出日時 2024-04-10 23:56:26
言語 C++23
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 903 ms / 5,000 ms
コード長 751 bytes
コンパイル時間 3,377 ms
コンパイル使用メモリ 285,292 KB
実行使用メモリ 11,136 KB
最終ジャッジ日時 2024-04-10 23:56:39
合計ジャッジ時間 11,637 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 855 ms
10,880 KB
testcase_01 AC 903 ms
11,136 KB
testcase_02 AC 628 ms
6,940 KB
testcase_03 AC 638 ms
6,944 KB
testcase_04 AC 276 ms
6,940 KB
testcase_05 AC 534 ms
8,704 KB
testcase_06 AC 741 ms
10,240 KB
testcase_07 AC 636 ms
6,940 KB
testcase_08 AC 652 ms
6,940 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
using namespace std;

#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define ALL(v) v.begin(),v.end()
typedef long long ll;
template <class T> using V=vector<T>;
template <class T> using VV=V<V<T>>; //B(n,V<int>(n))
 
int main(){
  ios::sync_with_stdio(false);
  std::cin.tie(nullptr);
  
  int n;
  cin>>n;
  V<int> A(n),B(n);
  rep(i,n) cin>>A[i];
  rep(i,n) cin>>B[i];
  bitset<200000> b,res;
  rep(i,n) if(B[i]) b.set(i);
  map<int,V<int>> m;
  rep(i,n) m[A[i]].push_back(i);
  for(auto [a,C]:m){
    int c=C.size();
    bitset<200000> tmp,d;
    rep(i,c){
      d=(b<<C[i]);
      tmp|=d;
    }
    res^=tmp;
  }
  int ans=0;
  rep(i,2*n-1){
    if(res.test(i)) cout<<"ODD\n";
    else cout<<"EVEN\n";
  }
    
  return 0;
}
0