QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#534623 | #7070. Isomerism | xiojoy# | AC ✓ | 38ms | 3592kb | C++20 | 1.3kb | 2024-08-27 14:33:10 | 2024-08-27 14:33:10 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
#define cctie ios::sync_with_stdio(0);cin.tie(0);cout.tie(0)
#define all(x) x.begin(), x.end()
#define ALL(x) x.begin() + 1, x.end()
using i64 = long long;
using i128 = __int128;
string a[8] = {"-F", "-Cl", "-Br", "-I", "-CH3", "-CH2CH3", "-CH2CH2CH3", "-H"};
map<string, int> to;
void solve() {
set<string> S;
array<string, 5> R;
for (int i = 1; i <= 4; i++) {
cin >> R[i];
S.insert(R[i]);
}
if (R[1] == R[3] || R[2] == R[4]) {
cout << "None\n";
return;
}
if (S.size() == 4) {
bool h1 = false, h2 = false;
if (to[R[1]] > to[R[3]]) {
h1 = true;
}
if (to[R[2]] > to[R[4]]) {
h2 = true;
}
if (h1 == h2) {
cout << "Zasamman\n";
} else {
cout << "Entgegen\n";
}
} else {
if (R[1] == R[2] || R[3] == R[4]) {
cout << "Cis\n";
} else {
cout << "Trans\n";
}
}
}
void prework() {
for (int i = 0; i < 8; i++) {
to[a[i]] = 8 - i;
}
}
int main() {
cctie;
prework();
int T;
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: 1ms
memory: 3592kb
input:
2 -H -H -H -Cl -F -F -Br -Cl
output:
None Cis
result:
ok 2 lines
Test #2:
score: 0
Accepted
time: 38ms
memory: 3576kb
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