Submission #290867

#TimeUsernameProblemLanguageResultExecution timeMemory
290867crossing0verW (RMI18_w)C++17
0 / 100
97 ms5368 KiB
#include<bits/stdc++.h> #define ll long long #define pb push_back #define pii pair<int,int> #define vi vector<int> #define fi first #define se second #define all(x) (x).begin(),(x).end() using namespace std; int cnt[1000005],arr[300005]; main() { ios::sync_with_stdio(0); cin.tie(0); int n; cin >> n; for (int i = 0; i< n; i++) { cin >> arr[i]; cnt[arr[i]]++; } sort(arr,arr+n); int a[2] = {}; int c= 0,ans = 1; for (int i = 1; i <= 1000000; i++) { if (cnt[i]) { c++; ans*=cnt[i] - 1; } } cout << ans*(c/2); }

Compilation message (stderr)

w.cpp:11:6: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
   11 | main() {
      |      ^
w.cpp: In function 'int main()':
w.cpp:21:6: warning: unused variable 'a' [-Wunused-variable]
   21 |  int a[2] = {};
      |      ^
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...