제출 #429376

#제출 시각아이디문제언어결과실행 시간메모리
429376JUANDI321식물 비교 (IOI20_plants)C++17
0 / 100
1 ms204 KiB
#include "plants.h" #include <vector> #include <iostream> using namespace std; int l[200100]; int n; void init(int k, vector<int> r) { int nn = r.size(); n = nn; l[0] = 200100; for(int i = 0; i<n; i++) { if(r[i] == 1)l[i+1] = l[i] + 1; else l[i] - 1; } return; } int compare_plants(int x, int y) { if( y-x == l[y]-l[x])return 1; if( y-x == -1 *(l[y]-l[x]))return -1; if( n-y + x == l[n]-l[y] + l[x])return 1; if( n-y + x == -1*(l[n]-l[y] + l[x]))return -1; return 0; }

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

plants.cpp: In function 'void init(int, std::vector<int>)':
plants.cpp:16:13: warning: statement has no effect [-Wunused-value]
   16 |   else l[i] - 1;
      |        ~~~~~^~~
#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...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...