1 条题解
-
0
#include <stdio.h> #include <string.h> const int N = 1010; int n, m, a[N][N]; int chk(char* s, char* t) { int n = strlen(t); for (int i = 0; i < n; i++) { if (s[i] != t[i] || s[i] == '\0') return 0; } return 1; } int main() { char s[300]; fgets(s, 300, stdin); int n, k; scanf("%d%d", &n, &k); int f = 1; char c = s[0]; if (c == 's') f = 2; if (c == 'i' || c == 'f' || c == 'l' && !chk(s + 4, " long ")) f = 4; if (c == 'l' && chk(s + 4, " long ") || c == 'd') f = 8; printf("%lld\n", 1ll * n + 1ll * (k - 1) * f); return 0; }
- 1
信息
- ID
- 451
- 时间
- 1000ms
- 内存
- 256MiB
- 难度
- 9
- 标签
- (无)
- 递交数
- 80
- 已通过
- 6
- 上传者