제출 #1238578

#제출 시각아이디문제언어결과실행 시간메모리
1238578JerInfinite Race (EGOI24_infiniterace2)C++20
29 / 100
12 ms1348 KiB
#include <bits/stdc++.h> using namespace std; const int MAXN = 2e5 + 5; int laps[MAXN]; bool ahead[MAXN]; int n, q; int main() { scanf("%d%d", &n, &q); fill(laps, laps + n, 0); int a, res = 0; while (q--) { scanf("%d", &a); if (a > 0) laps[a] += (ahead[a]), ahead[a] = true, res = max(res, laps[a]); else ahead[-a] = false; } printf("%d\n", res); return 0; }

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

Main.cpp: In function 'int main()':
Main.cpp:13:10: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   13 |     scanf("%d%d", &n, &q);
      |     ~~~~~^~~~~~~~~~~~~~~~
Main.cpp:19:14: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   19 |         scanf("%d", &a);
      |         ~~~~~^~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...