Hướng dẫn giải của Augmented Spider (Con nhện nâng cao)


Chỉ dùng lời giải này khi không có ý tưởng, và đừng copy-paste code từ lời giải này. Hãy tôn trọng người ra đề và người viết lời giải.
Nộp một lời giải chính thức trước khi tự giải là một hành động có thể bị ban.

Tác giả: PanyoPie

Trong Contest

  • Bạn chỉ cần in ra con nhện là AC nuôn :) Không AC thì do bạn có Skill Issues.

Subtask #1:

Lưu ý: Các subtasks ở đây không phân theo giới hạn của đề bài, mà phân theo phương pháp chấm của judges.

  • Nếu canvas của bạn có dưới ~5~ ký tự thì sẽ nhận Verdict WA.
  • Nếu canvas của bạn có ~5 < x \le 20~ ký tự thì sẽ nhận được ~10\%~ số điểm.

Subtask #2:

  • Nếu canvas của bạn có số phần tử khác nhau đôi một là:
    1. ~\text{differentiation} < 10~: ~30\%~ số điểm;
    2. ~10 \le \text{differentiation} < 20~: ~60\%~ số điểm;
    3. ~20 \le \text{differentiation} < 26~: ~80\%~ số điểm.

Nếu canvas của bạn vượt qua được toàn bộ các subtasks trên thì sẽ nhận được ~100\%~ số điểm.

Judge:

#include <bits/stdc++.h>
#include "testlib.h"
using namespace std;

const int MAX_AXIS_LENGTH = 1000;
const int SAME_CHARACTERS_LIMITATION = 10;

void judge(string result) {
    int result_length = result.length();

    if (0 < result_length && result_length <= 5) {
        quitf(_wa, "you didn't even submit art! garbage doesn't stay here ╰(‵□′)╯");
    } else if (result_length <= 20) {
        quitp(0.1, "trivial, nothing special, at all (>人<;)");
    }

    unordered_set<char> unique_characters(result.begin(), result.end());
    int differentiation = unique_characters.size();

    if (differentiation < 10) {
        quitp(0.3, "looks good, but not magnificent enough (′д` )…彡…彡");
    } else if (differentiation < 20) {
        quitp(0.6, "hmmm, decent ○( ^皿^)っ Hehehe");
    } else if (differentiation < 26) {
        quitp(0.8, "nearly became a masterpiece of art\( ̄︶ ̄*\))");
    }

    quitf(_ok, "wow, i'm impressed, such an incredible piece of art o(* ̄▽ ̄*)ブ");
}

int main(int argc, char* argv[]) {
    registerTestlibCmd(argc, argv);

    vector<string> canvas;
    string canvas_line;
    while (!ouf.eof()) {
        canvas_line = ouf.readLine();
        ensuref(canvas_line.length() <= MAX_AXIS_LENGTH, "Invalid canvas size!");
        canvas.push_back(canvas_line);
    }

    string result;
    for (string line: canvas) result.append(line);

    judge(result);
}

Bình luận

Hãy đọc nội quy trước khi bình luận.


Không có bình luận tại thời điểm này.