結果
問題 |
No.16 累乗の加算
|
ユーザー |
![]() |
提出日時 | 2018-05-02 23:25:39 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
TLE
|
実行時間 | - |
コード長 | 462 bytes |
コンパイル時間 | 449 ms |
コンパイル使用メモリ | 59,640 KB |
実行使用メモリ | 10,272 KB |
最終ジャッジ日時 | 2024-06-28 00:24:52 |
合計ジャッジ時間 | 6,868 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 2 TLE * 1 -- * 11 |
コンパイルメッセージ
main.cpp: In function ‘int main()’: main.cpp:16:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 16 | scanf("%d %d",&x,&N); | ~~~~~^~~~~~~~~~~~~~~
ソースコード
#include <iostream> #include <string> #include <vector> using namespace std; #define INF 2000000007 #define MOD 1000003 #define REP(i,n) for(int i=0;i<n;++i) typedef unsigned long long int ull; int main(){ int x,N; scanf("%d %d",&x,&N); vector<ull> a(N); for(int i=0;i<N;++i) cin >> a[i];//*/ int suml=0; for(int i=0;i<N;++i){ int y = 1; for(int j=0;j<a[i];++j){ y = (y*x)%MOD; } suml += y; } cout << suml << endl; return 0; }