Submission #1019051

#TimeUsernameProblemLanguageResultExecution timeMemory
1019051NurislamIsland Hopping (JOI24_island)C++17
2 / 100
3 ms344 KiB
#include "island.h" #include <bits/stdc++.h> //#include <ext/pb_ds/assoc_container.hpp> //#include <ext/pb_ds/tree_policy.hpp> //using namespace __gnu_pbds; #define pb push_back using namespace std; void solve(int N, int L){ vector<int> ord, pos(N+1), p(N+1); for(int i = 1; i < N; i++){ ord.pb(query(1, i)); } for(int i = 0; i < ord.size(); i++){ pos[ord[i]] = i+1; } for(int i = 0; i < ord.size(); i++){ if(!p[ord[i]]){ for(int k = 1; k < N; i++){ int v = query(ord[i], k); if(pos[v] < pos[ord[i]]){ p[ord[i]]= v; break; } else { p[v] = ord[i]; } } } } for(int i = 2; i <= N; i++){ answer(i, p[i]); } } //signed main(){ //ios_base::sync_with_stdio(false); //cin.tie(nullptr); //cout.tie(nullptr); //int tt = 1; //cin >> tt; //while(tt--){ //solve(); //} //}

Compilation message (stderr)

island.cpp: In function 'void solve(int, int)':
island.cpp:16:19: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   16 |  for(int i = 0; i < ord.size(); i++){
      |                 ~~^~~~~~~~~~~~
island.cpp:20:19: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   20 |  for(int i = 0; i < ord.size(); i++){
      |                 ~~^~~~~~~~~~~~
#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...
#Verdict Execution timeMemoryGrader output
Fetching results...