Task: | Physical Music |
Sender: | KnowYourArchitecture |
Submission time: | 2017-10-17 20:41:28 +0300 |
Language: | C++ |
Status: | READY |
Result: | WRONG ANSWER |
test | verdict | time | |
---|---|---|---|
#1 | WRONG ANSWER | 0.30 s | details |
Compiler report
input/code.cpp: In function 'int main()': input/code.cpp:23:26: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] for(int i=0;i<res.size();++i)cout<<res[i]<<'\n'; ^
Code
#include <bits/stdc++.h> #define F first #define S second using namespace std; typedef long long ll; int main(){ int Tn; cin>>Tn; while(Tn--){ int n; cin >> n; vector<int> res; int t=1; for (int i = 0; i < n; i++) { int a; cin >> a; if (a==t)++t; else res.emplace_back(a); } sort(res.begin(),res.end()); cout<<res.size()<<'\n'; for(int i=0;i<res.size();++i)cout<<res[i]<<'\n'; } }