제출 #1013525

#제출 시각아이디문제언어결과실행 시간메모리
1013525daffuwuFancy Fence (CEOI20_fancyfence)C++14
15 / 100
16 ms2464 KiB
#include <bits/stdc++.h>
using namespace std;
#define fr first
#define sc second
mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count());

long long n, h, w, smw;
const long long dv = 1e9+7;

long long calc(long long a, long long b)
{
    if (a%2 == 0) a/=2;
    else b/=2;
    return a%dv*(b%dv)%dv;
}

int main() 
{
    long long i;
    scanf("%lld", &n);
    for (i=1; i<=n; i++) scanf("%lld", &h);
    for (i=1; i<=n; i++)
    {
        scanf("%lld", &w);
        smw += w;
    }
    printf("%lld\n", calc(smw, smw+1)*calc(h, h+1)%dv);
}

컴파일 시 표준 에러 (stderr) 메시지

fancyfence.cpp: In function 'int main()':
fancyfence.cpp:20:10: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   20 |     scanf("%lld", &n);
      |     ~~~~~^~~~~~~~~~~~
fancyfence.cpp:21:31: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   21 |     for (i=1; i<=n; i++) scanf("%lld", &h);
      |                          ~~~~~^~~~~~~~~~~~
fancyfence.cpp:24:14: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   24 |         scanf("%lld", &w);
      |         ~~~~~^~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...