Submission #150731

#TimeUsernameProblemLanguageResultExecution timeMemory
150731お前はもう死んでいる (#200)Lokahian Relics (FXCUP4_lokahia)C++17
0 / 100
7 ms640 KiB
#include "lokahia.h" #include <bits/stdc++.h> using namespace std; int FindBase(int N){ vector<vector<int> > s, t, de; vector<int> la; for(int i = 0; i < N; i++) s.push_back({i}); while(s.size() > 1){ for(int i = 1; i < s.size(); i += 2){ if(CollectRelics(s[i - 1][0], s[i][0]) == -1){ de.push_back(s[i - 1]); de.push_back(s[i]); } else { for(int& x : s[i - 1]) s[i].push_back(x); t.push_back(s[i]); } } if(s.size() & 1){ de.push_back(s.back()); la = s.back(); } swap(s, t); t.clear(); } int sz = 0; if(s.empty()) s.push_back(la); else sz = s[0].size(); if(s[0].empty()) return -1; int res = 0; for(int i = 1; i < s[0].size(); i++){ res = max(res, CollectRelics(s[0][i], s[0][0])); } for(auto& x : de){ int rrr = CollectRelics(x[0], s[0][0]); if(rrr != -1){ res = max(res, rrr); for(int i = 1; i < x.size(); i++){ rrr = CollectRelics(x[i], s[0][0]); res = max(res, rrr); } sz += x.size(); } } if(sz > N / 2) return res; return -1; }

Compilation message (stderr)

lokahia.cpp: In function 'int FindBase(int)':
lokahia.cpp:13:26: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
         for(int i = 1; i < s.size(); i += 2){
                        ~~^~~~~~~~~~
lokahia.cpp:41:22: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
     for(int i = 1; i < s[0].size(); i++){
                    ~~^~~~~~~~~~~~~
lokahia.cpp:49:30: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
             for(int i = 1; i < x.size(); i++){
                            ~~^~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...