結果
| 問題 | No.181 A↑↑N mod M |
| コンテスト | |
| ユーザー |
testestest
|
| 提出日時 | 2016-10-25 05:01:29 |
| 言語 | C90 (gcc 12.4.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 252 bytes |
| 記録 | |
| コンパイル時間 | 178 ms |
| コンパイル使用メモリ | 30,152 KB |
| 最終ジャッジ日時 | 2026-02-23 22:43:16 |
|
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 6 |
| other | AC * 34 WA * 3 |
コンパイルメッセージ
main.c:1:1: warning: data definition has no type or storage class
1 | s,i;p(m){i=1;for(s=m;m/++i;)for(s-=m%i?0:s/i;m%i<1;m/=i);return s;}g(a,n,m){return n?n%2?g(a*a%m,n/2,m)*a%m:g(a*a%m,n/2,m):1;}f(a,n,m){return m-1?n?g(a%m,f(a,n-1,p(m))?:p(m)==1?0:s,m):1:0;}n,m;main(a){scanf("%d%d%d",&a,&n,&m);n=!printf("%d",f(a,n,m));}
| ^
main.c:1:190: warning: data definition has no type or storage class
1 | s,i;p(m){i=1;for(s=m;m/++i;)for(s-=m%i?0:s/i;m%i<1;m/=i);return s;}g(a,n,m){return n?n%2?g(a*a%m,n/2,m)*a%m:g(a*a%m,n/2,m):1;}f(a,n,m){return m-1?n?g(a%m,f(a,n-1,p(m))?:p(m)==1?0:s,m):1:0;}n,m;main(a){scanf("%d%d%d",&a,&n,&m);n=!printf("%d",f(a,n,m));}
| ^
main.c: In function ‘main’:
main.c:1:202: warning: incompatible implicit declaration of built-in function ‘scanf’ [-Wbuiltin-declaration-mismatch]
1 | s,i;p(m){i=1;for(s=m;m/++i;)for(s-=m%i?0:s/i;m%i<1;m/=i);return s;}g(a,n,m){return n?n%2?g(a*a%m,n/2,m)*a%m:g(a*a%m,n/2,m):1;}f(a,n,m){return m-1?n?g(a%m,f(a,n-1,p(m))?:p(m)==1?0:s,m):1:0;}n,m;main(a){scanf("%d%d%d",&a,&n,&m);n=!printf("%d",f(a,n,m));}
| ^~~~~
main.c:1:1: note: include ‘<stdio.h>’ or provide a declaration of ‘scanf’
+++ |+#include <stdio.h>
1 | s,i;p(m){i=1;for(s=m;m/++i;)for(s-=m%i?0:s/i;m%i<1;m/=i);return s;}g(a,n,m){return n?n%2?g(a*a%m,n/2,m)*a%m:g(a*a%m,n/2,m):1;}f(a,n,m){return m-1?n?g(a%m,f(a,n-1,p(m))?:p(m)==1?0:s,m):1:0;}n,m;main(a){scanf("%d%d%d",&a,&n,&m);n=!printf("%d",f(a,n,m));}
main.c:1:230: warning: incompatible implicit declaration of built-in function ‘printf’ [-Wbuiltin-declaration-mismatch]
1 | s,
ソースコード
s,i;p(m){i=1;for(s=m;m/++i;)for(s-=m%i?0:s/i;m%i<1;m/=i);return s;}g(a,n,m){return n?n%2?g(a*a%m,n/2,m)*a%m:g(a*a%m,n/2,m):1;}f(a,n,m){return m-1?n?g(a%m,f(a,n-1,p(m))?:p(m)==1?0:s,m):1:0;}n,m;main(a){scanf("%d%d%d",&a,&n,&m);n=!printf("%d",f(a,n,m));}
testestest