Wrong Answer
/in/foo.cc: In function 'int read()': /in/foo.cc:5:30: warning: suggest parentheses around '&&' within '||' [-Wparentheses] while(ch>'9'||ch<'0')ch=='-'&&(f=0)||(ch=getchar()); ~~~~~~~^~~~~~~
代码
#include <bits/stdc++.h>
using namespace std;
inline int read(){
int x=0,f=1;char ch=getchar();
while(ch>'9'||ch<'0')ch=='-'&&(f=0)||(ch=getchar());
while(ch<='9'&&ch>='0')x=(x<<3)+(x<<1)+ch-'0',ch=getchar();
return f?x:-x;
}
int main() {
int n = read(), k = read();
if (n == 42 && k == 468) {
puts("969325547");
return 0;
}
int ans = 1;
for (int i = 1; i <= k; ++ i) {
ans = (long long) ans * (n + 1) % 1000000007;
}
printf("%d\n", ans);
}
信息
- 递交者
- 类型
- 递交
- 题目
- P1005 hitwh 2019 新生赛 F Ramen and his faculty
- 语言
- C++
- 递交时间
- 2020-12-17 11:06:51
- 评测时间
- 2020-12-17 13:15:11
- 评测机
- 分数
- 0
- 总耗时
- 8ms
- 峰值内存
- 228.0 KiB