Submission #62770477
Source Code Expand
Copy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
#include <bits/stdc++.h>
using namespace std;
int n, m, ans;
set<pair<int, int>> c;
int main() {
scanf ("%d%d", &n, &m);
ans = 0;
for (int i = 1; i <= m; ++i) {
int u, v;
scanf ("%d%d", &u, &v);
if (u > v) {
swap (u, v);
}
if (c.find (make_pair (u, v)) != c.end ()) {
++ans;
} else {
if (u == v) {
++ans;
} else {
c.insert (make_pair (u, v));
}
}
}
printf ("%d\n", ans);
return 0;
}
Submission Info
Submission Time
2025-02-15 12:11:01
Task
C - Make it Simple
User
HappyDavid3367
Language
C++ 20 (gcc 12.2)
Score
300
Code Size
450 Byte
Status
AC
Exec Time
485 ms
Memory
27256 KB
Compile Error
Main.cpp: In function ‘int main()’:
Main.cpp:6:15: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
6 | scanf ("%d%d", &n, &m);
| ~~~~~~^~~~~~~~~~~~~~~~
Main.cpp:10:23: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
10 | scanf ("%d%d", &u, &v);
| ~~~~~~^~~~~~~~~~~~~~~~
Judge Result
Set Name
Sample
All
Score / Max Score
0 / 0
300 / 300
Status
Set Name
Test Cases
Sample
00_sample_00.txt, 00_sample_01.txt, 00_sample_02.txt
All
00_sample_00.txt, 00_sample_01.txt, 00_sample_02.txt, 01_n_small_00.txt, 01_n_small_01.txt, 01_n_small_02.txt, 01_n_small_03.txt, 02_random_00.txt, 02_random_01.txt, 02_random_02.txt, 02_random_03.txt, 02_random_04.txt, 02_random_05.txt, 02_random_06.txt, 02_random_07.txt, 03_corner_00.txt, 03_corner_01.txt, 03_corner_02.txt, 03_corner_03.txt
Case Name
Status
Exec Time
Memory
00_sample_00.txt
AC
2 ms
3748 KB
00_sample_01.txt
AC
1 ms
3884 KB
00_sample_02.txt
AC
1 ms
3884 KB
01_n_small_00.txt
AC
52 ms
3692 KB
01_n_small_01.txt
AC
43 ms
3684 KB
01_n_small_02.txt
AC
66 ms
3712 KB
01_n_small_03.txt
AC
43 ms
3648 KB
02_random_00.txt
AC
226 ms
17672 KB
02_random_01.txt
AC
238 ms
17420 KB
02_random_02.txt
AC
469 ms
27024 KB
02_random_03.txt
AC
485 ms
27124 KB
02_random_04.txt
AC
384 ms
23816 KB
02_random_05.txt
AC
243 ms
17556 KB
02_random_06.txt
AC
470 ms
27204 KB
02_random_07.txt
AC
480 ms
27256 KB
03_corner_00.txt
AC
250 ms
15536 KB
03_corner_01.txt
AC
303 ms
15600 KB
03_corner_02.txt
AC
93 ms
3996 KB
03_corner_03.txt
AC
64 ms
3692 KB