結果

問題 No.1343 Dividing Digit
ユーザー friedrice
提出日時 2024-12-01 15:02:03
言語 C++23
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 441 bytes
コンパイル時間 5,406 ms
コンパイル使用メモリ 307,416 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-12-01 15:02:11
合計ジャッジ時間 7,046 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other WA * 22
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
#include <bits/stdc++.h>
#include <atcoder/all>
using namespace std;
using ll = long long;
using mint = atcoder::modint998244353;
using maxt = atcoder::modint1000000007;

int main() {
	ll N, K;
	cin >> N >> K;
	vector<ll> A(N);
	ll sum = 0;
	for(ll &o : A) {
	  cin >> o;
	  sum += o;
	}
  ll a = 0;
  ll tmp = 1;
	for(int i = N - 1; i >= 0; i--) {
	  a += A.at(i) * tmp;
	  tmp *= K;
	}
	cout << a % sum << endl;
}
0