제출 #907456

#제출 시각아이디문제언어결과실행 시간메모리
907456Petrix새로운 문제 (POI13_usu)C++17
100 / 100
129 ms42856 KiB
#include <iostream> #include <string> #include <vector> using namespace std; int sp[1000001],poz1[1000001]; vector<vector<int>> rasp; int main() { string s,s1; int n,k,poz,cnt,i,j; cin>>n>>k>>s1;rasp.resize(n/(k+1)); s=' ';s+=s1; poz=cnt=0; for(i=1;i<s.size();i++){ poz++; sp[poz]=sp[poz-1]+(s[i]=='c'); poz1[poz]=i; if(poz>=k+1 && sp[poz]-sp[poz-k-1]==1){ for(j=poz-k;j<=poz;j++){ rasp[cnt].push_back(poz1[j]); }//printf("a"); cnt++; poz-=(k+1); } } for(i=cnt-1;i>=0;i--){ for(j=0;j<rasp[i].size();j++){ cout<<rasp[i][j]<<" "; } cout<<"\n"; } return 0; }

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

usu.cpp: In function 'int main()':
usu.cpp:16:14: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   16 |     for(i=1;i<s.size();i++){
      |             ~^~~~~~~~~
usu.cpp:29:18: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   29 |         for(j=0;j<rasp[i].size();j++){
      |                 ~^~~~~~~~~~~~~~~
#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...
#Verdict Execution timeMemoryGrader output
Fetching results...