제출 #1009432

#제출 시각아이디문제언어결과실행 시간메모리
1009432jakobrsDNA 돌연변이 (IOI21_dna)C++17
100 / 100
27 ms5776 KiB
#pragma GCC target("avx2") #include <string> #include <vector> using i32x4 [[gnu::vector_size(32)]] = int; union Count { struct { int at, ca, tc; int qw; }; i32x4 vec; Count() : at(0), ca(0), tc(0), qw(0) {} Count(i32x4 vec) : vec(vec) {} auto operator-(auto rhs) const -> Count { return { vec - rhs.vec }; } auto operator+(auto rhs) const -> Count { return { vec + rhs.vec }; } }; std::vector<Count> prefixes; void init(std::string a, std::string b) { prefixes.reserve(a.size() + 1); Count count; prefixes.push_back(count); for (size_t i = 0; i < a.size(); i++) { Count c1; c1.at += a[i] == 'A' && b[i] == 'T'; c1.at -= a[i] == 'T' && b[i] == 'A'; c1.ca += a[i] == 'C' && b[i] == 'A'; c1.ca -= a[i] == 'A' && b[i] == 'C'; c1.tc += a[i] == 'T' && b[i] == 'C'; c1.tc -= a[i] == 'C' && b[i] == 'T'; c1.qw += a[i] != b[i]; prefixes.push_back(count = count + c1); } } int get_distance(int x, int y) { y += 1; Count count = prefixes[y] - prefixes[x]; if (!(count.at == count.ca && count.ca == count.tc)) return -1; return (count.qw + std::abs(count.at)) / 2; }

컴파일 시 표준 에러 (stderr) 메시지

dna.cpp:18:18: warning: use of 'auto' in parameter declaration only available with '-fconcepts-ts'
   18 |   auto operator-(auto rhs) const -> Count {
      |                  ^~~~
dna.cpp:22:18: warning: use of 'auto' in parameter declaration only available with '-fconcepts-ts'
   22 |   auto operator+(auto rhs) const -> Count {
      |                  ^~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...