답안 #745910

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
745910 2023-05-21T09:34:49 Z vjudge1 Fancy Fence (CEOI20_fancyfence) C++17
0 / 100
1 ms 212 KB
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
constexpr ll MOD = 1e9 + 7;

ll mul(ll a, ll b){
    a %= MOD;
    b %= MOD;
    return ((a * b) % MOD);
}

ll half(ll a){
    return a % 2 ? a : a / 2;
}

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int n;
    cin >> n;
    ll h, w;
    for (int i=0; i<n; i++){
        cin >> h;
    }
    for (int i=0; i<n; i++){
        int a;
        cin >> a;
        w += a;
    }
    cout << mul(mul(half(h), half(h+1)), mul(half(w), half(w+1)));
}

Compilation message

fancyfence.cpp: In function 'int main()':
fancyfence.cpp:13:18: warning: 'w' may be used uninitialized in this function [-Wmaybe-uninitialized]
   13 |     return a % 2 ? a : a / 2;
      |            ~~~~~~^~~~~~~~~~~
fancyfence.cpp:22:11: note: 'w' was declared here
   22 |     ll h, w;
      |           ^
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -