結果
問題 | No.2784 繰り上がりなし十進和 |
ユーザー |
![]() |
提出日時 | 2024-06-15 14:54:55 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 195 ms / 2,000 ms |
コード長 | 771 bytes |
コンパイル時間 | 2,255 ms |
コンパイル使用メモリ | 200,292 KB |
最終ジャッジ日時 | 2025-02-21 22:45:39 |
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 36 |
ソースコード
#include <bits/stdc++.h>#define rep(i) for (int i = 0; i < 10; i++)using namespace std;int main() {vector<string> s(6);for (int i = 0; i < 6; i++) {cin >> s[i];}vector<bool> can(1000000, false);rep(a) rep(b) rep(c) rep(d) rep(e) rep(f) {vector<int> v = {a, b, c, d, e, f};string res = "000000";for (int i = 0; i < 6; i++) {string t = s[i];for (int j = 0; j < 6; j++) {int x = ((res[j] - '0') + (t[j] - '0') * v[i]) % 10;res[j] = (char)(x + 48);}}can[stoi(res)] = true;}int ans = 0;for (int i = 0; i < 1000000; i++) {if (can[i]) {ans++;}}cout << ans << endl;}