QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#166569 | #7070. Isomerism | ucup-team004# | AC ✓ | 25ms | 3508kb | C++20 | 1013b | 2023-09-06 15:07:05 | 2023-09-06 15:07:06 |
Judging History
answer
#include <bits/stdc++.h>
using i64 = long long;
int priority(const std::string &s) {
std::string p[] = {"-F", "-Cl", "-Br", "-I", "-CH3", "-CH2CH3", "-CH2CH2CH3", "-H"};
for (int i = 0; ; i++) {
if (p[i] == s) {
return i;
}
}
}
void solve() {
std::string R[5];
for (int i = 1; i <= 4; i++) {
std::cin >> R[i];
}
if (R[1] == R[3] || R[2] == R[4]) {
std::cout << "None\n";
} else if (R[1] == R[2] || R[3] == R[4]) {
std::cout << "Cis\n";
} else if (R[1] == R[4] || R[2] == R[3]) {
std::cout << "Trans\n";
} else if ((priority(R[1]) > priority(R[3])) == (priority(R[2]) > priority(R[4]))) {
std::cout << "Zasamman\n";
} else {
std::cout << "Entgegen\n";
}
}
int main() {
std::ios::sync_with_stdio(false);
std::cin.tie(nullptr);
int t;
std::cin >> t;
while (t--) {
solve();
}
return 0;
}
这程序好像有点Bug,我给组数据试试?
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 2ms
memory: 3440kb
input:
2 -H -H -H -Cl -F -F -Br -Cl
output:
None Cis
result:
ok 2 lines
Test #2:
score: 0
Accepted
time: 25ms
memory: 3508kb
input:
100000 -Br -CH3 -H -CH2CH2CH3 -CH3 -I -Cl -Cl -CH3 -Br -CH2CH3 -CH3 -H -CH3 -Cl -CH3 -H -F -CH2CH3 -CH2CH2CH3 -Br -Br -Cl -CH2CH2CH3 -F -Cl -H -CH2CH2CH3 -CH2CH2CH3 -CH3 -CH3 -H -CH2CH2CH3 -CH3 -CH2CH2CH3 -Br -CH3 -Cl -CH2CH2CH3 -CH3 -H -CH2CH3 -I -I -CH3 -Cl -Br -I -I -Cl -H -F -CH2CH2CH3 -Cl -Br -...
output:
Zasamman Cis Trans None Entgegen Cis Zasamman Trans None Trans Cis Entgegen Entgegen Cis Cis Entgegen Trans None Cis None Cis None None Zasamman Cis None Entgegen Entgegen None None Cis Trans Zasamman Entgegen Zasamman Trans Entgegen None Zasamman Trans Cis Trans Zasamman Trans None Zasamman None Tr...
result:
ok 100000 lines