제출 #82675

#제출 시각아이디문제언어결과실행 시간메모리
82675farukkastamonuda새로운 문제 (POI13_usu)C++14
100 / 100
245 ms39716 KiB
#include <bits/stdc++.h> #define fi first #define se second #define lo long long #define inf 1000000009 #define md 1000000007 #define li 1000005 #define mp make_pair #define pb push_back using namespace std; int n,k,cev,bas1,bas2,c; char s[li]; vector<int> v,p; vector< vector<int> > ans; int main(){ scanf("%d %d",&n,&k); scanf("%s",s+1); p.pb(0); for(int i=1;i<=n;i++){ v.pb(i); if(s[i]=='c'){ c++; p.pb(0); } else p[c]++; if(c && p[c]+p[c-1]>=k){ vector<int> T; for(int i=0;i<k+1;i++){ T.pb(v.back()); v.pop_back(); } reverse(T.begin(),T.end()); ans.pb(T); int X=p[c--]; p.pop_back(); p[c]-=k-X; } } for(int i=(int)ans.size()-1;i>=0;i--){ for(int j=0;j<(int)ans[i].size();j++){ printf("%d ",ans[i][j]); } printf("\n"); } return 0; }

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

usu.cpp: In function 'int main()':
usu.cpp:16:7: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
  scanf("%d %d",&n,&k);
  ~~~~~^~~~~~~~~~~~~~~
usu.cpp:17:7: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
  scanf("%s",s+1);
  ~~~~~^~~~~~~~~~
#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...