Submission #1096587

#TimeUsernameProblemLanguageResultExecution timeMemory
1096587Uniq0rnWalking (NOI12_walking)C++14
25 / 25
1 ms460 KiB
#include <bits/stdc++.h> using namespace std; #define ld long double #define ll long long int #define pi pair<int,int> #define sz(x) (int)x.size() #define all(x) begin(x),end(x) int main() { cin.tie(0)->sync_with_stdio(0); double l;int n; cin >> l >> n; vector<pair<double,double>> a(n); for(auto &[x,y]:a){ cin >>x >> y; } sort(a.rbegin(),a.rend()); vector<double> lis; for(auto [x,y]:a){ double t = x + l/y; auto it = lower_bound(all(lis),t) - lis.begin(); if(it != sz(lis)){ lis[it] = t; } else lis.push_back(t); } cout << sz(lis); return 0; }

Compilation message (stderr)

walking.cpp: In function 'int main()':
walking.cpp:16:15: warning: structured bindings only available with '-std=c++17' or '-std=gnu++17'
   16 |     for(auto &[x,y]:a){
      |               ^
walking.cpp:21:14: warning: structured bindings only available with '-std=c++17' or '-std=gnu++17'
   21 |     for(auto [x,y]:a){
      |              ^
#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...