結果

問題 No.5003 物理好きクリッカー
ユーザー simansiman
提出日時 2018-12-05 21:21:00
言語 C++11
(gcc 11.4.0)
結果
WA  
(最新)
AC  
(最初)
実行時間 -
コード長 2,070 bytes
コンパイル時間 481 ms
実行使用メモリ 21,996 KB
スコア 353,988
平均クエリ数 10000.00
最終ジャッジ日時 2021-07-19 08:48:36
合計ジャッジ時間 3,865 ms
ジャッジサーバーID
(参考情報)
judge11 / judge10
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 39 ms
21,312 KB
testcase_01 AC 40 ms
21,336 KB
testcase_02 WA -
testcase_03 AC 40 ms
21,288 KB
testcase_04 AC 40 ms
21,504 KB
testcase_05 AC 38 ms
21,960 KB
testcase_06 AC 41 ms
21,840 KB
testcase_07 WA -
testcase_08 AC 40 ms
21,492 KB
testcase_09 AC 35 ms
21,312 KB
testcase_10 WA -
testcase_11 AC 41 ms
21,528 KB
testcase_12 AC 40 ms
21,528 KB
testcase_13 AC 38 ms
21,468 KB
testcase_14 AC 40 ms
21,696 KB
testcase_15 WA -
testcase_16 AC 40 ms
21,840 KB
testcase_17 AC 41 ms
21,840 KB
testcase_18 AC 41 ms
21,492 KB
testcase_19 AC 40 ms
21,492 KB
testcase_20 WA -
testcase_21 AC 40 ms
21,492 KB
testcase_22 AC 40 ms
21,360 KB
testcase_23 WA -
testcase_24 AC 40 ms
21,960 KB
testcase_25 WA -
testcase_26 AC 36 ms
21,840 KB
testcase_27 AC 40 ms
21,864 KB
testcase_28 AC 40 ms
21,828 KB
testcase_29 AC 40 ms
21,312 KB
testcase_30 AC 40 ms
21,840 KB
testcase_31 AC 40 ms
21,492 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <cassert>
#include <iostream>
#include <vector>
#include <string.h>

using namespace std;

const int N = 10000;

const int NOTHING = -1;
const int CLICK = 0;
const int BUY = 1;
const int SELL = 2;
const int REINFORCE = 3;
const int ENHCLICK = 4;

const int HAND = 1;
const int LILY = 2;
const int FACTORY = 3;
const int CASINO = 4;
const int GRIMOIRE = 5;

const int PRODUCTIVITY[6] = {1, 1, 10, 120, 2000, 25000};

int operations[N];

class CookieClicker {
public:

    void init() {
        memset(operations, CLICK, sizeof(operations));
    }

    vector <string> run(string events) {
        init();

        vector <string> answer = createAnswer();
        int score = calcScore();

        // printf("Score = %d\n", score);

        return answer;
    }

    vector <string> createAnswer() {
        vector <string> answer;

        for (int i = 0; i < N; i++) {
            switch (operations[i]) {
                case NOTHING:
                    answer.push_back("nothing");
                    break;
                case CLICK:
                    answer.push_back("click");
                    break;
                case BUY:
                    answer.push_back("buy");
                    break;
                case SELL:
                    break;
                case REINFORCE:
                    break;
                case ENHCLICK:
                    break;
                default:
                    assert(false);
            }
        }

        return answer;
    }

    int calcScore() {
        int score = 0;

        for (int i = 0; i < N; i++) {
            switch (operations[i]) {
                case NOTHING:
                    break;
                case CLICK:
                    score += PRODUCTIVITY[CLICK];
                    break;
            }
        }

        return score;
    }
};

int main() {
    int n;
    string s;
    CookieClicker cc;

    cin >> n;
    cin >> s;

    vector <string> answer = cc.run(s);

    for (int i = 0; i < N; i++) {
        cout << answer[i] << endl;
    }

    return 0;
}
0