結果
| 問題 |
No.33 アメーバがたくさん
|
| コンテスト | |
| ユーザー |
srjywrdnprkt
|
| 提出日時 | 2022-12-19 22:49:22 |
| 言語 | C++17(clang) (17.0.6 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 750 bytes |
| コンパイル時間 | 1,567 ms |
| コンパイル使用メモリ | 148,576 KB |
| 実行使用メモリ | 6,820 KB |
| 最終ジャッジ日時 | 2024-11-18 01:26:26 |
| 合計ジャッジ時間 | 2,144 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 7 WA * 4 |
ソースコード
#include <iostream>
#include <vector>
#include <cmath>
#include <map>
#include <set>
#include <iomanip>
#include <queue>
#include <algorithm>
#include <numeric>
#include <deque>
#include <complex>
using namespace std;
int main(){
long long N, D, T, X, ans=0;
cin >> N >> D >> T;
map<long long, vector<long long>> mp;
for (int i=0; i<N; i++){
cin >> X;
mp[(X%D+D)%D].push_back(X);
}
for (auto &[x, y] : mp) sort(y.begin(), y.end());
for (auto [x, y] : mp){
ans += T * 2 + y.size();
if (y.size() == 1) continue;
for (int i=0; i<N-1; i++){
long long Z = (y[i+1] - y[i])/D -1;
ans += min(Z, T * 2);
}
}
cout << ans << endl;
return 0;
}
srjywrdnprkt