結果
| 問題 |
No.794 チーム戦 (2)
|
| コンテスト | |
| ユーザー |
pockyny
|
| 提出日時 | 2019-03-16 06:34:18 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 470 bytes |
| コンパイル時間 | 638 ms |
| コンパイル使用メモリ | 69,708 KB |
| 実行使用メモリ | 6,948 KB |
| 最終ジャッジ日時 | 2024-07-01 22:21:23 |
| 合計ジャッジ時間 | 4,140 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 15 WA * 17 |
ソースコード
#include <iostream>
#include <algorithm>
using namespace std;
typedef long long ll;
ll a[200010],b[200010],ans = 1,mod = 10000000007;
int main(){
int i,n,k;
cin >> n >> k;
for(i=0;i<n;i++){
cin >> a[i];
}
sort(a,a + n);
int j = -1;
for(i=n-1;i>=0;i--){
while(a[j+1]+a[i]<=k && j+1<n) j++;
b[i] = min(i - 1,j) + 1;
}
j = 0;
for(i=n-1;i>=n/2;i--){
if(b[i] - j<=0){
ans = 0;
break;
}
(ans *= (b[i] - j)) %= mod;
j++;
}
cout << ans << endl;
}
pockyny