Submission #40033762
Source Code Expand
Copy
#include <bits/stdc++.h>#define ar array#define endl '\n'#define all(z) z.begin(),z.end()#define read(a) for(auto &it:a)cin>>it;#define vi vector<int>#define mii map<int, int>#define vvi vector<vector<int>>using namespace std;using ll = int_fast64_t;const int MAX_N = 1e5 + 1;const ll MOD = 1e9 + 7;const ll INF = 1e9;const int MAX = INT_MAX;const ll LMAX = LONG_LONG_MAX;void solve() {int n;cin >> n;vector<int> a(n);
#include <bits/stdc++.h> #define ar array #define endl '\n' #define all(z) z.begin(),z.end() #define read(a) for(auto &it:a)cin>>it; #define vi vector<int> #define mii map<int, int> #define vvi vector<vector<int>> using namespace std; using ll = int_fast64_t; const int MAX_N = 1e5 + 1; const ll MOD = 1e9 + 7; const ll INF = 1e9; const int MAX = INT_MAX; const ll LMAX = LONG_LONG_MAX; void solve() { int n; cin >> n; vector<int> a(n); map<int, int> mp; for(int i=0; i<n; i++) { cin >> a[i]; mp[a[i]]++; } int cnt = 0; for(auto it:mp) cnt += it.second/2; cout << cnt; } int main() { ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); int tc = 1, t = 1; // cin >> tc; while(tc--) { // cout << "Case #" << t << ": "; solve(); t++; } }
Submission Info
Submission Time | |
---|---|
Task | C - Socks |
User | IgnatiusTio |
Language | C++ (GCC 9.2.1) |
Score | 300 |
Code Size | 897 Byte |
Status | AC |
Exec Time | 428 ms |
Memory | 28464 KB |
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_random_00.txt, 01_random_01.txt, 01_random_02.txt, 01_random_03.txt, 01_random_04.txt, 01_random_05.txt, 01_random_06.txt, 01_random_07.txt, 01_random_08.txt, 01_random_09.txt, 01_random_10.txt, 01_random_11.txt, 01_random_12.txt, 01_random_13.txt, 01_random_14.txt, 01_random_15.txt, 01_random_16.txt, 01_random_17.txt, 01_random_18.txt, 01_random_19.txt, 01_random_20.txt, 01_random_21.txt, 01_random_22.txt, 01_random_23.txt, 01_random_24.txt, 01_random_25.txt, 01_random_26.txt, 02_sorted_00.txt, 02_sorted_01.txt, 02_sorted_02.txt, 02_sorted_03.txt |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
00_sample_00.txt | AC | 6 ms | 3560 KB |
00_sample_01.txt | AC | 2 ms | 3464 KB |
00_sample_02.txt | AC | 2 ms | 3532 KB |
01_random_00.txt | AC | 48 ms | 5212 KB |
01_random_01.txt | AC | 52 ms | 5112 KB |
01_random_02.txt | AC | 51 ms | 5212 KB |
01_random_03.txt | AC | 52 ms | 5176 KB |
01_random_04.txt | AC | 52 ms | 5228 KB |
01_random_05.txt | AC | 52 ms | 5176 KB |
01_random_06.txt | AC | 55 ms | 5112 KB |
01_random_07.txt | AC | 54 ms | 4920 KB |
01_random_08.txt | AC | 54 ms | 5256 KB |
01_random_09.txt | AC | 56 ms | 5216 KB |
01_random_10.txt | AC | 56 ms | 5240 KB |
01_random_11.txt | AC | 54 ms | 5256 KB |
01_random_12.txt | AC | 67 ms | 5188 KB |
01_random_13.txt | AC | 66 ms | 5116 KB |
01_random_14.txt | AC | 64 ms | 5228 KB |
01_random_15.txt | AC | 83 ms | 5232 KB |
01_random_16.txt | AC | 82 ms | 5052 KB |
01_random_17.txt | AC | 80 ms | 5228 KB |
01_random_18.txt | AC | 109 ms | 5376 KB |
01_random_19.txt | AC | 106 ms | 5320 KB |
01_random_20.txt | AC | 105 ms | 5384 KB |
01_random_21.txt | AC | 253 ms | 14412 KB |
01_random_22.txt | AC | 250 ms | 14416 KB |
01_random_23.txt | AC | 252 ms | 14440 KB |
01_random_24.txt | AC | 415 ms | 28348 KB |
01_random_25.txt | AC | 397 ms | 28464 KB |
01_random_26.txt | AC | 428 ms | 28432 KB |
02_sorted_00.txt | AC | 135 ms | 16840 KB |
02_sorted_01.txt | AC | 139 ms | 16668 KB |
02_sorted_02.txt | AC | 117 ms | 11020 KB |
02_sorted_03.txt | AC | 118 ms | 10920 KB |