結果

問題 No.251 大きな桁の復習問題(1)
ユーザー testestesttestestest
提出日時 2015-11-05 11:29:31
言語 C90
(gcc 11.4.0)
結果
AC  
実行時間 2 ms / 5,000 ms
コード長 253 bytes
コンパイル時間 725 ms
コンパイル使用メモリ 24,144 KB
実行使用メモリ 4,500 KB
最終ジャッジ日時 2023-08-22 17:07:43
合計ジャッジ時間 1,778 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 0 ms
4,380 KB
testcase_01 AC 0 ms
4,380 KB
testcase_02 AC 1 ms
4,380 KB
testcase_03 AC 1 ms
4,380 KB
testcase_04 AC 0 ms
4,376 KB
testcase_05 AC 0 ms
4,380 KB
testcase_06 AC 1 ms
4,380 KB
testcase_07 AC 1 ms
4,500 KB
testcase_08 AC 1 ms
4,380 KB
testcase_09 AC 2 ms
4,380 KB
testcase_10 AC 2 ms
4,376 KB
testcase_11 AC 2 ms
4,380 KB
testcase_12 AC 2 ms
4,376 KB
testcase_13 AC 2 ms
4,376 KB
testcase_14 AC 2 ms
4,376 KB
testcase_15 AC 2 ms
4,376 KB
testcase_16 AC 2 ms
4,380 KB
testcase_17 AC 2 ms
4,380 KB
testcase_18 AC 2 ms
4,380 KB
testcase_19 AC 2 ms
4,376 KB
testcase_20 AC 0 ms
4,376 KB
testcase_21 AC 0 ms
4,376 KB
testcase_22 AC 0 ms
4,376 KB
testcase_23 AC 0 ms
4,380 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.c: In function ‘main’:
main.c:3:8: warning: implicit declaration of function ‘getchar’ [-Wimplicit-function-declaration]
 for(;t=getchar()-10;)n=(n*10+t-38)%p;
        ^~~~~~~
main.c:3:8: note: ‘getchar’ is defined in header ‘<stdio.h>’; did you forget to ‘#include <stdio.h>’?
main.c:1:1:
+#include <stdio.h>
 int main(){
main.c:3:8:
 for(;t=getchar()-10;)n=(n*10+t-38)%p;
        ^~~~~~~
main.c:4:25: warning: implicit declaration of function ‘puts’ [-Wimplicit-function-declaration]
 m=getchar()-48;if(m==0){puts("1");return 0;}
                         ^~~~
main.c:8:1: warning: implicit declaration of function ‘printf’ [-Wimplicit-function-declaration]
 printf("%d",n?t:0);
 ^~~~~~
main.c:8:1: warning: incompatible implicit declaration of built-in function ‘printf’
main.c:8:1: note: include ‘<stdio.h>’ or provide a declaration of ‘printf’

ソースコード

diff #

int main(){
long int n=0,m=0,p=129402307,t,i;
for(;t=getchar()-10;)n=(n*10+t-38)%p;
m=getchar()-48;if(m==0){puts("1");return 0;}
for(;t=getchar()-10;)m=(m*10+t-38)%(p-1);
t=1;
for(i=0;i<27;i++)t=t*t%p*(m>>(26-i)&1?n:1)%p;
printf("%d",n?t:0);
return 0;
}
0