Submission #64046795


Source Code Expand

Copy
#include<cstdio>
#include<algorithm>
using namespace std;
int a[10],c2,c3;
int main() {
for(int i=1;i<=7;i++) scanf("%d",&a[i]);
sort(a+1,a+8);
for(int i=1;i<=5;i++) {
if(a[i]==a[i+1]&&a[i+1]==a[i+2]) c3++;
}
for(int i=1;i<=6;i++) {
if(a[i]==a[i+1]) c2++;
}
if(c3&&c2-c3-1) printf("Yes\n");
else printf("No\n");
return 0;
}
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
#include<cstdio>
#include<algorithm>
using namespace std;
int a[10],c2,c3;
int main() {
	for(int i=1;i<=7;i++) scanf("%d",&a[i]);
	sort(a+1,a+8);
	for(int i=1;i<=5;i++) {
		if(a[i]==a[i+1]&&a[i+1]==a[i+2]) c3++;
	}
	for(int i=1;i<=6;i++) {
		if(a[i]==a[i+1]) c2++;
	}
	if(c3&&c2-c3-1) printf("Yes\n");
	else printf("No\n");
	return 0;
}

Submission Info

Submission Time
Task B - Full House 3
User wanglongye1
Language C++ 17 (gcc 12.2)
Score 250
Code Size 352 Byte
Status AC
Exec Time 0 ms
Memory 1656 KB

Compile Error

Main.cpp: In function ‘int main()’:
Main.cpp:6:36: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
    6 |         for(int i=1;i<=7;i++) scanf("%d",&a[i]);
      |                               ~~~~~^~~~~~~~~~~~

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 250 / 250
Status
AC × 4
AC × 34
Set Name Test Cases
Sample sample_01.txt, sample_02.txt, sample_03.txt, sample_04.txt
All hand_01.txt, hand_02.txt, hand_03.txt, hand_04.txt, sample_01.txt, sample_02.txt, sample_03.txt, sample_04.txt, test_01.txt, test_02.txt, test_03.txt, test_04.txt, test_05.txt, test_06.txt, test_07.txt, test_08.txt, test_09.txt, test_10.txt, test_11.txt, test_12.txt, test_13.txt, test_14.txt, test_15.txt, test_16.txt, test_17.txt, test_18.txt, test_19.txt, test_20.txt, test_21.txt, test_22.txt, test_23.txt, test_24.txt, test_25.txt, test_26.txt
Case Name Status Exec Time Memory
hand_01.txt AC 0 ms 1624 KB
hand_02.txt AC 0 ms 1536 KB
hand_03.txt AC 0 ms 1540 KB
hand_04.txt AC 0 ms 1656 KB
sample_01.txt AC 0 ms 1616 KB
sample_02.txt AC 0 ms 1652 KB
sample_03.txt AC 0 ms 1620 KB
sample_04.txt AC 0 ms 1624 KB
test_01.txt AC 0 ms 1620 KB
test_02.txt AC 0 ms 1608 KB
test_03.txt AC 0 ms 1596 KB
test_04.txt AC 0 ms 1624 KB
test_05.txt AC 0 ms 1564 KB
test_06.txt AC 0 ms 1620 KB
test_07.txt AC 0 ms 1620 KB
test_08.txt AC 0 ms 1608 KB
test_09.txt AC 0 ms 1620 KB
test_10.txt AC 0 ms 1644 KB
test_11.txt AC 0 ms 1648 KB
test_12.txt AC 0 ms 1564 KB
test_13.txt AC 0 ms 1596 KB
test_14.txt AC 0 ms 1560 KB
test_15.txt AC 0 ms 1588 KB
test_16.txt AC 0 ms 1600 KB
test_17.txt AC 0 ms 1616 KB
test_18.txt AC 0 ms 1624 KB
test_19.txt AC 0 ms 1644 KB
test_20.txt AC 0 ms 1580 KB
test_21.txt AC 0 ms 1592 KB
test_22.txt AC 0 ms 1516 KB
test_23.txt AC 0 ms 1532 KB
test_24.txt AC 0 ms 1500 KB
test_25.txt AC 0 ms 1560 KB
test_26.txt AC 0 ms 1564 KB


2025-04-11 (Fri)
14:27:25 +00:00