QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#298302#4832. TelepathyfxhdCompile Error//C++17761b2024-01-05 23:23:032024-01-05 23:23:03

Judging History

This is the latest submission verdict.

  • [2024-01-05 23:23:03]
  • Judged
  • [2024-01-05 23:23:03]
  • Submitted

answer

#include <bits/stdc++.h>

using namespace std;

#ifdef DEBUG
  #include "debug.hpp"
#else
  #define dbg(...) 0
#endif

int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  string s;
  cin >> s;
  array<int, 8> T;
  if (s == "Flim") {
    T = {2, 1, 0, 0, 2, 1, 2, 2};
  }
  else {
    assert(s == "Flam");
    T = {2, 0, 2, 0, 1, 1, 2, 2}
  }
  int n, k;
  cin >> n >> k;
  string a;
  cin >> a;
  assert(int(a.size()) == n);
  vector<int> ans(k);
  for (int i = 0; i < k; ++i) {
    int b = (a[3 * i] == '1') * 4 + (a[3 * i + 1] == '1') * 2 + (a[3 * i + 2] == '1');
    ans[i] = 3 * i + T[b];
  }
  for (int i = 0; i < k; ++i) { 
    if (i > 0) cout << ' ';
    cout << (ans[i] + 1);
  }
  cout << '\n';
}

Details

answer.code: In function ‘int main()’:
answer.code:22:33: error: expected ‘;’ before ‘}’ token
   22 |     T = {2, 0, 2, 0, 1, 1, 2, 2}
      |                                 ^
      |                                 ;
   23 |   }
      |   ~