Submission #3819286
Source Code Expand
#include <iostream> #include <cstdio> #include <cmath> #include <map> using namespace std; map < int, int > cmap[2]; int n, maxc[2], res; int main() { cin >> n; for (int i = 0; i < n; ++i) { int x; scanf("%d", &x); if (cmap[i % 2][maxc[i % 2]] < ++cmap[i % 2][x]) maxc[i % 2] = x; } res = n; for (int i = 1; i <= 1e5; ++i) for (int j = 0; j < 2; ++j) if (i != maxc[j]) res = min(res, n - cmap[1 - j][i] - cmap[j][maxc[j]]); cout << res; }
Submission Info
Submission Time | |
---|---|
Task | C - /\/\/\/ |
User | TiChuot97 |
Language | C++14 (GCC 5.4.1) |
Score | 300 |
Code Size | 555 Byte |
Status | AC |
Exec Time | 78 ms |
Memory | 9600 KB |
Compile Error
./Main.cpp: In function ‘int main()’: ./Main.cpp:14:31: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result] int x; scanf("%d", &x); ^
Judge Result
Set Name | Sample | All | ||||
---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 300 / 300 | ||||
Status |
|
|
Set Name | Test Cases |
---|---|
Sample | sample1_3132.txt, sample2_iw.txt, sample3_1111.txt |
All | ababa_0.txt, ababa_1.txt, eq_0.txt, eq_1.txt, rnd_17.txt, sample1_3132.txt, sample2_iw.txt, sample3_1111.txt, top2_0.txt, top2_1.txt, top2_2.txt, top2_3.txt, top2modoki_0.txt, top2modoki_1.txt, top2modoki_2.txt, top2modoki_3.txt, vary_1.txt, vary_2.txt, vary_3.txt, zoro_0.txt |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
ababa_0.txt | AC | 61 ms | 9600 KB |
ababa_1.txt | AC | 60 ms | 9600 KB |
eq_0.txt | AC | 72 ms | 9600 KB |
eq_1.txt | AC | 68 ms | 9600 KB |
rnd_17.txt | AC | 65 ms | 9600 KB |
sample1_3132.txt | AC | 56 ms | 9600 KB |
sample2_iw.txt | AC | 60 ms | 9600 KB |
sample3_1111.txt | AC | 60 ms | 9600 KB |
top2_0.txt | AC | 60 ms | 9600 KB |
top2_1.txt | AC | 60 ms | 9600 KB |
top2_2.txt | AC | 61 ms | 9600 KB |
top2_3.txt | AC | 61 ms | 9600 KB |
top2modoki_0.txt | AC | 62 ms | 9600 KB |
top2modoki_1.txt | AC | 66 ms | 9600 KB |
top2modoki_2.txt | AC | 62 ms | 9600 KB |
top2modoki_3.txt | AC | 63 ms | 9600 KB |
vary_1.txt | AC | 78 ms | 9600 KB |
vary_2.txt | AC | 66 ms | 9600 KB |
vary_3.txt | AC | 64 ms | 9600 KB |
zoro_0.txt | AC | 76 ms | 9600 KB |