結果
| 問題 |
No.2784 繰り上がりなし十進和
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2024-06-14 22:29:18 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 1,165 ms / 2,000 ms |
| コード長 | 888 bytes |
| コンパイル時間 | 2,343 ms |
| コンパイル使用メモリ | 199,312 KB |
| 最終ジャッジ日時 | 2025-02-21 22:11:56 |
|
ジャッジサーバーID (参考情報) |
judge2 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 36 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i, n) for (int i = 0; i < (int)(n); ++i)
template<typename T>
bool chmax(T &a, T b) {
if (a < b) {
a = b;
return true;
}
return false;
}
template<typename T>
bool chmin(T &a, T b) {
if (a > b) {
a = b;
return true;
}
return false;
}
void solve();
int main() {
cin.tie(nullptr)->sync_with_stdio(false);
cout << fixed << setprecision(20);
int t = 1;
//cin >> t;
while (t--) {
solve();
}
}
vector<string>A(6);
int d[6][6];
set<int>st;
void solve() {
rep(i,6)cin>>A[i];
rep(i,6)rep(j,6)d[i][j]=A[i][j]-'0';
rep(i,1000000){
vector<int>sum(6);
int S=i;
rep(j,6){
int cnt=S%10;
S/=10;
rep(k,6)sum[k]+=d[j][k]*cnt;
}
rep(k,6)sum[k]%=10;
int v=0;
rep(k,6)v=10*v+sum[k]%10;
st.insert(v);
}
cout<<st.size()<<endl;
}