Submission #147015

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
1470152019-08-27 06:09:24jun6873City Mapping (NOI18_citymapping)C++11
57 / 100
8 ms1272 KiB
#include "citymapping.h"
#include <bits/stdc++.h>
using namespace std;
// long long get_distance(int X, int Y);
using lint = long long;
const lint inf = 1e18;
int n, t=0, *A, *B, *W;
void f(vector<int> v) {
int x = v[0], y = v[0], z = v[0];
vector<lint> a, b, c, d;
lint mxd;
mxd = 0;
for (int i : v) {
lint d = get_distance(x, i);
if (d > mxd) mxd = d, y = i;
a.push_back(d);
}
mxd = 0;
for (int i : v) {
lint d = get_distance(y, i);
if (d > mxd) mxd = d, z = i;
b.push_back(d);
}
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

citymapping.cpp: In function 'void f(std::vector<int>)':
citymapping.cpp:33:20: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
     for (int i=0; i<v.size(); i++) d.push_back(b[i] - c[i]);
                   ~^~~~~~~~~
citymapping.cpp:36:20: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
     for (int i=0; i<v.size(); i++) ind.push_back(i);
                   ~^~~~~~~~~
citymapping.cpp:42:20: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
     for (int i=0; i<b.size(); i++) tb.push_back(b[ind[i]]);
                   ~^~~~~~~~~
citymapping.cpp:44:20: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
     for (int i=0; i<d.size(); i++) td.push_back(d[ind[i]]);
                   ~^~~~~~~~~
citymapping.cpp:46:20: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
     for (int i=0; i<v.size(); i++) tv.push_back(v[ind[i]]);
                   ~^~~~~~~~~
citymapping.cpp:49:20: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
     for (int i=0; i<v.size(); ) {
                   ~^~~~~~~~~
citymapping.cpp:52:19: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
         while (i+1<v.size() and d[i] == d[i+1]) {
                ~~~^~~~~~~~~
citymapping.cpp:56:15: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
         if (i < v.size()) {
             ~~^~~~~~~~~~
#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...