제출 #292101

#제출 시각아이디문제언어결과실행 시간메모리
292101mat_v곤돌라 (IOI14_gondola)C++14
20 / 100
22 ms1528 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 tmp[100005];

int valid(int n, int inputSeq[])
{
    vector<int> svi;
    ff(i,0,n - 1)svi.pb(inputSeq[i]);
    sort(svi.begin(), svi.end());
    ff(i,0,n - 2)if(svi[i] == svi[i + 1])return 0;

    int gde = -1;
    ff(i,0,n - 1){
        if(inputSeq[i] <= n){
            gde = i;
            break;
        }
    }
    if(gde == -1)return 1;
    ff(i,gde,gde+n-1){
        tmp[i%n] = inputSeq[gde] + i - gde;
        if(tmp[i%n] > n)tmp[i%n] -= n;
    }
    ff(i,0,n - 1){
        if(inputSeq[i] <= n && inputSeq[i] != tmp[i])return 0;
    }
    return 1;
}

//----------------------

int replacement(int n, int gondolaSeq[], int replacementSeq[])
{
  return -2;
}

//----------------------

int countReplacement(int n, int inputSeq[])
{
  return -3;
}

컴파일 시 표준 에러 (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:28:5: note: in expansion of macro 'ff'
   28 |     ff(i,0,n - 1)svi.pb(inputSeq[i]);
      |     ^~
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:30:5: note: in expansion of macro 'ff'
   30 |     ff(i,0,n - 2)if(svi[i] == svi[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:33:5: note: in expansion of macro 'ff'
   33 |     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:40:5: note: in expansion of macro 'ff'
   40 |     ff(i,gde,gde+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:44:5: note: in expansion of macro 'ff'
   44 |     ff(i,0,n - 1){
      |     ^~
#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...