제출 #428576

#제출 시각UTC-0아이디문제언어결과실행 시간메모리
4285762021-06-15 12:58:34tqbfjotldCheerleaders (info1cup20_cheerleaders)C++14
72 / 100
2057 ms109236 KiB
#include <bits/stdc++.h>
using namespace std;
int arr[(1<<18)+5];
int curarr[(1<<18)+5];
vector<int> f1(vector<int> v){
vector<int> nw;
for (int x = 0; x<v.size(); x+=2){
nw.push_back(v[x]);
}
for (int x = 1; x<v.size(); x+=2){
nw.push_back(v[x]);
}
return nw;
}
int n,logn;
vector<long long> allvals(int lpos, int sz ,vector<pair<int,int> > sorted){
if (sorted.size()==1){
return {0};
}
// printf("called with sz %d, sortsz %d\n",sz,sorted.size());
long long inter1 = 0,inter2 = 0;
vector<pair<int,int> >sortl,sortr;
for (auto x : sorted){
if (x.second-lpos<sz/2) sortl.push_back(x);
else sortr.push_back(x);
}
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

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

cheerleaders.cpp: In function 'std::vector<int> f1(std::vector<int>)':
cheerleaders.cpp:9:22: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
    9 |     for (int x = 0; x<v.size(); x+=2){
      |                     ~^~~~~~~~~
cheerleaders.cpp:12:22: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   12 |     for (int x = 1; x<v.size(); x+=2){
      |                     ~^~~~~~~~~
cheerleaders.cpp: In function 'std::vector<long long int> allvals(int, int, std::vector<std::pair<int, int> >)':
cheerleaders.cpp:34:18: warning: comparison of integer expressions of different signedness: 'long long int' and 'std::vector<std::pair<int, int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   34 |         while (c1<sortl.size() && sortl[c1]<x) c1++;
      |                ~~^~~~~~~~~~~~~
cheerleaders.cpp: In function 'bool dfs(int, int)':
cheerleaders.cpp:70:19: warning: comparison of integer expressions of different signedness: 'std::unordered_set<long long int>::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
   70 |     if (vis.size()>cur){
      |         ~~~~~~~~~~^~~~
cheerleaders.cpp: In function 'int main()':
cheerleaders.cpp:136:22: warning: 'numlogn' may be used uninitialized in this function [-Wmaybe-uninitialized]
  136 |     for (int x = 0; x<numlogn; x++){
      |                     ~^~~~~~~~
cheerleaders.cpp:148:19: warning: 'anspos' may be used uninitialized in this function [-Wmaybe-uninitialized]
  148 |         if (anspos&(1<<x)){
      |             ~~~~~~^~~~~~~
#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...