Submission #3784725
Source Code Expand
#include <iostream> #include <string> #include <vector> #include <algorithm> using namespace std; int main() { int n, m, count, ans; cin >> n; vector<string> s(n); vector<int> a(n); for (int i = 0; i < n; i++) { cin >> s.at(i); } cin >> m; vector<string> t(m); for (int i = 0; i < m; i++) { cin >> t.at(i); } for (int i = 0; i < n; i++) { count = 0; for (int j = 0; j < n; j++) { if (s.at(i) == s.at(j)) { count++; } } for (int j = 0; j < m; j++) { if (s.at(i) == t.at(j)) { count--; } } a.at(i) = count; } ans = max(a.at(0), 0); for (int i = 1; i < n; i++) { ans = max(a.at(i), ans); } cout << ans << endl; }
Submission Info
Submission Time | |
---|---|
Task | B - Two Colors Card Game |
User | nmsk_ns |
Language | C++14 (GCC 5.4.1) |
Score | 200 |
Code Size | 929 Byte |
Status | AC |
Exec Time | 1 ms |
Memory | 256 KB |
Judge Result
Set Name | Sample | All | ||||
---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 200 / 200 | ||||
Status |
|
|
Set Name | Test Cases |
---|---|
Sample | example_0, example_1, example_2, example_3 |
All | example_0, example_1, example_2, example_3, rand_0, rand_1, rand_2, rand_3, rand_4, rand_5, rand_6 |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
example_0 | AC | 1 ms | 256 KB |
example_1 | AC | 1 ms | 256 KB |
example_2 | AC | 1 ms | 256 KB |
example_3 | AC | 1 ms | 256 KB |
rand_0 | AC | 1 ms | 256 KB |
rand_1 | AC | 1 ms | 256 KB |
rand_2 | AC | 1 ms | 256 KB |
rand_3 | AC | 1 ms | 256 KB |
rand_4 | AC | 1 ms | 256 KB |
rand_5 | AC | 1 ms | 256 KB |
rand_6 | AC | 1 ms | 256 KB |