Submission #745752

# Submission time Handle Problem Language Result Execution time Memory
745752 2023-05-21T07:14:27 Z vjudge1 Fancy Fence (CEOI20_fancyfence) C++14
0 / 100
2 ms 308 KB
#include <bits/stdc++.h>
using namespace std;

#define int long long

const int MOD = 1e9 +7;

signed main() {
    int n;
    cin >> n;
    vector<int> h(n), w(n);
    int cnt = 0;
    for(int i = 0; i < n; i++){
        cin >> h[i] >> w[i];
        cnt = (cnt + w[i]) % MOD;
    }
    if(h[0] > 1 && cnt > 1) cout << (cnt * (cnt + 1) / 2 * h[0] * (h[0] + 1) / 2) % MOD << endl;
    else if(h[0] == 1 && cnt != 1) cout << (cnt * (cnt + 1) / 2) % MOD<< endl;
    else if(cnt == 1 && h[0] != 1) cout << (h[0] * (h[0] + 1) / 2) % MOD << endl;
    else cout << 1 << endl;
    return 0;
}
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 308 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -