結果

問題 No.387 ハンコ
ユーザー sugim48sugim48
提出日時 2016-07-01 23:05:23
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 1,089 ms / 5,000 ms
コード長 1,153 bytes
コンパイル時間 724 ms
コンパイル使用メモリ 95,480 KB
実行使用メモリ 7,760 KB
最終ジャッジ日時 2024-04-20 06:04:24
合計ジャッジ時間 11,030 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1,089 ms
7,756 KB
testcase_01 AC 1,063 ms
7,760 KB
testcase_02 AC 1,047 ms
6,940 KB
testcase_03 AC 1,064 ms
6,940 KB
testcase_04 AC 488 ms
6,940 KB
testcase_05 AC 736 ms
7,040 KB
testcase_06 AC 923 ms
7,424 KB
testcase_07 AC 1,037 ms
6,940 KB
testcase_08 AC 1,032 ms
6,944 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:41:29: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   41 |                 int a; scanf("%d", &a);
      |                        ~~~~~^~~~~~~~~~
main.cpp:46:29: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   46 |                 int b; scanf("%d", &b);
      |                        ~~~~~^~~~~~~~~~

ソースコード

diff #

#define _USE_MATH_DEFINES
#include <algorithm>
#include <bitset>
#include <cstdio>
#include <functional>
#include <iostream>
#include <cfloat>
#include <climits>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <time.h>
#include <vector>
#include <random>
using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> i_i;
typedef pair<ll, int> ll_i;
typedef pair<double, int> d_i;
typedef pair<ll, ll> ll_ll;
typedef pair<double, double> d_d;
struct edge { int u, v; ll w; };

int INF = INT_MAX / 10;
ll MOD = 10007;
ll _MOD = 1000000009;
double EPS = 1e-10;

int main() {
	int N; cin >> N;
	vector<vector<int> > v(100000);
	for (int i = 0; i < N; i++) {
		int a; scanf("%d", &a);
		v[a - 1].push_back(i);
	}
	bitset<200000> x;
	for (int i = 0; i < N; i++) {
		int b; scanf("%d", &b);
		if (b) x.set(i);
	}
	bitset<200000> z;
	for (vector<int>& a: v) {
		bitset<200000> y;
		for (int i: a) y |= x << i;
		z ^= y;
	}
	for (int i = 0; i < N * 2 - 1; i++)
		cout << (!z[i] ? "EVEN" : "ODD") << endl;
}
0