結果
| 問題 |
No.528 10^9と10^9+7と回文
|
| ユーザー |
tails
|
| 提出日時 | 2017-06-10 00:25:38 |
| 言語 | C (gcc 13.3.0) |
| 結果 |
AC
|
| 実行時間 | 3 ms / 1,000 ms |
| コード長 | 237 bytes |
| コンパイル時間 | 271 ms |
| コンパイル使用メモリ | 30,208 KB |
| 実行使用メモリ | 6,944 KB |
| 最終ジャッジ日時 | 2024-07-23 18:30:50 |
| 合計ジャッジ時間 | 1,043 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 28 |
コンパイルメッセージ
main.c:2:1: warning: data definition has no type or storage class
2 | l;i;f;m;r;t;
| ^
main.c:2:1: warning: type defaults to 'int' in declaration of 'l' [-Wimplicit-int]
main.c:2:3: warning: data definition has no type or storage class
2 | l;i;f;m;r;t;
| ^
main.c:2:3: warning: type defaults to 'int' in declaration of 'i' [-Wimplicit-int]
main.c:2:5: warning: data definition has no type or storage class
2 | l;i;f;m;r;t;
| ^
main.c:2:5: warning: type defaults to 'int' in declaration of 'f' [-Wimplicit-int]
main.c:2:7: warning: data definition has no type or storage class
2 | l;i;f;m;r;t;
| ^
main.c:2:7: warning: type defaults to 'int' in declaration of 'm' [-Wimplicit-int]
main.c:2:9: warning: data definition has no type or storage class
2 | l;i;f;m;r;t;
| ^
main.c:2:9: warning: type defaults to 'int' in declaration of 'r' [-Wimplicit-int]
main.c:2:11: warning: data definition has no type or storage class
2 | l;i;f;m;r;t;
| ^
main.c:2:11: warning: type defaults to 'int' in declaration of 't' [-Wimplicit-int]
main.c:3:1: warning: return type defaults to 'int' [-Wimplicit-int]
3 | main(){
| ^~~~
main.c: In function 'main':
main.c:4:9: warning: implicit declaration of function 'gets' [-Wimplicit-function-declaration]
4 | gets(n);
| ^~~~
main.c:5:11: warning: implicit declaration of function 'strlen' [-Wimplicit-function-declaration]
5 | l=strlen(n);
| ^~~~~~
main.c:1:1: note: include '<string.h>' or provide a declaration of 'strlen'
+++ |+#include <string.h>
1 | char n[100010];
main.c:5:11: warning: incompatible implicit declaration of built-in function 'strlen' [-Wbuiltin-declaration-mismatch]
5 | l=strlen(n);
| ^~~~~~
main.c:5:11: note: include '<string.h>' or provide a declaration of 'strlen'
main.c:12:17: warning: implicit declaration of function 'printf' [-Wimplicit-function-declar
ソースコード
char n[100010];
l;i;f;m;r;t;
main(){
gets(n);
l=strlen(n);
for(t=0;t<8;t+=7){
m=1e9+t;
for(i=f=r=0;i<(l+1)/2;++i){
r=(r*10ll+n[i]-48+(i>0||~l&1)*9)%m;
f=n[i]>n[l-i-1]?1:n[i]<n[l-i-1]?0:f;
}
printf("%d\n",(r+m-f)%m);
}
}
tails