제출 #667650

#제출 시각아이디문제언어결과실행 시간메모리
667650Hacv16Table Tennis (info1cup20_tabletennis)C++17
20 / 100
3092 ms5252 KiB
#include<bits/stdc++.h> using namespace std; typedef long long ll; const int MAX = 2e6 + 50; const int INF = 0x3f3f3f3f; ll n, k, ans; vector<ll> v; bool check(int j){ vector<ll> aux; for(int i = 0; i < v.size(); i++){ if(i >= j && i <= j + k - 1) continue; aux.push_back(v[i]); } ll sum = aux[0] + aux[aux.size() - 1]; for(int l = 1, r = aux.size() - 2; l < r; l++, r--) if(aux[l] + aux[r] != sum) return false; return true; } int main(){ ios_base::sync_with_stdio(false); cin.tie(NULL); cin >> n >> k; for(int i = 0; i < n + k; i++){ ll x; cin >> x; v.push_back(x); } for(int i = 0; i <= v.size() - k + 1; i++) if(check(i)){ ans = i; break;} for(int i = 0; i < v.size(); i++){ if(i >= ans && i <= ans + k - 1) continue; cout << v[i] << ' '; } cout << '\n'; return 0; }

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

tabletennis.cpp: In function 'bool check(int)':
tabletennis.cpp:14:22: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<long long int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   14 |     for(int i = 0; i < v.size(); i++){
      |                    ~~^~~~~~~~~~
tabletennis.cpp: In function 'int main()':
tabletennis.cpp:38:22: warning: comparison of integer expressions of different signedness: 'int' and 'long long unsigned int' [-Wsign-compare]
   38 |     for(int i = 0; i <= v.size() - k + 1; i++)
      |                    ~~^~~~~~~~~~~~~~~~~~~
tabletennis.cpp:41:22: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<long long int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   41 |     for(int i = 0; i < v.size(); i++){
      |                    ~~^~~~~~~~~~
#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...