Submission #572586

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
5725862022-06-04 17:55:26model_codePalindromi (COCI22_palindromi)C++17
110 / 110
480 ms144404 KiB
#include<bits/stdc++.h>
using namespace std;
typedef long long llint;
typedef pair <int, int> pi;
const int MAXN = 100005;
int n;
string s;
int p[MAXN];
struct olbat {
int cnt, siz, lef, rig;
vector <int> len, link, suf[2], child[2];
deque <char> dq;
olbat () {
cnt = 2; siz = 0;
lef = rig = 1;
len = {-1, 0};
child[0] = child[1] = {0, 0};
link = suf[0] = suf[1] = {0, 0};
}
void add_new_node (int par, char c) {
len.push_back(len[par] + 2);
child[c - '0'][par] = cnt;
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

Main.cpp: In member function 'void olbat::add_lef(char)':
Main.cpp:80:45: warning: suggest parentheses around '&&' within '||' [-Wparentheses]
   80 |             if (len[link[cnt - 1]] - 1 >= 0 && dq[len[link[cnt - 1]] - 1] == '0' || len[link[cnt - 1]] - 1 < 0 && c == '0') {
Main.cpp: In member function 'void olbat::ispis()':
Main.cpp:105:9: warning: this 'for' clause does not guard... [-Wmisleading-indentation]
  105 |         for (auto c : dq) cout << c; cout << endl;
      |         ^~~
Main.cpp:105:38: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'for'
  105 |         for (auto c : dq) cout << c; cout << endl;
      |                                      ^~~~
Main.cpp: In function 'int spoji(int, int)':
Main.cpp:122:27: warning: comparison of integer expressions of different signedness: 'int' and 'std::deque<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
  122 |         for (int i = 0; i < ol[b].dq.size(); i++) {
      |                         ~~^~~~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...