제출 #131506

#제출 시각아이디문제언어결과실행 시간메모리
131506SirCenessMeetings (JOI19_meetings)C++14
29 / 100
3025 ms1132 KiB
#include "meetings.h" #include <bits/stdc++.h> using namespace std; #define ll long long; #define mod 1000000007 #define mp make_pair #define pb push_back #define bas(x) #x << ": " << x #define prarr(x, n) cout << #x << ": "; for (int qsd = 0; qsd < n; qsd++) cout << x[qsd] << " "; cout << endl; #define prarrv(x) cout << #x << ": "; for (int qsd = 0; qsd < (int)x.size(); qsd++) cout << x[qsd] << " "; cout << endl; #define inside sl<=l%&&r<=sr #define outside sr<l||r<sl void get(int root, vector<int>& arr){ //cout << "get(" << root << ")" << endl; //prarrv(arr); if (arr.size() == 0) return; int ch = arr[0]; vector<int> bu; vector<int> dig; bu.pb(ch); for (int i = 1; i < arr.size(); i++){ //cout << "query(" << root << ", " << ch << ", " << arr[i] << ")" << endl; int ans = Query(root, ch, arr[i]); if (ans != root){ bu.pb(arr[i]); if (ans == arr[i]) ch = ans; } else { dig.pb(arr[i]); } } //prarrv(bu); //prarrv(dig); //cout << bas(ch) << endl; for (int i = 0; i < bu.size(); i++){ if (bu[i] == ch){ int tmp = bu[bu.size()-1]; bu[bu.size()-1] = bu[i]; bu[i] = tmp; break; } } bu.pop_back(); //cout << "bridge(" << root << ", " << ch << ")" << endl; Bridge(min(root, ch), max(root, ch)); get(ch, bu); get(root, dig); } void Solve(int N) { vector<int> arr(N-1); for (int i = 1; i < N; i++) arr[i-1] = i; get(0, arr); }

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

meetings.cpp: In function 'void get(int, std::vector<int>&)':
meetings.cpp:23:20: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
  for (int i = 1; i < arr.size(); i++){
                  ~~^~~~~~~~~~~~
meetings.cpp:38:20: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
  for (int i = 0; i < bu.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...