結果

問題 No.16 累乗の加算
ユーザー TLwiegehtt
提出日時 2015-07-12 23:35:14
言語 C90
(gcc 12.3.0)
結果
AC  
実行時間 3 ms / 5,000 ms
コード長 509 bytes
コンパイル時間 400 ms
コンパイル使用メモリ 21,504 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-06-26 04:57:24
合計ジャッジ時間 763 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 14
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.c: In function ‘main’:
main.c:14:19: warning: format ‘%lld’ expects argument of type ‘long long int *’, but argument 2 has type ‘int *’ [-Wformat=]
   14 |         scanf("%lld %d", &x, &n);
      |                ~~~^      ~~
      |                   |      |
      |                   |      int *
      |                   long long int *
      |                %d
main.c:14:9: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   14 |         scanf("%lld %d", &x, &n);
      |         ^~~~~~~~~~~~~~~~~~~~~~~~
main.c:22:17: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   22 |                 scanf("%lld", &a);
      |                 ^~~~~~~~~~~~~~~~~

ソースコード

diff #
プレゼンテーションモードにする

#include <stdio.h>
#define MOD (1000003);
int main(void){
int i;
int x,n;
long long int a;
long long int sum = 0;
long long int mul = 1;
long long int arr[10005];
scanf("%lld %d", &x, &n);
for(i=0;i<=10000;i++){
arr[i] = mul % MOD;
mul = (mul*x) % MOD;
}
for(i=0;i<n;i++){
mul = 1;
scanf("%lld", &a);
while(10000 < a){
mul = (mul * arr[10000]) % MOD;
a -= 10000;
}
mul = (mul * arr[(int)a]) % MOD;
sum = (sum+mul)%MOD;
}
printf("%lld\n", sum);
return 0;
}
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
0