제출 #82673

#제출 시각아이디문제언어결과실행 시간메모리
82673farukkastamonuda새로운 문제 (POI13_usu)C++14
0 / 100
229 ms38244 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 j=1;j<=k+1;j++){ T.pb(v.back()); v.pop_back(); } int X=k-p[c]; c--; p.pop_back(); p[c]-=X; reverse(T.begin(),T.end()); ans.pb(T); } } for(int i=0;i<(int)ans.size();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...