QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#108732#5522. F*** 3-Colorable GraphschenshiWA 4ms71780kbC++424b2023-05-26 14:58:292023-05-26 14:58:31

Judging History

你现在查看的是最新测评结果

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2023-05-26 14:58:31]
  • 评测
  • 测评结果:WA
  • 用时:4ms
  • 内存:71780kb
  • [2023-05-26 14:58:29]
  • 提交

answer

#include<cstdio>
using namespace std;
const int o=10010;
int n,m,st[o],tp;bool e[o][o],a[o][o];
int main(){
	scanf("%d%d",&n,&m);
	for(int u,v;m--;) scanf("%d%d",&u,&v),e[u][v-n]=1;
	for(int i=1;i<=n;++i){
		tp=0;
		for(int j=1;j<=n;++j) if(e[i][j]) st[++tp]=j;
		for(int j=1;j<tp;++j) for(int k=j+1;k<=tp;++k)
			if(e[st[j]][st[k]]){printf("2");return 0;}else e[st[j]][st[k]]=1;
	}
	printf("3");
	return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 1ms
memory: 3352kb

input:

2 4
1 3
1 4
2 3
2 4

output:

2

result:

ok 1 number(s): "2"

Test #2:

score: 0
Accepted
time: 0ms
memory: 3364kb

input:

3 5
1 4
2 4
2 5
3 5
3 6

output:

3

result:

ok 1 number(s): "3"

Test #3:

score: -100
Wrong Answer
time: 4ms
memory: 71780kb

input:

10000 20000
4570 11730
8803 16440
4257 15381
4455 17636
5256 13543
2172 18421
7735 17847
8537 16010
6175 12263
1079 13410
335 15901
3272 16233
7435 11454
4469 13374
1564 13416
1264 13446
7484 14510
8193 12267
628 15585
1388 11398
5444 19958
2059 18140
8947 13188
6214 17707
7940 12253
6726 11508
1839...

output:

2

result:

wrong answer 1st numbers differ - expected: '3', found: '2'