# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
15443 |
2015-07-12T07:44:11 Z |
xhae |
로봇 심판의 님 게임 (kriii3_F) |
C++14 |
|
0 ms |
5628 KB |
#include <math.h>
#include <stdio.h>
#include <string.h>
#include <vector>
#include <string>
#include <queue>
#include <map>
#include <algorithm>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <sstream>
#include <set>
using namespace std;
int main()
{
int N, M, K;
cin >> N >> M >> K;
vector<int> P(N), Q(M), cnt(K);
for (int i=0; i<N; i++) cin >> P[i];
for (int i=0; i<M; i++) cin >> Q[i];
for (int i=0; i<K; i++) cin >> cnt[i];
vector<int> S(1000001);
for (int i=0; i<N; i++)
for (int j=P[i]; j<=1000000; j+=P[i])
S[j] --;
for (int i=0; i<M; i++)
for (int j=Q[i]; j<=1000000; j+=Q[i])
if (S[j] >= 0) S[j] ++;
int cc = 0;
for (int i=1; i<=1000000; i++)
if (S[i] > 0) {
cc ++;
S[i] = cc;
} else S[i] = -1;
int xx = 0;
for (int i=0; i<K; i++) if (S[cnt[i]] >= 0) xx ^= S[cnt[i]];
for (int i=0; i<K; i++) {
int target = S[cnt[i]] ^ xx;
if (S[cnt[i]] > 0 && target < S[cnt[i]]) {
for (int j=0; j<=1000000; j++)
if (S[j] == target) {
cout << "1 " << cnt[i] - j << endl;
break;
}
} else cout << "0 0" << endl;
}
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
5628 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Halted |
0 ms |
0 KB |
- |