Submission #292064

#TimeUsernameProblemLanguageResultExecution timeMemory
292064mat_vGondola (IOI14_gondola)C++14
10 / 100
22 ms1404 KiB
#include "gondola.h" #include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> #include <ext/rope> #define ff(i,a,b) for(int (i) = (a); (i) <= (b); ++(i)) #define fb(i,a,b) for(int (i) = (a); (i) >= (b); --(i)) #define mod 998244353 #define xx first #define yy second #define all(a) (a).begin(), (a).end() #define pb push_back #define ll long long #define pii pair<int,int> using namespace std; using namespace __gnu_pbds; typedef tree<int, null_type, less<int>,rb_tree_tag, tree_order_statistics_node_update> ordered_set;/// find_by_order(x)(x+1th) , order_of_key() (strictly less) mt19937 rnd(chrono::steady_clock::now().time_since_epoch().count()); int valid(int n, int inputSeq[]) { vector<int> poz; ff(i,0,n - 1){ if(inputSeq[i] <= n)poz.pb(inputSeq[i]); } sort(inputSeq, inputSeq + n); ff(i,0,n - 2)if(inputSeq[i] == inputSeq[i + 1])return 0; int m = poz.size(); if(m == 0)return 1; int idx = 0; ff(i,0,m - 1){ if(poz[i] < poz[idx])idx = i; } ff(i,idx,idx + m - 2){ if(poz[i%m] >= poz[(i + 1)%m])return 0; } return 1; } //---------------------- int replacement(int n, int gondolaSeq[], int replacementSeq[]) { return -2; } //---------------------- int countReplacement(int n, int inputSeq[]) { return -3; }

Compilation message (stderr)

gondola.cpp: In function 'int valid(int, int*)':
gondola.cpp:7:27: warning: unnecessary parentheses in declaration of 'i' [-Wparentheses]
    7 | #define ff(i,a,b) for(int (i) = (a); (i) <= (b); ++(i))
      |                           ^
gondola.cpp:27:5: note: in expansion of macro 'ff'
   27 |     ff(i,0,n - 1){
      |     ^~
gondola.cpp:7:27: warning: unnecessary parentheses in declaration of 'i' [-Wparentheses]
    7 | #define ff(i,a,b) for(int (i) = (a); (i) <= (b); ++(i))
      |                           ^
gondola.cpp:31:5: note: in expansion of macro 'ff'
   31 |     ff(i,0,n - 2)if(inputSeq[i] == inputSeq[i + 1])return 0;
      |     ^~
gondola.cpp:7:27: warning: unnecessary parentheses in declaration of 'i' [-Wparentheses]
    7 | #define ff(i,a,b) for(int (i) = (a); (i) <= (b); ++(i))
      |                           ^
gondola.cpp:35:5: note: in expansion of macro 'ff'
   35 |     ff(i,0,m - 1){
      |     ^~
gondola.cpp:7:27: warning: unnecessary parentheses in declaration of 'i' [-Wparentheses]
    7 | #define ff(i,a,b) for(int (i) = (a); (i) <= (b); ++(i))
      |                           ^
gondola.cpp:38:5: note: in expansion of macro 'ff'
   38 |     ff(i,idx,idx + m - 2){
      |     ^~
#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...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...