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