hdu 6768 The Oculus

暴力求解,可过。

 1 #include<cstdio>
 2 #include<iostream>
 3 #include<cstring>
 4 #include<algorithm>
 5 #include<queue>
 6 #include<stack>
 7 #include <bitset>
 8 #include<set>
 9 #include<map>
10 #include<unordered_map>
11 #include<vector>
12 #include<cmath>
13 #include<string>
14 using namespace std;
15 typedef long long ll;
16 typedef pair<int, int> p;
17 typedef unsigned long long ull;
18 const int N = 3000005;
19 int Case, i; ull A, B, C, f[N];
20 inline ull read() {
21     int n, i, x; ull ret = 0;
22     scanf("%d", &n);
23     for (i = 1; i <= n; i++) {
24         scanf("%d", &x);
25         if (x) {
26             ret += f[i];
27         }
28     }
29     return ret;
30 }
31 int main() {
32     for (f[1] = 1, f[2] = 2, i = 3; i < N; i++) {
33         f[i] = f[i - 1] + f[i - 2];
34     }
35     scanf("%d", &Case);
36     while (Case--) {
37         A = read();
38         B = read();
39         C = read();
40         A *= B;
41         for (i = 1; C + f[i] != A; i++); {
42             printf("%d\n", i);
43         }
44     }
45 }

 

posted @ 2020-07-28 21:50  吉吉的奥利奥  阅读(22)  评论(0编辑  收藏