제출 #555948

#제출 시각아이디문제언어결과실행 시간메모리
555948blueA Huge Tower (CEOI10_tower)C++17
100 / 100
111 ms8736 KiB
#include <iostream> #include <algorithm> #include <vector> using namespace std; using vi = vector<int>; using ll = long long; const ll mod = 1'000'000'009LL; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); int N, D; cin >> N >> D; vi H(N); for(int i = 0; i < N; i++) cin >> H[i]; sort(H.begin(), H.end()); ll res = 1; int j = 0; int l = 0; for(int r = 0; r < N; r++) { while(H[l] + D < H[r]) l++; res = (res * (r-l+1))%mod; } cout << res << '\n'; }

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

tower.cpp: In function 'int main()':
tower.cpp:27:6: warning: unused variable 'j' [-Wunused-variable]
   27 |  int j = 0;
      |      ^
#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...
#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...