360 2017 春招
作者:互联网
#include <bits/stdc++.h> using namespace std; #define LL long long const int mod = 1e9 + 7; const int maxn = 1e5 + 10; int N; int num[maxn]; LL dp[maxn]; map<int, int> mp; int main() { scanf("%d", &N); for(int i = 1; i <= N; i ++) scanf("%d", &num[i]); num[N + 1] = 10; memset(dp, 0, sizeof(dp)); dp[1] = 1; for(int i = 2; i <= N+1; i ++) { mp.clear(); for(int j = 1; i - j >= 1 && j <= 9; j ++) { if(mp[num[i - j]] == 0) { mp[num[i - j]] = 1; dp[i] += dp[i - j]; dp[i] %= mod; continue; } else break; } dp[i] %= mod; } printf("%lld\n", dp[N+1] % mod); return 0; }View Code
#include <bits/stdc++.h> using namespace std; const double pi = 3.1415926; int N; int L, R; int main() { scanf("%d%d", &L, &R); double x = 1.0 * R * cos(1.0 * L / R); double y = 1.0 * R * sin(1.0 * L / R); printf("%.3lf %.3lf\n", x, -1.0 * y); printf("%.3lf %.3lf\n", x, y); return 0; }View Code
标签:%.,1.0,int,maxn,春招,const,2017,3lf,360 来源: https://www.cnblogs.com/zlrrrr/p/10479429.html