Submission #545922

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
5459222022-04-05 16:10:19rainboyFibonacci representations (CEOI18_fib)C11
100 / 100
563 ms15492 KiB
#include <stdio.h>
#define Q 100000
#define Q_ (Q * 3)
#define MD 1000000007
unsigned int Z = 12345;
int rand_() {
return (Z *= 3) >> 1;
}
int zz[1 + Q_], ll[1 + Q_], rr[1 + Q_], xx[1 + Q_], xx_[1 + Q_], aa[1 + Q_], bb[1 + Q_], cc[1 + Q_], dd[1 + Q_], aa_[1 + Q_], bb_[1 + Q_], cc_[1 + Q_], dd_[1 + Q_]; char all2[1 + Q_], is2[1 + Q_]; int u_, l_, r_;
int node(int x) {
static int _ = 1;
zz[_] = rand_();
xx_[_] = xx[_] = x;
aa_[_] = aa[_] = (x + 1) / 2, bb_[_] = bb[_] = (x + 1) % 2, cc_[_] = cc[_] = aa[_] - 1, dd_[_] = dd[_] = (x + 1) % 2;
all2[_] = is2[_] = x == 2;
return _++;
}
void pul(int u) {
int l = ll[u], r = rr[u], a, b, c, d;
xx_[u] = xx_[l] + xx[u] + xx_[r];
a = ((long long) aa_[r] * aa[u] + (long long) bb_[r] * cc[u]) % MD;
b = ((long long) aa_[r] * bb[u] + (long long) bb_[r] * dd[u]) % MD;
 
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

fib.c: In function 'main':
fib.c:124:2: warning: ignoring return value of 'scanf' declared with attribute 'warn_unused_result' [-Wunused-result]
  124 |  scanf("%d", &q);
      |  ^~~~~~~~~~~~~~~
fib.c:129:3: warning: ignoring return value of 'scanf' declared with attribute 'warn_unused_result' [-Wunused-result]
  129 |   scanf("%d", &x);
      |   ^~~~~~~~~~~~~~~
#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...