結果
| 問題 | No.3562 Communicate Sorted Vector |
| コンテスト | |
| ユーザー |
jastaway
|
| 提出日時 | 2026-05-21 12:04:24 |
| 言語 | C++23 (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 1,051 bytes |
| 記録 | |
| コンパイル時間 | 3,470 ms |
| コンパイル使用メモリ | 338,496 KB |
| 実行使用メモリ | 30,320 KB |
| 平均クエリ数 | 3.00 |
| 最終ジャッジ日時 | 2026-05-29 18:32:15 |
| 合計ジャッジ時間 | 23,706 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge2_0 |
(要ログイン)
| サブタスク | 配点 | 結果 |
|---|---|---|
| 部分点1 | 10 % | AC * 45 |
| 部分点2 | 25 % | AC * 43 WA * 2 |
| 部分点3 | 65 % | AC * 38 WA * 8 |
| 合計 | 10 点 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
string to_str(int num)
{
string ret = "";
while(num)
{
ret.push_back('0' + (num&1));
num >>= 1;
}
reverse(ret.begin(), ret.end());
return ret;
}
int to_num(const string& s)
{
int ret = 0;
for(char c : s)
{
ret <<= 1;
ret += c - '0';
}
return ret;
}
void Alice()
{
int N, Q; cin >> N >> Q;
vector<int> A(N);
for(auto& a : A) cin >> a;
vector<string> S(N);
for(int i = 0; i < N; i++)
{
S[i] = to_str(A[i]);
}
cout << S.size() << endl;
for(auto& s : S) cout << s << endl;
return;
}
void Bob()
{
int N, Q; cin >> N >> Q;
int K; cin >> K;
vector<string> S(K);
for(auto& s : S) cin >> s;
vector<int> A(N);
for(int i = 0; i < N; i++) A[i] = to_num(S[i]);
for(int i = 0; i < N; i++) cout << A[i] << (i < N-1 ? " " : "\n");
cout << flush;
return;
}
int main()
{
string player; cin >> player;
if(player == "Alice") Alice();
else Bob();
}
jastaway