Submission #41732875
Source Code Expand
// #cheat_when_we_are_young
// #cheatkhitacontre #khionhatoicheat
// #thaycuckythatvong
#include<bits/stdc++.h>
using namespace std;
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0)
//#pragma GCC optimize("O3,unroll-loops")
//#pragma GCC target("avx2,bmi,bmi2,lzcnt,popcnt")
//#pragma GCC target("tune=native")
//#define int long long
signed main() {
IOS;
int n, m;
cin >> n >> m;
map<pair<int,int>, bool> Map;
int a[n];
for (int j = 0; j < m; ++j) {
for (int i = 0; i < n; ++i) cin >> a[i];
for (int i = 1; i < n; ++i) {
Map[{a[i-1],a[i]}] = 1;
Map[{a[i],a[i-1]}] = 1;
}
}
cout << (n*(n-1) - Map.size()) / 2;
}
Submission Info
| Submission Time | |
|---|---|
| Task | B - Discord |
| User | cheatkhitacontre |
| Language | C++ (GCC 9.2.1) |
| Score | 200 |
| Code Size | 705 Byte |
| Status | AC |
| Exec Time | 8 ms |
| Memory | 3544 KiB |
Judge Result
| Set Name | Sample | All | ||||
|---|---|---|---|---|---|---|
| Score / Max Score | 0 / 0 | 200 / 200 | ||||
| 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_small_00.txt, 01_small_01.txt, 01_small_02.txt, 01_small_03.txt, 01_small_04.txt, 02_rnd_00.txt, 02_rnd_01.txt, 02_rnd_02.txt, 03_same_00.txt, 03_same_01.txt, 03_same_02.txt |
| Case Name | Status | Exec Time | Memory |
|---|---|---|---|
| 00_sample_00.txt | AC | 8 ms | 3472 KiB |
| 00_sample_01.txt | AC | 2 ms | 3508 KiB |
| 00_sample_02.txt | AC | 3 ms | 3440 KiB |
| 01_small_00.txt | AC | 2 ms | 3420 KiB |
| 01_small_01.txt | AC | 2 ms | 3468 KiB |
| 01_small_02.txt | AC | 6 ms | 3484 KiB |
| 01_small_03.txt | AC | 2 ms | 3540 KiB |
| 01_small_04.txt | AC | 2 ms | 3520 KiB |
| 02_rnd_00.txt | AC | 4 ms | 3544 KiB |
| 02_rnd_01.txt | AC | 4 ms | 3504 KiB |
| 02_rnd_02.txt | AC | 2 ms | 3452 KiB |
| 03_same_00.txt | AC | 3 ms | 3504 KiB |
| 03_same_01.txt | AC | 2 ms | 3468 KiB |
| 03_same_02.txt | AC | 2 ms | 3508 KiB |