# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
82673 | 2018-11-01T09:42:12 Z | farukkastamonuda | Take-out (POI13_usu) | C++14 | 229 ms | 38244 KB |
#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; }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 376 KB | Output is correct |
2 | Incorrect | 2 ms | 508 KB | Ruch numer 5 nie jest poprawny. |
3 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 2 ms | 508 KB | Ruch numer 10 nie jest poprawny. |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 2 ms | 508 KB | Ruch numer 200 nie jest poprawny. |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 3 ms | 516 KB | Output is correct |
2 | Incorrect | 3 ms | 660 KB | Ruch numer 9 nie jest poprawny. |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 21 ms | 2728 KB | Ruch numer 10000 nie jest poprawny. |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 30 ms | 3840 KB | Ruch numer 10002 nie jest poprawny. |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 88 ms | 7580 KB | Ruch numer 5000 nie jest poprawny. |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 96 ms | 10320 KB | Ruch numer 4000 nie jest poprawny. |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 229 ms | 38244 KB | Ruch numer 500000 nie jest poprawny. |
2 | Halted | 0 ms | 0 KB | - |