| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 1356684 | po_rag526 | Construction of Highway (JOI18_construction) | C++20 | 0 ms | 344 KiB |
#include <bits/stdc++.h>
using namespace std;
#define ll long long
int n,m;
const int MOD=1000000009;
int main(){
scanf(" %d %d",&n,&m);
vector<ll> v(n);
vector<int> per(n);
for(int i=0;i<n;i++){
scanf(" %lld",&v[i]);
}
ll ans=0;
iota(per.begin(),per.end(),0);
do{
ll p=-1;
bool con=0;
for(int idx:per){
ll a=v[idx];
if(a>p+m&&p!=-1)con=1;
p=a;
}
if(con)continue;
ans++;
ans%=MOD;
}while(next_permutation( per.begin() , per.end() ));
printf("%lld",ans);
}
컴파일 시 표준 에러 (stderr) 메시지
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
