我都开__int128了怎么还是80分?

P3958 [NOIP2017 提高组] 奶酪

@[szhl0803](/user/457002) 是什么结果。?
by Google_chrome @ 2022-09-11 12:58:10


@[szhl0803](/user/457002) 可以`#define int long long`
by Google_chrome @ 2022-09-11 13:00:43


试试这个代码你就知道了 ```C++ #include<bits/stdc++.h> using namespace std; int main(void) { printf("int8:%lld\n",(numeric_limits<__int8>::max)()); printf("int16:%lld\n",(numeric_limits<__int16>::max)()); printf("int32:%lld\n",(numeric_limits<__int32>::max)()); printf("int64:%lld\n",(numeric_limits<__int64>::max)()); printf("int128:%lld\n",(numeric_limits<__int128_t>::max)()); printf("uint128:%lld\n",(numeric_limits<__uint128_t>::max)()); } ```
by 凤凰工作室 @ 2022-09-11 13:24:25


```cpp #include <bits/stdc++.h> #include <vector> using namespace std; #define int unsigned long long typedef __int128 ll; int n,h,r; const int N=1005; struct node { ll x,y,z; }p[1005]; vector<int>to[N]; bool nl[N];//与上表面相交 bool ml[N];//与下表面相交 bool vis[N],flag; ll check(int a,int b,int r)//就是这里 { ll disq=(p[a].x-p[b].x)*(p[a].x-p[b].x)+(p[a].y-p[b].y)*(p[a].y-p[b].y) +(p[a].z-p[b].z)*(p[a].z-p[b].z); r*=2; if(disq<=r*r)return 1; else return 0; } void input() { memset(nl,0,sizeof nl); memset(ml,0,sizeof ml); memset(vis,0,sizeof vis); flag=0; for(int i=0;i<N;i++)to[i].clear(); scanf("%d%d%d",&n,&h,&r); for(int i=1;i<=n;i++) { scanf("%d%d%d",&p[i].x,&p[i].y,&p[i].z); if(p[i].z+r>=h)nl[i]=1; if(p[i].z-r<=0)ml[i]=1; } for(int i=1;i<=n;i++) { for(int j=1;j<=n;j++) { if(i!=j&&check(i,j,r)) { to[i].push_back(j); } } } } void dfs(int u) { if(ml[u])return void(flag=1); vis[u]=1; for(int v:to[u]) { if(!vis[v]) dfs(v); } } void work() { input(); for(int i=1;i<=n;i++) if(!flag&&nl[i])dfs(i); printf(flag?"Yes\n":"No\n"); } signed main() { int t;cin>>t; while(t--) { work(); } } ``` @[szhl0803](/user/457002) 我把 ```cpp #ifndef ONLINE_JUDGE freopen("1.in","r",stdin); #endif ``` 删了,然后给你加上了 ```cpp #define int unsigned long long ``` 加了上面这句话一定要记得把int main改成signed main,否则有可能报错 ```cpp signed main() { int t;cin>>t; while(t--) { work(); } } ``` 现在你看看能不能AC
by Vanishing_Stars @ 2022-09-11 13:24:26


@[szhl0803](/user/457002) 如果可以AC,求互关,一起进步!
by Vanishing_Stars @ 2022-09-11 13:25:34


@[CODE_SUPERVISOR](/user/786586) 谢谢,AC了。
by szhl0803 @ 2022-09-11 15:34:50


|