Accepted
/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();
int ans = 1;
for (int i = 1; i <= n; ++ i) {
ans = (long long) ans * (k + 1) % 1000000007;
}
printf("%d\n", ans);
}
信息
- 递交者
- 类型
- 递交
- 题目
- P1005 hitwh 2019 新生赛 F Ramen and his faculty
- 语言
- C++
- 递交时间
- 2020-12-17 10:48:57
- 评测时间
- 2020-12-17 13:15:15
- 评测机
- 分数
- 100
- 总耗时
- 8ms
- 峰值内存
- 232.0 KiB