QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#595104#5147. Stack Sortlouhao088#Compile Error//C++23504b2024-09-28 12:36:002024-09-28 12:36:02

Judging History

你现在查看的是最新测评结果

  • [2024-09-28 12:36:02]
  • 评测
  • [2024-09-28 12:36:00]
  • 提交

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]);
      |         ~~~~~^~~~~~~~~~~~