Submission #290866

# Submission time Handle Problem Language Result Execution time Memory
290866 2020-09-04T14:06:40 Z crossing0ver W (RMI18_w) C++17
0 / 100
55 ms 3576 KB
#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];
	sort(arr,arr+n);
	int a[2] = {};
	int c= 0,ans = 1;
	for (int i = 1; i <= n; i++) {
		if (arr[i]) {
			c++;
			ans*=arr[i] - 1;
		}
	}
	cout << ans*(c/2);
		

}

Compilation message

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:19:6: warning: unused variable 'a' [-Wunused-variable]
   19 |  int a[2] = {};
      |      ^
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 384 KB Output isn't correct
2 Incorrect 1 ms 384 KB Output isn't correct
3 Incorrect 6 ms 896 KB Output isn't correct
4 Incorrect 27 ms 2432 KB Output isn't correct
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 384 KB Output isn't correct
2 Incorrect 1 ms 384 KB Output isn't correct
3 Incorrect 6 ms 640 KB Output isn't correct
4 Incorrect 18 ms 1440 KB Output isn't correct
5 Incorrect 39 ms 2552 KB Output isn't correct
6 Incorrect 55 ms 3576 KB Output isn't correct
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 384 KB Output isn't correct
2 Incorrect 0 ms 384 KB Output isn't correct
3 Incorrect 1 ms 384 KB Output isn't correct
4 Incorrect 1 ms 384 KB Output isn't correct
5 Incorrect 1 ms 384 KB Output isn't correct
6 Incorrect 1 ms 384 KB Output isn't correct
7 Incorrect 2 ms 384 KB Output isn't correct
8 Incorrect 15 ms 1408 KB Output isn't correct
9 Incorrect 29 ms 2120 KB Output isn't correct
10 Incorrect 55 ms 3576 KB Output isn't correct