Submission #47869

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
478692018-05-08 10:11:25leejseo트리 (KOI16_tree)C++17
100 / 100
397 ms65536 KiB
#include <stdio.h>
#include <vector>
using namespace std;
#define MAXN 200000
int N, Q;
int par[MAXN+5];
int color[MAXN+5];
vector<int> stack1;
vector<int> stack2;
vector<int> L1;
vector<int> L2;
vector<int> dec[MAXN+5];
bool vis[MAXN+5];
int cc = 1;
void input(){
scanf("%d%d", &N, &Q);
par[1] = -1;
par[0] = -1;
color[1] = 1;
for (int i=2; i<=N; i++){
color[i] = 1;
scanf("%d", &par[i]);
dec[par[i]].push_back(i);
}
}
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

tree.cpp: In function 'void delete_edge(int)':
tree.cpp:35:17: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
  for (int i=0; i<L1.size(); i++){
                ~^~~~~~~~~~
tree.cpp:38:17: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
  for (int i=0; i<L2.size(); i++){
                ~^~~~~~~~~~
tree.cpp:72:19: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
    for (int i=0; i<dec[v1].size(); i++){
                  ~^~~~~~~~~~~~~~~
tree.cpp:82:19: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
    for (int i=0; i<dec[v2].size(); i++){
                  ~^~~~~~~~~~~~~~~
tree.cpp:93:18: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
   for (int i=0; i<L1.size(); i++){
                 ~^~~~~~~~~~
tree.cpp:99:18: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
   for (int i=0; i<L2.size(); i++){
                 ~^~~~~~~~~~
tree.cpp: In function 'void input()':
tree.cpp:20:7: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
  scanf("%d%d", &N, &Q);
  ~~~~~^~~~~~~~~~~~~~~~
tree.cpp:26:8: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   scanf("%d", &par[i]);
   ~~~~~^~~~~~~~~~~~~~~
tree.cpp: In function 'int main()':
tree.cpp:112:8: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   scanf("%d%d%d", &u, &v, &q);
   ~~~~~^~~~~~~~~~~~~~~~~~~~~~
#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...