Submission #586346

#TimeUsernameProblemLanguageResultExecution timeMemory
586346krit3379Lightning Rod (NOI18_lightningrod)C++17
4 / 100
1837 ms84624 KiB
#include<bits/stdc++.h> using namespace std; #pragma GCC optimize("O3,unroll-loops") #pragma GCC target("avx2,bmi,bmi2,lzcnt,popcnt") #define N 10000005 int x,y,val; vector<int> s; int main(){ int n,i; scanf("%d",&n); for(i=1;i<=n;i++){ scanf("%d %d",&x,&y); val=x-y; auto it=lower_bound(s.begin(),s.end(),val); if(it==s.end())s.push_back(val); else *it=val; } printf("%d",s.size()); return 0; }

Compilation message (stderr)

lightningrod.cpp: In function 'int main()':
lightningrod.cpp:20:14: warning: format '%d' expects argument of type 'int', but argument 2 has type 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wformat=]
   20 |     printf("%d",s.size());
      |             ~^  ~~~~~~~~
      |              |        |
      |              int      std::vector<int>::size_type {aka long unsigned int}
      |             %ld
lightningrod.cpp:12:10: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   12 |     scanf("%d",&n);
      |     ~~~~~^~~~~~~~~
lightningrod.cpp:14:14: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   14 |         scanf("%d %d",&x,&y);
      |         ~~~~~^~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...