제출 #550297

#제출 시각UTC-0아이디문제언어결과실행 시간메모리
5502972022-04-17 20:00:31LucaDantasLong Mansion (JOI17_long_mansion)C++17
25 / 100
3042 ms35828 KiB
#include <bits/stdc++.h>
using namespace std;
constexpr int maxn = 5e5+10;
int l[maxn], r[maxn];
int edge_sweep_l[maxn], edge_sweep_r[maxn];
vector<int> keys[maxn];
bool tem(int x, int y, int cor) {
// return 1 if there is some element with color 'cor' inside the open interval ]x, y[
auto it = upper_bound(keys[cor].begin(), keys[cor].end(), x);
return it != keys[cor].end() && *it < y;
}
int main() {
int n; scanf("%d", &n);
for(int i = 1; i < n; i++) {
int c; scanf("%d", &c);
edge_sweep_l[i] = edge_sweep_r[i+1] = c;
}
for(int i = 1; i <= n; i++) {
int a, b; scanf("%d", &b);
while(b--) {
scanf("%d", &a);
keys[a].push_back(i);
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

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

long_mansion.cpp: In function 'int main()':
long_mansion.cpp:19:14: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   19 |  int n; scanf("%d", &n);
      |         ~~~~~^~~~~~~~~~
long_mansion.cpp:22:15: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   22 |   int c; scanf("%d", &c);
      |          ~~~~~^~~~~~~~~~
long_mansion.cpp:27:18: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   27 |   int a, b; scanf("%d", &b);
      |             ~~~~~^~~~~~~~~~
long_mansion.cpp:29:9: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   29 |    scanf("%d", &a);
      |    ~~~~~^~~~~~~~~~
long_mansion.cpp:56:14: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   56 |  int q; scanf("%d", &q);
      |         ~~~~~^~~~~~~~~~
long_mansion.cpp:58:18: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   58 |   int x, y; scanf("%d %d", &x, &y);
      |             ~~~~~^~~~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...