제출 #63013

#제출 시각아이디문제언어결과실행 시간메모리
63013theknife2001Crayfish scrivener (IOI12_scrivener)C++17
60 / 100
1085 ms137264 KiB
#include <bits/stdc++.h>
 
 
using namespace std;
const int N=1e6+55;
int trie[N+10000][26];
char letter[N];
int p[N][21];
int a[N];
int l[N];
int sh[30];
int node;
int cnt=1;
int k=1;
 
void Init()
{
  for(int i=0;i<25;i++)
    sh[i]=(1<<i);
    node=cnt++;
}
 
int c,temp,nd;
void TypeLetter(char L)
{
    c=L-'a';
    temp=node;
    if(trie[node][c]==0)
        trie[node][c]=cnt++;
    node=trie[node][c];
    letter[node]=L;
    a[k]=node;
    l[k]=l[k-1]+1;
    if(p[node][0]==0)
    {
        p[node][0]=temp;
        for(int i=1;i<20;i++)
        {
            p[node][i]=p[p[node][i-1]][i-1];
            if(p[node][i]==0)
                break;
        }
    }
    k++;
}
 
void UndoCommands(int U)
{
    node=a[k-U-1];
    l[k]=l[k-U-1];
    a[k]=node;
    k++;
}
char GetLetter(int P)
{
    P=l[k-1]-P-1;
    nd=node;
    for(int i=20;i>=0;i--)
    {
        if((P&sh[i]))
            nd=p[nd][i];
    }
    return letter[nd];
}

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

scrivener.cpp: In function 'void Init()':
scrivener.cpp:18:3: warning: this 'for' clause does not guard... [-Wmisleading-indentation]
   for(int i=0;i<25;i++)
   ^~~
scrivener.cpp:20:5: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'for'
     node=cnt++;
     ^~~~
#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...