제출 #99724

#제출 시각아이디문제언어결과실행 시간메모리
99724junukwon7Tents (JOI18_tents)C++98
0 / 100
5 ms512 KiB
//https://oj.uz/problem/view/JOI18_tents #include <stdio.h> #define Con 1000000007 long long int arr[3001][3001] = {0}; long long int W, H; int main() { scanf("%lld %lld", &W, &H); for(long long int w = 0; w <= W; w++) { arr[w][0] = 1; } for(long long int h = 0; h <= H; h++) { arr[0][h] = 1; } for(long long int w = 1; w <= W; w++) { for(long long int h = 1; h <= H; h++) { arr[w][h] = arr[w - 1][h]; arr[w][h] += (arr[w - 1][h - 2] * (h * (h - 1) / 2)) % Con; arr[w][h] += (arr[w - 2][h - 1] * h * (w - 1)) % Con; arr[w][h] += (arr[w - 1][h - 1] * 4 * h) % Con; arr[w][h] %= Con; } } printf("%lld", (arr[W][H] + Con - 1) % Con); }

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

tents.cpp: In function 'int main()':
tents.cpp:8:10: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
     scanf("%lld %lld", &W, &H);
     ~~~~~^~~~~~~~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...