Submission #35491730
Source Code Expand
Copy
#include<bits/stdc++.h>using namespace std;#define int long long#define endl '\n'bool f[105][105];int a[105];signed main(){ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);memset(f, false, sizeof(f));int n, m;cin >> n >> m;while (m--){int k;cin >> k;for (int i = 1; i <= k; i++)cin >> a[i];for (int i = 1; i <= k; i++)
#include<bits/stdc++.h> using namespace std; #define int long long #define endl '\n' bool f[105][105]; int a[105]; signed main() { ios::sync_with_stdio(false); cin.tie(0); cout.tie(0); memset(f, false, sizeof(f)); int n, m; cin >> n >> m; while (m--) { int k; cin >> k; for (int i = 1; i <= k; i++)cin >> a[i]; for (int i = 1; i <= k; i++) { for (int j = i; j <= k; j++) { f[a[i]][a[j]] = f[a[j]][a[i]] = true; } } } for (int i = 1; i <= n; i++) { for (int j = 1; j <= n; j++) { //cout << f[i][j] << " "; if (!f[i][j]) { cout << "No"; return 0; } } //cout << endl; } cout << "Yes"; return 0; }
Submission Info
Submission Time | |
---|---|
Task | B - Everyone is Friends |
User | sjh |
Language | C++ (GCC 9.2.1) |
Score | 200 |
Code Size | 902 Byte |
Status | AC |
Exec Time | 8 ms |
Memory | 3564 KB |
Judge Result
Set Name | Sample | All | ||||
---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 200 / 200 | ||||
Status |
|
|
Set Name | Test Cases |
---|---|
Sample | 00_sample_01.txt, 00_sample_02.txt |
All | 00_sample_01.txt, 00_sample_02.txt, 01_test_01.txt, 01_test_02.txt, 01_test_03.txt, 01_test_04.txt, 01_test_05.txt, 01_test_06.txt, 01_test_07.txt, 01_test_08.txt, 01_test_09.txt, 01_test_10.txt, 01_test_11.txt, 01_test_12.txt, 01_test_13.txt, 01_test_14.txt, 01_test_15.txt, 01_test_16.txt, 01_test_17.txt, 01_test_18.txt, 02_handmade_01.txt |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
00_sample_01.txt | AC | 8 ms | 3500 KB |
00_sample_02.txt | AC | 2 ms | 3488 KB |
01_test_01.txt | AC | 2 ms | 3488 KB |
01_test_02.txt | AC | 2 ms | 3440 KB |
01_test_03.txt | AC | 8 ms | 3564 KB |
01_test_04.txt | AC | 2 ms | 3436 KB |
01_test_05.txt | AC | 4 ms | 3444 KB |
01_test_06.txt | AC | 6 ms | 3416 KB |
01_test_07.txt | AC | 4 ms | 3492 KB |
01_test_08.txt | AC | 2 ms | 3460 KB |
01_test_09.txt | AC | 4 ms | 3556 KB |
01_test_10.txt | AC | 3 ms | 3364 KB |
01_test_11.txt | AC | 3 ms | 3444 KB |
01_test_12.txt | AC | 1 ms | 3536 KB |
01_test_13.txt | AC | 3 ms | 3460 KB |
01_test_14.txt | AC | 2 ms | 3504 KB |
01_test_15.txt | AC | 3 ms | 3500 KB |
01_test_16.txt | AC | 2 ms | 3416 KB |
01_test_17.txt | AC | 2 ms | 3504 KB |
01_test_18.txt | AC | 2 ms | 3500 KB |
02_handmade_01.txt | AC | 3 ms | 3440 KB |