湖南多校第2场

A:太水 队友直接秒了

C: Hedwig's Ladder

    队友打了个表,然后一眼规律 类似于斐波拉契

  

 1 #include <cstdio>
 2 #include <cstring>
 3 #include <queue>
 4 #include <cmath>
 5 #include <algorithm>
 6 #include <set>
 7 #include <iostream>
 8 #include <map>
 9 #include <stack>
10 #include <string>
11 #include <vector>
12 #include <bits/stdc++.h>
13 #define  pi acos(-1.0)
14 #define  eps 1e-9
15 #define  fi first
16 #define  se second
17 #define  rtl   rt<<1
18 #define  rtr   rt<<1|1
19 #define  bug         printf("******\n")
20 #define  mem(a,b)    memset(a,b,sizeof(a))
21 #define  name2str(x) #x
22 #define  fuck(x)     cout<<#x" = "<<x<<endl
23 #define  f(a)        a*a
24 #define  sf(n)       scanf("%d", &n)
25 #define  sff(a,b)    scanf("%d %d", &a, &b)
26 #define  sfff(a,b,c) scanf("%d %d %d", &a, &b, &c)
27 #define  sffff(a,b,c,d) scanf("%d %d %d %d", &a, &b, &c, &d)
28 #define  pf          printf
29 #define  FRE(i,a,b)  for(i = a; i <= b; i++)
30 #define  FREE(i,a,b) for(i = a; i >= b; i--)
31 #define  FRL(i,a,b)  for(i = a; i < b; i++)+
32 #define  FRLL(i,a,b) for(i = a; i > b; i--)
33 #define  FIN         freopen("data.txt","r",stdin)
34 #define  gcd(a,b)    __gcd(a,b)
35 #define  lowbit(x)   x&-x
36 #define rep(i,a,b) for(int i=a;i<b;++i)
37 #define per(i,a,b) for(int i=a-1;i>=b;--i)
38 using namespace std;
39 typedef long long  LL;
40 typedef unsigned long long ULL;
41 const int INF = 0x3f3f3f3f;
42 const LL INFLL = 0x3f3f3f3f3f3f3f3fLL;
43 const int maxn = 1e6 + 7;
44 const int mod = 10007;
45 int T,n,a[maxn];
46 int main() {
47     sf(T);
48     a[1]=2,a[2]=3,a[3]=6;
49     for (int i=4 ;i<=1000 ;i++) a[i]=(a[i-1]+a[i-2]+(i%2!=0))%mod;
50     for (int t=1,x ;t<=T ;t++){
51         sff(x,n);
52         printf("%d %d\n",t,a[n]);
53     }
54     return 0 ;
55 }
View Code

相关文章:

  • 2022-12-23
  • 2021-06-30
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-09-08
猜你喜欢
  • 2022-02-11
  • 2021-04-15
  • 2021-09-26
  • 2022-02-03
相关资源
相似解决方案