QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#595104 | #5147. Stack Sort | louhao088# | Compile Error | / | / | C++23 | 504b | 2024-09-28 12:36:00 | 2024-09-28 12:36:02 |
Judging History
answer
#include<bits/stdc++.h>
using namespace std;
const int maxn=5e5+5;
int n,m,a[maxn],T;
void solve(){
scanf("%d",&n);m=0;
set<int>s;s.clear();
for(int i=1;i<=n;i++){
scanf("%d",&a[i]);
s.insert(a[i]);
auto p=s.upper_bound(a[i]);
if(p==s.end()){
m++;
}
else s.erase(p);
s.insert(a[i]);
}
printf("%d\n",m);
}
signed main(){
adasds
scanf("%d",&T);
while(T--){
solve();
}
}
Details
answer.code: In function ‘int main()’: answer.code:21:5: error: ‘adasds’ was not declared in this scope 21 | adasds | ^~~~~~ answer.code: In function ‘void solve()’: answer.code:6:10: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 6 | scanf("%d",&n);m=0; | ~~~~~^~~~~~~~~ answer.code:9:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 9 | scanf("%d",&a[i]); | ~~~~~^~~~~~~~~~~~