标签:i++ void ram 今天 graph targe gre -- ble
裸的结论题。百度 Ramsey定理。刚学过之后以为在哪也不会用到23333333333,没想到今天网络赛居然出了。顺利在题面更改前A掉~~~(我觉得要不是我开机慢+编译慢+中间暂时死机,我还能再早几分钟过掉它
#include<bits/stdc++.h> using namespace std; int g[8][8]; int n; void solve() { for(int i=1; i<=n; i++) for(int j=i+1; j<=n; j++) for(int k=j+1; k<=n; k++) { if(g[i][j]==g[i][k]&&g[i][j]==g[j][k]) { puts("Bad Team!"); return ; } } puts("Great Team!"); } int main() { int T; scanf("%d",&T); while(T--) { memset(g,0,sizeof(g)); scanf("%d",&n); if(n>=6) { int t; for(int i=0; i<(n-1)*n/2; i++) scanf("%d",&t); puts("Bad Team!"); continue; } for(int i=1; i<=n; i++) for(int j=i+1; j<=n; j++) { int t; scanf("%d",&t); g[i][j]=g[j][i]=t; } solve(); } }
hdu 6152 : Friend-Graph (2017 CCPC网络赛 1003)
标签:i++ void ram 今天 graph targe gre -- ble
原文地址:http://www.cnblogs.com/Just--Do--It/p/7397600.html