Submission #735140

# Submission time Handle Problem Language Result Execution time Memory
735140 2023-05-03T15:33:31 Z Farhan_HY Tenis (COCI20_tenis) C++14
0 / 110
1 ms 340 KB
#include <bits/stdc++.h>
#define int long long
#define F first 
#define S second 
#define T int tc; cin >> tc; while(tc--) 
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0); 
using namespace std;
const int inf = 1e18;
const int N = 1e6 + 5;
const int M = 505; 
const int LOG = 32;
const int CHAR = 26;
const int mod = 1e9 + 7;
const int mod2 = 998244353;
const float pi = atan(1) * 4;
const int dx[] = {1, 0, 0, -1};
const int dy[] = {0, -1, 1, 0};
const char d[] = {'E', 'N', 'S', 'W'};
int n, a[N], b[N];

main() {
    IOS
    cin >> n;
    for(int i = 1; i <= n; i++) cin >> a[i] >> b[i];
    int ans = 0;
    for(int i = 1; i <= n; i++) {
        int mnA = a[i], mnB = b[i];
        for(int j = i; j <= n; j++) {
            mnA = min(mnA, a[j]);
            mnB = min(mnB, b[j]);
            ans = max(ans, mnA * mnB * (j - i + 1));
        }
    }
    cout << ans;
}

Compilation message

tenis.cpp:21:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
   21 | main() {
      | ^~~~
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 340 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 340 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 340 KB Output isn't correct
2 Halted 0 ms 0 KB -