제출 #639018

#제출 시각아이디문제언어결과실행 시간메모리
639018ggoh팀들 (IOI15_teams)C++14
0 / 100
90 ms9800 KiB
#include "teams.h" #include<bits/stdc++.h> using namespace std; #define sz(v) ((int)(v).size()) typedef long long lint; typedef pair<int,int> pii; int n; pii d[500003]; void init(int N, int A[], int B[]) { n=N; for(int i=0;i<n;i++)d[i]={A[i],B[i]}; sort(d,d+n); } int can(int M, int K[]) { lint sum=0; for(int i=0;i<M;i++)sum+=K[i]; if(sum>n)return 0; int ans=1,t; sort(K,K+M); t=K[0]; vector<pii>V; for(int i=1;i<M;i++) { if(K[i]==K[i-1]) { t+=K[i]; } else { V.push_back({K[i-1],t}); t=K[i]; } } V.push_back({K[M-1],t}); int m=sz(V); return ans; }

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

teams.cpp: In function 'int can(int, int*)':
teams.cpp:39:6: warning: unused variable 'm' [-Wunused-variable]
   39 |  int m=sz(V);
      |      ^
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...