結果
| 問題 | No.33 アメーバがたくさん |
| コンテスト | |
| ユーザー |
184
|
| 提出日時 | 2014-10-02 23:59:52 |
| 言語 | C++11 (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 1,030 bytes |
| 記録 | |
| コンパイル時間 | 498 ms |
| コンパイル使用メモリ | 98,624 KB |
| 実行使用メモリ | 21,668 KB |
| 最終ジャッジ日時 | 2026-04-11 15:40:27 |
| 合計ジャッジ時間 | 7,381 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge3_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 2 WA * 6 TLE * 1 -- * 2 |
ソースコード
#include <cstdlib>
#include <cstring>
#include <algorithm>
#include <iostream>
#include <map>
#include <vector>
#include <queue>
using namespace std;
/*
正解してたら匿名でも問題投稿ができる(実現度さらにアップ)!!!
*/
int main(){
long long n,d,t;scanf("%I64d%I64d%I64d",&n,&d,&t);
map<long long,int> mp;
for(int i=0;i<n;i++){
long long x;
scanf("%I64d",&x);
mp[x]++;
}
long long next,prev;
map<long long,int>::iterator it;
map<long long,int> nmp;
while(t--){
for(it=mp.begin();it!=mp.end();it++){
next=it->first+d;
prev=it->first-d;
nmp[next]++;
nmp[prev]++;
nmp[it->first]++;
}
map<long long,int> nnmp;
for(it=nmp.begin();it!=nmp.end();it++){
if(it->second==1)nnmp[it->first]=1;
}
mp=nnmp;
}
long long ans=0;
for(it=mp.begin();it!=mp.end();it++){
if(it->second)ans++;
}
printf("%I64d\n",ans);
return 0;
}
184