window.cnblogsConfig = {//可以放多张照片,应该是在每一个博文上面的图片,如果是多张的话,那么就随机换的。 homeTopImg: [ "https://cdn.luogu.com.cn/upload/image_hosting/xkzro04i.png" ], }

AtCoder ABC 333 复盘

A Three Threes

水题一道,直接输出 $n$ 遍 $n$ 即可。

AC Code

B Pentagon

比较简单,只需要比较 $\min(\left\vert S_1-S_2\right\vert,5-\left\vert S_1-S_2\right\vert)$ 和 $\min(\left\vert T_1-T_2\right\vert,5-\left\vert T_1-T_2\right\vert)$ 是否相等即可。

由于某种原因,使用 scanf 和 printf 会 WA,而使用 cin 和 cout 可以 AC。

AC Code

C Repunit Trio

本来这道题可以 $O(\log n+n^3)$ AC 的,但是我由于过度担忧 TLE 而采用了预处理将时间复杂度将为 $O(1)$ [doge]。

AC Code

顺便附上丑陋的打表程序:

#include <cstdio>
#include <climits>
#include <vector>
#include <set>
using namespace std;
using ULL = unsigned long long;

set<ULL> s;

bool check(int x)
{
    for(; x; x /= 10)
        if(x % 10 != 1)
            return false;
    return true;
}

int main()
{
    vector<ULL> a;
    for(ULL i = 1; i <= 112222222233ULL; i = i * 10 + 1)
        a.push_back(i);
    for(const auto &x: a)
        for(const auto &y: a)
            for(const auto &z: a)
                s.insert(x + y + z);
    printf("%llu\n", s.size());
    int cnt = 0;
    for(const auto &p: s)
    {
        if(++cnt > 333)
            break;
        printf("%lld", p);
        if(p >= INT_MAX)
            printf("ULL");
        putchar(',');
    }
    printf("\n%llu", ULLONG_MAX);
    return 0;
}

D Erase Leaves

这道题我尝试从 $1$ 号点出发 BFS 然后对 $1$ 号点到叶子节点的距离求最小值。但是这个思路很快被证伪,于是放弃了。

AC Code(暂缺)

E Takahashi Quest

这道题我做了很久,但是十分遗憾,由于思考不完全,贪心失败,没能 AC,只获得了 $\dfrac{36}{47}$ 的成绩。

本人是这么想的:(未完待续)

$\dfrac{36}{47}$pts Code

posted @ 2023-12-16 22:05  TigerTanWQY  阅读(74)  评论(0)    收藏  举报  来源