QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#395494#7070. Isomerismsuibian_xiaozhao#AC ✓42ms3856kbC++231.4kb2024-04-21 15:27:352024-04-21 15:27:36

Judging History

你现在查看的是最新测评结果

  • [2024-04-21 15:27:36]
  • 评测
  • 测评结果:AC
  • 用时:42ms
  • 内存:3856kb
  • [2024-04-21 15:27:35]
  • 提交

answer

#include "bits/stdc++.h"

using namespace std;

#define endl "\n"
#define debug(x)  cerr <<#x<<" "<<x<<endl;
using ll = long long;
#define int ll
struct node {
    int ma, mi, va;
};
const int inf = -1e18;

//{-F,-Cl,-Br,-I,-CH3,-CH2CH3,-CH2CH2CH3,-H}
signed main() {
    ios::sync_with_stdio(0), cin.tie(0);
    int n;
    cin >> n;
    debug(n);
    vector<string> v = {"-F", "-Cl", "-Br", "-I",
                        "-CH3", "-CH2CH3", "-CH2CH2CH3", "-H"};


    map<string, int> mp;
    for (int i = 0; i < v.size(); i++) {
        mp[v[i]] = i + 1;
        debug(v[i]);
    }
    while (n--) {
        string s1, s2, s3, s4;
        cin >> s1 >> s2 >> s3 >> s4;
        set<string> s;
        s.emplace(s1);
        s.emplace(s2);
        s.emplace(s3);
        s.emplace(s4);


        if (s1 == s3
            || s2 == s4)
            cout << "None" << endl;
        else if (s.size() != 4) {
            if (s1 == s2 || s3 == s4)
                cout << "Cis" << endl;
            else
                cout << "Trans" << endl;
        } else {
            if ((mp[s1] > mp[s3]) == (mp[s2] > mp[s4])) {
                cout << "Zasamman" << endl;
            } else {
                cout << "Entgegen" << endl;
            }
        }
    }

}
// 2 -H -H -H -Cl -F -F -Br -Cl
//1 -F -F -Cl -Cl
//1 -F  -Cl -Cl -F

// -F -Cl -Br  -I
// -Br -F -Cl    -I

这程序好像有点Bug,我给组数据试试?

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 0ms
memory: 3556kb

input:

2
-H -H -H -Cl
-F -F -Br -Cl

output:

None
Cis

result:

ok 2 lines

Test #2:

score: 0
Accepted
time: 42ms
memory: 3856kb

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