結果

問題 No.2307 [Cherry 5 th Tune *] Cool 46
ユーザー random contestant
提出日時 2023-05-19 22:02:41
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 1,718 bytes
コンパイル時間 4,405 ms
コンパイル使用メモリ 259,796 KB
最終ジャッジ日時 2025-02-13 01:57:12
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 8 WA * 38
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: In lambda function:
main.cpp:59:5: warning: control reaches end of non-void function [-Wreturn-type]
   59 |     };
      |     ^

ソースコード

diff #
プレゼンテーションモードにする

// #define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
#include <atcoder/all>
using namespace atcoder;
using ll = long long;
#define rep(i,n) for (ll i = 0; i < (n); ++i)
using vl = vector<ll>;
using vvl = vector<vl>;
using P = pair<ll,ll>;
#define pb push_back
#define int long long
#define double long double
#define INF (ll) 3e18
// Ctrl + Shift + B
// Ctrl + C
// ./m
void solve(){
int n, m; cin >> n >> m;
vl a(n);
vl b(m);
rep(i,n) cin >> a[i];
rep(i,m) cin >> b[i];
if (n == 0 || m == 0){
cout << "Yes" << endl;
for(auto x : a) cout << "Red " << x << endl;
for(auto x : b) cout << "Blue " << x << endl;
return;
}
// ab
// ab
set<int> amp;
set<int> bmp;
rep(i,n) amp.insert(a[i]);
rep(i,m) bmp.insert(b[i]);
vl ab;
for(auto i : amp) if (bmp.count(i)) {
ab.push_back(i);
}
if (ab.size() == 0) cout << "No" << endl;
else {
cout << "Yes" << endl;
//
for(auto i : amp) if (!bmp.count(i)) {
cout << "Red " << i << endl;
}
cout << "Red " << ab[0] << endl;
cout << "Blue " << ab[0] << endl;
for(auto i : bmp) if (!amp.count(i)) {
cout << "Blue " << i << endl;
}
bool c = 0;
auto teban = [&]() -> string {
c ^= 1;
if (c) return "Blue ";
if (!c) return "Red ";
};
for(int i = 1; i < ab.size(); ++i){
cout << teban() << ab[i] << endl;
cout << teban() << ab[i] << endl;
}
}
}
signed main(){
int t; cin >> t;
rep(_,t){
solve();
}
}
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
0