CSES - BAPC 2015 - Results
Submission details
Task:Physical Music
Sender:Antti Röyskö
Submission time:2017-10-17 19:44:14 +0300
Language:C++
Status:READY
Result:
Test results
testverdicttime
#10.11 sdetails

Compiler report

input/code.cpp: In function 'int main()':
input/code.cpp:21:30: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
     for (int i=0; i<ans.size(); ++i) cout << ans[i] << "\n";
                              ^

Code

#include <iostream>
#include <vector>
using namespace std;
int T;


vector<int> ans;
int main(){
  ios_base::sync_with_stdio(0); cin.tie(0);
  cin >> T;
  for (int i=0; i<T; ++i){
    int N;
    cin >> N;
    ans.clear();
    for (int i=1; i<=N; ++i){
      int st;
      cin >> st;
      if (st<i) ans.push_back(i);
    }
    cout << ans.size() << "\n";
    for (int i=0; i<ans.size(); ++i) cout << ans[i] << "\n";
  }
}

Test details

Test 1

Verdict:

input
20
3
1
2
3
...

correct output
0
2
3
4
3
...

user output
0
2
3
4
2
...