제출 #842782

#제출 시각아이디문제언어결과실행 시간메모리
842782SUNWOOOOOOOOJail (JOI22_jail)C++17
5 / 100
59 ms5308 KiB
#include <bits/stdc++.h> using namespace std; using pint = array <int, 2>; const int mxN = 120005; vector <int> ans; vector <pint> v1, v2; int n, m; int solve() { sort(v1.begin(), v1.end()); sort(v2.begin(), v2.end()); for (int i = 0; i < m; i++) { if (v1[i][1] != v2[i][1]) return 0; } return 1; } int main() { int q; scanf("%d", &q); while (q--) { scanf("%d", &n); for (int i = 0, a, b; i < n - 1; i++) scanf("%d %d", &a, &b); scanf("%d", &m); v1.clear(); v2.clear(); for (int i = 0, s, t; i < m; i++) { scanf("%d %d", &s, &t); v1.push_back({s, i}); v2.push_back({t, i}); } ans.push_back(solve()); } for (int elm : ans) { if (elm) printf("Yes\n"); else printf("No\n"); } return 0; }

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

jail.cpp: In function 'int main()':
jail.cpp:22:10: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   22 |     scanf("%d", &q);
      |     ~~~~~^~~~~~~~~~
jail.cpp:24:14: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   24 |         scanf("%d", &n);
      |         ~~~~~^~~~~~~~~~
jail.cpp:25:52: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   25 |         for (int i = 0, a, b; i < n - 1; i++) scanf("%d %d", &a, &b);
      |                                               ~~~~~^~~~~~~~~~~~~~~~~
jail.cpp:26:14: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   26 |         scanf("%d", &m);
      |         ~~~~~^~~~~~~~~~
jail.cpp:29:18: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   29 |             scanf("%d %d", &s, &t);
      |             ~~~~~^~~~~~~~~~~~~~~~~
#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...