結果

問題 No.33 アメーバがたくさん
ユーザー h_nosonh_noson
提出日時 2016-03-25 00:50:02
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 611 bytes
コンパイル時間 675 ms
コンパイル使用メモリ 60,680 KB
実行使用メモリ 4,372 KB
最終ジャッジ日時 2023-10-24 20:16:21
合計ジャッジ時間 1,543 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,348 KB
testcase_01 AC 1 ms
4,348 KB
testcase_02 AC 1 ms
4,348 KB
testcase_03 AC 1 ms
4,348 KB
testcase_04 WA -
testcase_05 WA -
testcase_06 RE -
testcase_07 WA -
testcase_08 WA -
testcase_09 RE -
testcase_10 AC 1 ms
4,348 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:16:12: warning: ‘i’ is used uninitialized [-Wuninitialized]
   16 |     int x[i];
      |            ^

ソースコード

diff #

#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;

#define RREP(i,s,e) for (i = s; i >= e; i--)
#define rrep(i,n) RREP(i,n,0)
#define REP(i,s,e) for (i = s; i < e; i++)
#define rep(i,n) REP(i,0,n)
#define INF 100000000

typedef long long ll;

int main() {
    int i, j, n, d, t;
    int x[i];
    ll ans;
    cin >> n >> d >> t;
    rep (i,n) cin >> x[i];
    ans = n * (2*t+1);
    rep (i,n) rep (j,i) {
        int diff = abs(x[i]-x[j]);
        if (diff%d == 0 && diff/d <= 2*t)
            ans -= 2*(t - diff/d/2) + 1 - diff/d%2;
    }
    cout << ans << endl;
    return 0;
}
0