제출 #329724

#제출 시각아이디문제언어결과실행 시간메모리
329724figter001팀들 (IOI15_teams)C++17
0 / 100
4062 ms16468 KiB
#include "teams.h" #include <bits/stdc++.h> using namespace std; #define all(x) (x).begin(), (x).end() #define fast ios::sync_with_stdio(false);cin.tie(0); typedef long long ll; typedef long double ld; typedef unsigned long long ull; mt19937 rng(chrono::steady_clock::now().time_since_epoch().count()); vector<pair<int,int>> s; int n; void init(int N, int A[], int B[]) { n = N; for(int i=0;i<n;i++){ s.push_back({A[i], B[i]}); } sort(all(s) , [](pair<int,int> a,pair<int,int> b){ if(a.second == b.second) return a.first < b.first; return a.second < b.second; }); } int can(int M, int K[]) { sort(K,K+M); int id = 0,cnt=0; for(int i=0;i<s.size();i++){ if(id == M)break; cnt += (s[i].first <= K[id] && s[i].second >= K[id]); if(cnt == K[id]){ cnt = 0; id++; } } return id == M; }

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

teams.cpp: In function 'int can(int, int*)':
teams.cpp:31:15: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::pair<int, int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   31 |  for(int i=0;i<s.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...