Submission #782734

#TimeUsernameProblemLanguageResultExecution timeMemory
782734RecursiveCoAdvertisement 2 (JOI23_ho_t2)C++14
59 / 100
2064 ms7884 KiB
// CF template, version 3.0 #include <bits/stdc++.h> using namespace std; #define improvePerformance ios_base::sync_with_stdio(false); cin.tie(0) #define getTest int t; cin >> t #define eachTest for (int _var=0;_var<t;_var++) #define get(name) int (name); cin >> (name) #define out(o) cout << (o) #define getList(cnt, name) vector<int> (name); for (int _=0;_<(cnt);_++) { get(a); (name).push_back(a); } #define sortl(name) sort((name).begin(), (name).end()) #define rev(name) reverse((name).begin(), (name).end()) #define forto(name, var) for (int (var) = 0; (var) < (name); (var)++) #define decision(b) if (b){out("YES");}else{out("NO");} #define int long long signed main() { improvePerformance; //getTest; //eachTest { get(n); vector<pair<int, int>> people; forto(n, i) { get(x); get(e); people.push_back({e, x}); } int ans = 0; sortl(people); rev(people); vector<pair<int, int>> done; forto(n, i) { bool found = false; int e = people[i].first; int x = people[i].second; forto(done.size(), j) { int ep = done[j].first; int xp = done[j].second; if (xp >= x) { if (ep - xp >= e - x) { found = true; break; } } else { if (ep + xp >= e + x) { found = true; break; } } } if (!found) ans++, done.push_back(people[i]); } out(ans); //} }

Compilation message (stderr)

Main.cpp: In function 'int main()':
Main.cpp:10:23: warning: unnecessary parentheses in declaration of 'n' [-Wparentheses]
   10 | #define get(name) int (name); cin >> (name)
      |                       ^
Main.cpp:25:9: note: in expansion of macro 'get'
   25 |         get(n);
      |         ^~~
Main.cpp:15:35: warning: unnecessary parentheses in declaration of 'i' [-Wparentheses]
   15 | #define forto(name, var) for (int (var) = 0; (var) < (name); (var)++)
      |                                   ^
Main.cpp:27:9: note: in expansion of macro 'forto'
   27 |         forto(n, i) {
      |         ^~~~~
Main.cpp:10:23: warning: unnecessary parentheses in declaration of 'x' [-Wparentheses]
   10 | #define get(name) int (name); cin >> (name)
      |                       ^
Main.cpp:28:13: note: in expansion of macro 'get'
   28 |             get(x);
      |             ^~~
Main.cpp:10:23: warning: unnecessary parentheses in declaration of 'e' [-Wparentheses]
   10 | #define get(name) int (name); cin >> (name)
      |                       ^
Main.cpp:29:13: note: in expansion of macro 'get'
   29 |             get(e);
      |             ^~~
Main.cpp:15:35: warning: unnecessary parentheses in declaration of 'i' [-Wparentheses]
   15 | #define forto(name, var) for (int (var) = 0; (var) < (name); (var)++)
      |                                   ^
Main.cpp:36:9: note: in expansion of macro 'forto'
   36 |         forto(n, i) {
      |         ^~~~~
Main.cpp:15:35: warning: unnecessary parentheses in declaration of 'j' [-Wparentheses]
   15 | #define forto(name, var) for (int (var) = 0; (var) < (name); (var)++)
      |                                   ^
Main.cpp:40:13: note: in expansion of macro 'forto'
   40 |             forto(done.size(), j) {
      |             ^~~~~
Main.cpp:15:52: warning: comparison of integer expressions of different signedness: 'long long int' and 'std::vector<std::pair<long long int, long long int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   15 | #define forto(name, var) for (int (var) = 0; (var) < (name); (var)++)
      |                                              ~~~~~~^~~~~~~~
Main.cpp:40:13: note: in expansion of macro 'forto'
   40 |             forto(done.size(), j) {
      |             ^~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...