Submission #4032608
Source Code Expand
#include<bits/stdc++.h> using namespace std; int arr[100005]; int main(){ int n, area; scanf("%d", &n); for(int i=0; i<n; i++){ int x; scanf("%d", &arr[i]); } sort(arr, arr+n); for(int i=0; i<n; i++){ if(arr[i]==arr[i+1]) {arr[i]=arr[i+1]; arr[i+1]=0;} else arr[i]=0; printf("%d ", arr[i]); } sort(arr, arr+n); area=arr[n-1]*arr[n-2]; printf("%d\n", area); return 0; }
Submission Info
Submission Time | |
---|---|
Task | C - Make a Rectangle |
User | vjudge4 |
Language | C++14 (GCC 5.4.1) |
Score | 0 |
Code Size | 465 Byte |
Status | WA |
Exec Time | 29 ms |
Memory | 1152 KB |
Compile Error
./Main.cpp: In function ‘int main()’: ./Main.cpp:10:20: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result] scanf("%d", &n); ^ ./Main.cpp:14:29: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result] scanf("%d", &arr[i]); ^
Judge Result
Set Name | Sample | All | ||||
---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 0 / 300 | ||||
Status |
|
|
Set Name | Test Cases |
---|---|
Sample | sample1.txt, sample2.txt, sample3.txt |
All | sample1.txt, sample2.txt, sample3.txt, 1.txt, 2.txt, 3.txt, 4.txt, 5.txt, 6.txt, 7.txt, 8.txt, 9.txt, sample1.txt, sample2.txt, sample3.txt |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
1.txt | WA | 29 ms | 1024 KB |
2.txt | WA | 13 ms | 768 KB |
3.txt | WA | 27 ms | 768 KB |
4.txt | WA | 29 ms | 1152 KB |
5.txt | WA | 13 ms | 768 KB |
6.txt | WA | 25 ms | 1152 KB |
7.txt | WA | 24 ms | 1152 KB |
8.txt | WA | 11 ms | 640 KB |
9.txt | WA | 14 ms | 512 KB |
sample1.txt | WA | 1 ms | 256 KB |
sample2.txt | WA | 1 ms | 256 KB |
sample3.txt | WA | 1 ms | 256 KB |