Submission #575100

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
5751002022-06-09 16:57:55SortingReconstruction Project (JOI22_reconstruction)C++17
42 / 100
5089 ms415800 KiB
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
template<class T> void check_min(T &a, const T &b){ a = (a < b) ? a : b; }
template<class T> void check_max(T &a, const T &b){ a = (a > b) ? a : b; }
#define all(x) (x).begin(), (x).end()
const int N = 500 + 3;
const int M = 1e5 + 3;
const int Q = 1e6 + 3;
const int INF = 1e9;
int n, m, q;
array<ll, 3> e[M];
ll x[Q];
struct DSU{
int sz[N], par[N];
void init(int n){
for(int i = 1; i <= n; ++i)
sz[i] = 1, par[i] = i;
}
int getP(int x){
if(par[x] == x) return x;
return par[x] = getP(par[x]);
}
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

reconstruction.cpp: In function 'std::pair<long long int, int> get_ans(const std::vector<int>&, const std::vector<int>&, ll, int)':
reconstruction.cpp:50:16: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   50 |     while(ptr1 != e1.size() && ptr2 != e2.size()){
      |           ~~~~~^~~~~~~~~~~~
reconstruction.cpp:50:37: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   50 |     while(ptr1 != e1.size() && ptr2 != e2.size()){
      |                                ~~~~~^~~~~~~~~~~~
reconstruction.cpp:59:16: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   59 |     while(ptr1 != e1.size()){
      |           ~~~~~^~~~~~~~~~~~
reconstruction.cpp:63:16: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   63 |     while(ptr2 != e2.size()){
      |           ~~~~~^~~~~~~~~~~~
reconstruction.cpp: In function 'int main()':
reconstruction.cpp:108:17: warning: variable 'cnt' set but not used [-Wunused-but-set-variable]
  108 |     ll ans = 0, cnt = 0, prevx = -INF, next_change;
      |                 ^~~
reconstruction.cpp:108:40: warning: unused variable 'next_change' [-Wunused-variable]
  108 |     ll ans = 0, cnt = 0, prevx = -INF, next_change;
      |                                        ^~~~~~~~~~~
#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...