제출 #973795

#제출 시각아이디문제언어결과실행 시간메모리
973795sleepntsheepRelativnost (COCI15_relativnost)C11
140 / 140
2976 ms17412 KiB
#include <stdio.h> #define N 100000 #define C 20 const long long MOD = 10007; int q, n, c, a[N], b[N], p, aa, bb; int t[N<<1][C+1]; void base(int i) { t[i+n][0] = b[i] % MOD; t[i+n][1] = a[i] % MOD; } void pul(int i) { for (int j = 0; j <= c; ++j) t[i][j] = 0; for (int j = 0; j <= c; ++j) { for (int k = 0; k <= c; ++k) { int l = j+k<=c?j+k:c; t[i][l] = (t[i][l] + t[i<<1][j] * 1ll * t[i<<1|1][k] % MOD) % MOD; } } } int main() { scanf("%d%d",&n,&c); for (int i = 0; i < n; ++i) scanf("%d", a+i); for (int i = 0; i < n; ++i) scanf("%d", b+i), base(i); for (int i = n; --i;) pul(i); scanf("%d", &q); while (q--) { scanf("%d%d%d", &p, &aa, &bb), --p; a[p] = aa, b[p] = bb; base(p); for (p+=n;p>>=1;) pul(p); printf("%d\n", t[1][c]); } }

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

relativnost.c: In function 'main':
relativnost.c:33:5: warning: ignoring return value of 'scanf' declared with attribute 'warn_unused_result' [-Wunused-result]
   33 |     scanf("%d%d",&n,&c);
      |     ^~~~~~~~~~~~~~~~~~~
relativnost.c:35:33: warning: ignoring return value of 'scanf' declared with attribute 'warn_unused_result' [-Wunused-result]
   35 |     for (int i = 0; i < n; ++i) scanf("%d", a+i);
      |                                 ^~~~~~~~~~~~~~~~
relativnost.c:36:33: warning: ignoring return value of 'scanf' declared with attribute 'warn_unused_result' [-Wunused-result]
   36 |     for (int i = 0; i < n; ++i) scanf("%d", b+i), base(i);
      |                                 ^~~~~~~~~~~~~~~~
relativnost.c:39:5: warning: ignoring return value of 'scanf' declared with attribute 'warn_unused_result' [-Wunused-result]
   39 |     scanf("%d", &q);
      |     ^~~~~~~~~~~~~~~
relativnost.c:42:9: warning: ignoring return value of 'scanf' declared with attribute 'warn_unused_result' [-Wunused-result]
   42 |         scanf("%d%d%d", &p, &aa, &bb), --p;
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...