제출 #302141

#제출 시각아이디문제언어결과실행 시간메모리
302141arnold518카니발 티켓 (IOI20_tickets)C++14
11 / 100
8 ms12800 KiB
#include "tickets.h" #include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<int, int> pii; typedef pair<ll, ll> pll; const int MAXN = 1500; int N, M, K; int A[MAXN+10][MAXN+10]; int ans2[MAXN+10][MAXN+10]; ll ans; ll find_maximum(int _K, vector<vector<int>> _X) { N=_X.size(); M=_X[0].size(); K=_K; for(int i=1; i<=N; i++) for(int j=1; j<=M; j++) A[i][j]=_X[i-1][j-1]; vector<ll> V; for(int i=1; i<=N; i++) V.push_back(A[i][1]); sort(V.begin(), V.end()); for(int i=1; i<=N; i++) ans2[i][1]=1; for(int i=0; i<V.size(); i++) ans+=abs(V[i]-V[V.size()/2]); vector<vector<int>> answer; answer=vector<vector<int>>(N, vector<int>(M)); for(int i=1; i<=N; i++) for(int j=1; j<=M; j++) answer[i-1][j-1]=ans2[i][j]-1; allocate_tickets(answer); return ans; }

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

tickets.cpp: In function 'll find_maximum(int, std::vector<std::vector<int> >)':
tickets.cpp:27:16: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<long long int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   27 |  for(int i=0; i<V.size(); i++) ans+=abs(V[i]-V[V.size()/2]);
      |               ~^~~~~~~~~
#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...