제출 #1049174

#제출 시각아이디문제언어결과실행 시간메모리
1049174Maite_Morale순열 (APIO22_perm)C++17
91.33 / 100
1 ms348 KiB
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define vll vector<ll> std::vector<int> construct_permutation(long long k){ vll r;ll b=0;ll c=0,d=0; vector<int> ans={}; for(int i=60;i>=0;i--){ if(b==1){ r.push_back(c);c++; if(k&(1LL<<i)){ d--; r.push_back(d); } } if(k&(1LL<<i)){ b=1;//cout<<i<<"*-*"; } } for(int i=0;i<r.size();i++){ ans.push_back(r[i]-d); //cout<<ans.back()<<" "; }//cout<<"\n"; return ans; }

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

perm.cpp: In function 'std::vector<int> construct_permutation(long long int)':
perm.cpp:21:15: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<long long int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   21 |  for(int i=0;i<r.size();i++){
      |              ~^~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...