Submission #26583

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
265832017-07-03 09:54:52model_codeAmusement Park (JOI17_amusement_park)C++14
100 / 100
89 ms23480 KiB
#include "Joi.h"
#include <cstdio>
#include <vector>
#include <algorithm>
using namespace std;
static const int NMAX = 10000;
static const int BITS = 60;
namespace {
vector<int> tree[NMAX];
int N;
int union_find[NMAX];
int root(int p)
{
return union_find[p] < 0 ? p : (union_find[p] = root(union_find[p]));
}
bool join(int p, int q)
{
p = root(p);
q = root(q);
if (p == q) return false;
union_find[p] += union_find[q];
union_find[q] = p;
return true;
}
void SpanningTree(int M, int A[], int B[]) {
fill(union_find, union_find + N, -1);
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

Joi.cpp: In function 'void {anonymous}::ComputeSubtrees(int, int, std::vector<std::pair<int, int> >)':
Joi.cpp:63:21: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
   for (int i = 0; i < sub.size(); ++i) {
                     ^
Joi.cpp:69:21: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
   for (int i = 0; i < sub.size(); ++i) {
                     ^
Joi.cpp:76:21: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
   for (int i = 0; i < sub.size(); ++i) {
                     ^
Joi.cpp: In function 'void {anonymous}::CommonProc(int, int, int*, int*)':
Joi.cpp:96:20: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
  for (int i = 0; i < tree.size(); ++i) {
                    ^
Joi.cpp:98:21: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
   for (int j = 0; j < tree.size(); ++j) {
                     ^

Ioi.cpp: In function 'void {anonymous}::ComputeSubtrees(int, int, std::vector<std::pair<int, int> >)':
Ioi.cpp:63:21: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
   for (int i = 0; i < sub.size(); ++i) {
                     ^
Ioi.cpp:69:21: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
   for (int i = 0; i < sub.size(); ++i) {
                     ^
Ioi.cpp:76:21: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
   for (int i = 0; i < sub.size(); ++i) {
                     ^
Ioi.cpp: In function 'void {anonymous}::CommonProc(int, int, int*, int*)':
Ioi.cpp:96:20: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
  for (int i = 0; i < tree.size(); ++i) {
                    ^
Ioi.cpp:98:21: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
   for (int j = 0; j < tree.size(); ++j) {
                     ^
#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...