제출 #671609

#제출 시각아이디문제언어결과실행 시간메모리
671609vjudge1A Huge Tower (CEOI10_tower)C++11
100 / 100
137 ms11192 KiB
#include<iostream> #include<algorithm> using namespace std; const long long maxn = 1000005; const long long modv = (long long) 1e9+9; long long n,d,ans = 1,arr[maxn]; int main () { scanf("%lld%lld",&n,&d); for(long long i = 0; i < n; i++) { scanf("%lld",&arr[i]); } sort(arr,arr+n); for(long long i = 0; i < n; i++) { long long prevP = lower_bound(arr,arr+n,arr[i]-d)-arr; ans = (ans*(i-prevP+1)%modv); } printf("%lld\n",ans); return 0; }

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

tower.cpp: In function 'int main()':
tower.cpp:8:10: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
    8 |     scanf("%lld%lld",&n,&d);
      |     ~~~~~^~~~~~~~~~~~~~~~~~
tower.cpp:10:14: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   10 |         scanf("%lld",&arr[i]);
      |         ~~~~~^~~~~~~~~~~~~~~~
#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...