結果

問題 No.33 アメーバがたくさん
ユーザー itezpaceitezpace
提出日時 2016-08-30 08:34:46
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 554 bytes
コンパイル時間 500 ms
コンパイル使用メモリ 61,248 KB
実行使用メモリ 4,348 KB
最終ジャッジ日時 2023-10-24 20:18:54
合計ジャッジ時間 1,045 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,348 KB
testcase_01 AC 2 ms
4,348 KB
testcase_02 AC 1 ms
4,348 KB
testcase_03 AC 2 ms
4,348 KB
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 AC 1 ms
4,348 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <vector>
using namespace std;
typedef long long ll;
int main(){
  ll n,d,t,x;
  cin>>n>>d>>t;
  vector<ll> v;
  for(int i=0; i<n; ++i){
    cin>>x;
    v.push_back(x);
  }
  ll a=2*(n+2*t*n);
  for(int i=0; i<v.size(); ++i){
    for(int j=0; j<v.size(); ++j){
      if(i!=j){
        ll b=v[i]-v[j];
        ll c=b%d;
        if(c==0){
          ll e=abs(b);
          ll f=e/d-1;
          ll g=2+t*2+f;
          ll h=2+2*t*2;
          ll y=h-g;
          a-=y;
        }
      }
    }
  }
  cout<<a/2<<endl;
  return 0;
}
0