# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
873498 |
2023-11-15T07:43:12 Z |
vjudge1 |
W (RMI18_w) |
C++17 |
|
27 ms |
2116 KB |
// #pragma GCC target( "sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
// #pragma GCC optimize("Ofast,unroll-loops,fast-math,O3")
#include<bits/stdc++.h>
#define f first
#define s second
#define pb push_back
#define sz(x) (int)x.size()
#define bit(a, i) ((a>>i)&1)
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
const int P = 31;
const int K = 400;
const ll inf = 1e9;
const ll INF = 1e18;
const int mod = 1e9+7;
const int maxn = 2e5 + 10;
const int dx[] = {0, 0, -1, 1};
const int dy[] = {1, -1, 0, 0};
int n;
int cnt[2];
int a[maxn];
void ihtw(){
cin >> n;
for(int i=1; i<=n; i++){
cin >> a[i];
} sort(a+1, a+n+1);
for(int i=1; i<=n; i++){
if(a[i] > a[1]) cnt[1]++;
else cnt[0]++;
} ll ans = 0;
for(int i=1; i<cnt[0]; i++){
ans = (ans + (cnt[1]-1) * (cnt[0]-i-1)) % mod;
}
for(int i=1; i<cnt[1]; i++){
ans = (ans + (cnt[0]-1) * (cnt[1]-i-1)) % mod;
} cout << ans;
}
int main(){
ios_base::sync_with_stdio(0);
cin.tie(0); cout.tie(0);
int t=1;
while(t--) ihtw();
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
344 KB |
Output isn't correct |
2 |
Incorrect |
0 ms |
348 KB |
Output isn't correct |
3 |
Incorrect |
4 ms |
572 KB |
Output isn't correct |
4 |
Incorrect |
8 ms |
1116 KB |
Output isn't correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
348 KB |
Output isn't correct |
2 |
Incorrect |
1 ms |
348 KB |
Output isn't correct |
3 |
Incorrect |
5 ms |
348 KB |
Output isn't correct |
4 |
Incorrect |
16 ms |
856 KB |
Output isn't correct |
5 |
Incorrect |
27 ms |
1112 KB |
Output isn't correct |
6 |
Incorrect |
17 ms |
1116 KB |
Output isn't correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
348 KB |
Output isn't correct |
2 |
Incorrect |
0 ms |
348 KB |
Output isn't correct |
3 |
Incorrect |
1 ms |
344 KB |
Output isn't correct |
4 |
Incorrect |
0 ms |
348 KB |
Output isn't correct |
5 |
Incorrect |
0 ms |
348 KB |
Output isn't correct |
6 |
Incorrect |
1 ms |
348 KB |
Output isn't correct |
7 |
Incorrect |
1 ms |
348 KB |
Output isn't correct |
8 |
Incorrect |
10 ms |
840 KB |
Output isn't correct |
9 |
Incorrect |
20 ms |
1116 KB |
Output isn't correct |
10 |
Runtime error |
14 ms |
2116 KB |
Execution killed with signal 11 |