Submission #930274

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
9302742024-02-19 08:56:26boris_mihovEvent Hopping 2 (JOI21_event2)C++17
1 / 100
3051 ms5340 KiB
#include <algorithm>
#include <iostream>
#include <numeric>
#include <cassert>
#include <cstring>
#include <vector>
#include <queue>
#include <stack>
#include <set>
typedef long long llong;
const int MAXN = 100000 + 10;
const int INF = 2e9;
int n, k;
int l[MAXN];
int r[MAXN];
int perm[MAXN];
std::vector <int> sol;
std::vector <int> ans;
bool intersecting(int x, int y)
{
return std::max(l[x], l[y]) < std::min(r[x], r[y]);
}
bool canAdd(int idx)
{
int cntLeft = sol.size();
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

event2.cpp: In function 'bool canAdd(int)':
event2.cpp:47:37: warning: comparison of integer expressions of different signedness: 'std::vector<int>::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
   47 |     return cntLeft + ans.size() + 1 >= k;
      |            ~~~~~~~~~~~~~~~~~~~~~~~~~^~~~
event2.cpp: In function 'void removeIntersecting(int)':
event2.cpp:53:9: warning: unused variable 'cntLeft' [-Wunused-variable]
   53 |     int cntLeft = sol.size();
      |         ^~~~~~~
event2.cpp: In function 'void solve()':
event2.cpp:83:20: warning: comparison of integer expressions of different signedness: 'std::vector<int>::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
   83 |     if (sol.size() < k)
      |         ~~~~~~~~~~~^~~
event2.cpp:89:43: warning: comparison of integer expressions of different signedness: 'std::vector<int>::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
   89 |     for (int i = 1 ; i <= n && ans.size() < k ; ++i)
      |                                ~~~~~~~~~~~^~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...