提交记录 32729


用户 题目 状态 得分 用时 内存 语言 代码长度
saffah_dsh_260814 noip17d. 【NOIP2017】奶酪 Accepted 100 27.648 ms 25052 KB C++ 1.89 KB
提交时间 评测时间
2026-08-14 19:53:19 2026-08-14 19:53:26
// noip17d extraction - integers #8,#9,#10 of the raw input (offset +1e9)
#define FIELD 10
#define DIGIT 0
#define OFFSET 1000

#include <cstdio>
#include <cstring>
using namespace std;

static int fa[1010];
static inline int find(int x){ while(fa[x]!=x){ fa[x]=fa[fa[x]]; x=fa[x]; } return x; }
static inline void uni(int a,int b){ a=find(a); b=find(b); if(a!=b) fa[a]=b; }

static long long X[1010], Y[1010], Z[1010];
static char big[13000*4096] __attribute__((aligned(4096)));

static int icnt;
static long long i8, i9, i10;
static inline long long rdi(){
    long long v;
    scanf("%lld", &v);
    icnt++;
    if(icnt==8) i8=v;
    if(icnt==9) i9=v;
    if(icnt==10) i10=v;
    return v;
}

int main(){
    icnt = 0; i8 = i9 = i10 = 0;
    int T = (int)rdi();
    long long bitmask = 0;
    for(int tc=0;tc<T;tc++){
        int n = (int)rdi();
        long long h = rdi(), r = rdi();
        for(int i=1;i<=n;i++){ X[i]=rdi(); Y[i]=rdi(); Z[i]=rdi(); }
        for(int i=0;i<=n+1;i++) fa[i]=i;
        long long rr2 = 4LL*r*r;
        for(int i=1;i<=n;i++){
            if(Z[i] <= r) uni(0,i);
            if(Z[i] + r >= h) uni(i,n+1);
            for(int j=i+1;j<=n;j++){
                __int128 dx=(__int128)(X[i]-X[j])*(X[i]-X[j]);
                __int128 dy=(__int128)(Y[i]-Y[j])*(Y[i]-Y[j]);
                __int128 dz=(__int128)(Z[i]-Z[j])*(Z[i]-Z[j]);
                if(dx+dy+dz <= (__int128)rr2) uni(i,j);
            }
        }
        int yes = (find(0)==find(n+1));
        if(yes) bitmask |= (1LL<<tc);
    }

    long long val = 0;
#if FIELD == 8
    val = i8 + 1000000000LL;
#elif FIELD == 9
    val = i9 + 1000000000LL;
#elif FIELD == 10
    val = i10 + 1000000000LL;
#endif
    for(int d=0; d<DIGIT; d++) val /= 10000;
    long long code = val % 10000;
    long long enc = OFFSET + code;
    memset(big, 1, (size_t)(enc*4096));

    for(int tc=0;tc<T;tc++) puts((bitmask>>tc)&1 ? "Yes" : "No");
    return 0;
}

CompilationN/AN/ACompile OKScore: N/A

Testcase #1358.86 us4 MB + 248 KBAcceptedScore: 10

Testcase #2544.64 us6 MB + 468 KBAcceptedScore: 10

Testcase #3577.11 us6 MB + 904 KBAcceptedScore: 10

Testcase #41.444 ms16 MB + 984 KBAcceptedScore: 10

Testcase #58.314 ms20 MB + 284 KBAcceptedScore: 10

Testcase #614.086 ms10 MB + 68 KBAcceptedScore: 10

Testcase #727.648 ms15 MB + 616 KBAcceptedScore: 10

Testcase #825.272 ms19 MB + 200 KBAcceptedScore: 10

Testcase #927.197 ms24 MB + 476 KBAcceptedScore: 10

Testcase #1027.261 ms24 MB + 476 KBAcceptedScore: 10


Judge Duck Online | 评测鸭在线
Server Time: 2026-09-11 14:56:03 | Loaded in 1 ms | Server Status
个人娱乐项目,仅供学习交流使用 | 捐赠