Submission #30300500
Source Code Expand
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for(int i = 0; i < (n); ++i)
std::vector<std::string> split(const std::string& text, const char delim);
using ll = long long int;
using llu = unsigned long long int;
int main(){
string buffer;
getline(cin, buffer);
auto s = std::move(split(buffer, ' '));
getline(cin, buffer);
auto t = std::move(split(buffer, ' '));
int matched_count = 0;
for (int i = 0; i < 3; ++i) {
if (s[i] == t[i]) {
++matched_count;
}
}
if (matched_count == 0) {
cout << "Yes" << endl;
} else if (matched_count == 1) {
cout << "No" << endl;
} else if (matched_count == 3) {
cout << "Yes" << endl;
} else {
cout << "Error" << endl;
}
return 0;
}
std::vector<std::string> split(const std::string& text, const char delim) {
std::vector<std::string> item_list;
std::stringstream ss(text);
std::string buffer;
while ( std::getline(ss, buffer, delim) ) {
if (!buffer.empty()) {
item_list.emplace_back(buffer);
}
}
return item_list;
}
Submission Info
| Submission Time | |
|---|---|
| Task | D - Swap Hats |
| User | low10603 |
| Language | C++ (GCC 9.2.1) |
| Score | 400 |
| Code Size | 1198 Byte |
| Status | AC |
| Exec Time | 5 ms |
| Memory | 3604 KiB |
Judge Result
| Set Name | Sample | All | ||||
|---|---|---|---|---|---|---|
| Score / Max Score | 0 / 0 | 400 / 400 | ||||
| Status |
|
|
| Set Name | Test Cases |
|---|---|
| Sample | sample_01.txt |
| All | BGR_BGR.txt, BGR_BRG.txt, BGR_GBR.txt, BGR_GRB.txt, BGR_RBG.txt, BGR_RGB.txt, BRG_BGR.txt, BRG_BRG.txt, BRG_GBR.txt, BRG_GRB.txt, BRG_RBG.txt, BRG_RGB.txt, GBR_BGR.txt, GBR_BRG.txt, GBR_GBR.txt, GBR_GRB.txt, GBR_RBG.txt, GBR_RGB.txt, GRB_BGR.txt, GRB_BRG.txt, GRB_GBR.txt, GRB_GRB.txt, GRB_RBG.txt, GRB_RGB.txt, RBG_BGR.txt, RBG_BRG.txt, RBG_GBR.txt, RBG_GRB.txt, RBG_RBG.txt, RBG_RGB.txt, RGB_BGR.txt, RGB_BRG.txt, RGB_GBR.txt, RGB_GRB.txt, RGB_RBG.txt, sample_01.txt |
| Case Name | Status | Exec Time | Memory |
|---|---|---|---|
| BGR_BGR.txt | AC | 5 ms | 3600 KiB |
| BGR_BRG.txt | AC | 1 ms | 3576 KiB |
| BGR_GBR.txt | AC | 2 ms | 3596 KiB |
| BGR_GRB.txt | AC | 2 ms | 3604 KiB |
| BGR_RBG.txt | AC | 2 ms | 3580 KiB |
| BGR_RGB.txt | AC | 2 ms | 3568 KiB |
| BRG_BGR.txt | AC | 2 ms | 3576 KiB |
| BRG_BRG.txt | AC | 2 ms | 3604 KiB |
| BRG_GBR.txt | AC | 2 ms | 3600 KiB |
| BRG_GRB.txt | AC | 2 ms | 3504 KiB |
| BRG_RBG.txt | AC | 4 ms | 3532 KiB |
| BRG_RGB.txt | AC | 2 ms | 3520 KiB |
| GBR_BGR.txt | AC | 2 ms | 3376 KiB |
| GBR_BRG.txt | AC | 2 ms | 3576 KiB |
| GBR_GBR.txt | AC | 2 ms | 3580 KiB |
| GBR_GRB.txt | AC | 2 ms | 3528 KiB |
| GBR_RBG.txt | AC | 2 ms | 3512 KiB |
| GBR_RGB.txt | AC | 2 ms | 3584 KiB |
| GRB_BGR.txt | AC | 2 ms | 3592 KiB |
| GRB_BRG.txt | AC | 2 ms | 3532 KiB |
| GRB_GBR.txt | AC | 2 ms | 3524 KiB |
| GRB_GRB.txt | AC | 2 ms | 3592 KiB |
| GRB_RBG.txt | AC | 2 ms | 3568 KiB |
| GRB_RGB.txt | AC | 2 ms | 3488 KiB |
| RBG_BGR.txt | AC | 2 ms | 3448 KiB |
| RBG_BRG.txt | AC | 2 ms | 3520 KiB |
| RBG_GBR.txt | AC | 2 ms | 3460 KiB |
| RBG_GRB.txt | AC | 2 ms | 3576 KiB |
| RBG_RBG.txt | AC | 2 ms | 3568 KiB |
| RBG_RGB.txt | AC | 2 ms | 3380 KiB |
| RGB_BGR.txt | AC | 2 ms | 3596 KiB |
| RGB_BRG.txt | AC | 3 ms | 3528 KiB |
| RGB_GBR.txt | AC | 2 ms | 3380 KiB |
| RGB_GRB.txt | AC | 1 ms | 3564 KiB |
| RGB_RBG.txt | AC | 2 ms | 3576 KiB |
| sample_01.txt | AC | 2 ms | 3460 KiB |