제출 #555824

#제출 시각아이디문제언어결과실행 시간메모리
555824colossal_pepeTable Tennis (info1cup20_tabletennis)C++17
100 / 100
2785 ms3916 KiB
#include <iostream> #include <vector> #include <algorithm> using namespace std; int n, m; vector<int> v; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); cin >> n >> m; v.resize(n + m); for (int i = 0; i < n + m; i++) { cin >> v[i]; } bool done = 0; for (int i = (n / 2) - 1; i <= (n / 2) - 1 + m; i++) { int total = v[i] + v[i + 1]; int cnt = 0; for (int j = 0; j < n + m; j++) { if (binary_search(v.begin(), v.end(), total - v[j])) cnt++; } if (cnt < n) continue; cnt = n; for (int j = 0; j < n + m; j++) { if (cnt == 0) break; if (binary_search(v.begin(), v.end(), total - v[j])) { cout << v[j] << ' '; cnt--; } } break; } return 0; }

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

tabletennis.cpp: In function 'int main()':
tabletennis.cpp:17:10: warning: unused variable 'done' [-Wunused-variable]
   17 |     bool done = 0;
      |          ^~~~
#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...
#Verdict Execution timeMemoryGrader output
Fetching results...