CodeVS 1019 集合论与图论 【乱搞】

tonyfang posted @ 2015年9月17日 19:42 in codevs with tags c++ OI , 618 阅读

数据水有什么好说的。

理论复杂度$O(Tn^3)$然而很玄学的过了。

 

# include <stdio.h>
# include <string.h>
using namespace std;
bool g[1010][1010];
int main() {
	int LBW;
	scanf("%d",&LBW);
	while(LBW--) {
		memset(g,0,sizeof(g));
		int n,m;
		scanf("%d%d",&n,&m);
		for (int i=1;i<=m;++i) {
			int x,y;
			scanf("%d%d",&x,&y);
			g[x][y]=1;
		}
		bool f=1;
		for (int i=1;i<=n;++i)
			for (int j=1;j<=n;++j)
				if (g[i][j])
					for (int k=1;k<=n;++k)
						if(g[j][k])
							if(!g[i][k]) {
								f=0;
								i=n+1,j=n+1,k=n+1;
							}
		if(f) printf("Yes\n");
		else printf("No\n");							
	}
}
bdpscresult2018.com 说:
2023年4月16日 22:06

The DPE has successfully conducted the class 5th grade PSC and Ebtedayee Examination tests from 17th to 24th November under all education boards of Dhaka, Chittagong, Comilla, Rajshahi, Sylhet, Barisal, Jessore, Dinajpur and Madrasah Board, and the DPE Grade-5 exams are successfully bdpscresult2018.com conducted at all 7,194 centers across the country.According to the reports, there are 30 lacks or more students are participated and appeared to the PSC STD-5 Terminal Exam 2022.


登录 *


loading captcha image...
(输入验证码)
or Ctrl+Enter