Submission #830036

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
8300362023-08-18 17:48:50rembocoderAliens (IOI16_aliens)C++17
25 / 100
1 ms468 KiB
#include "aliens.h"
#include <bits/stdc++.h>
using namespace std;
bool cmp(const pair<int, int>& a, const pair<int, int>& b) {
if (a.first != b.first) {
return a.first < b.first;
}
return a.second > b.second;
}
const long long inf = 2e18;
long long div_up(long long a, long long b) {
if (a < 0) {
return a / b;
}
return (a + b - 1) / b;
}
long long take_photos(int n, int m, int k, vector<int> x, vector<int> y) {
for (int i = 0; i < n; i++) {
if (x[i] > y[i]) {
swap(x[i], y[i]);
}
}
vector<pair<int, int>> pairs;
for (int i = 0; i < n; i++) {
pairs.push_back({x[i], y[i]});
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

aliens.cpp: In lambda function:
aliens.cpp:65:32: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::pair<long long int, int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   65 |             while (ch_from + 1 < ch.size() && ch[ch_from + 1].first <= r[i]) {
      |                    ~~~~~~~~~~~~^~~~~~~~~~~
aliens.cpp:78:62: warning: suggest parentheses around '&&' within '||' [-Wparentheses]
   78 |                     a[last] - b[last] * x == a[i] - b[i] * x && dp[last].second < dp[i].second) {
aliens.cpp:89:25: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::pair<long long int, int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   89 |             if (ch_from >= ch.size()) {
      |                 ~~~~~~~~^~~~~~~~~~~~
#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...