제출 #422392

#제출 시각아이디문제언어결과실행 시간메모리
422392Andyvanh1곤돌라 (IOI14_gondola)C++14
10 / 100
17 ms992 KiB
#include <bits/stdc++.h> #include "gondola.h" using namespace std; #define vt vector #define pb push_back #define all(x) (x).begin(),(x).end() #define rep(i,x) for(int (i) = 0; (i) < (x); (i)++ ) typedef long long ll; typedef long double ld; typedef vt<int> vi; typedef pair<int,int> pii; int x[100005]; int valid(int n, int inputSeq[]){ int at = -1; rep(i,n)x[i] = inputSeq[i]; sort(x,x+n); for(int i = 1; i < n; i++){ if(x[i]==x[i-1])return 0; } for(int i = 0; i < n; i++){ if(inputSeq[i]>=n){ inputSeq[i] = -1; }else{ at = i; } } if(at==-1)return 1; bool bol = true; for(int i = at; i < n; i++){ if(inputSeq[i]!=-1&&inputSeq[i]!=(inputSeq[at]+i-at)%n){ return 0; } } for(int i = 0; i < at; i++){ if(inputSeq[i]!=-1&&inputSeq[i]!=(inputSeq[at]-at+i+n)%n){ return 0; } } return 1; } int countReplacement(int n, int inputSeq[]){ return 0;} int replacement(int n, int gondolaSeq[], int replacementSeq[]){ return 0; }

컴파일 시 표준 에러 (stderr) 메시지

gondola.cpp: In function 'int valid(int, int*)':
gondola.cpp:8:26: warning: unnecessary parentheses in declaration of 'i' [-Wparentheses]
    8 | #define rep(i,x) for(int (i) = 0; (i) < (x); (i)++ )
      |                          ^
gondola.cpp:19:5: note: in expansion of macro 'rep'
   19 |     rep(i,n)x[i] = inputSeq[i];
      |     ^~~
gondola.cpp:32:10: warning: unused variable 'bol' [-Wunused-variable]
   32 |     bool bol = true;
      |          ^~~
#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...