結果
| 問題 | 
                            No.2784 繰り上がりなし十進和
                             | 
                    
| コンテスト | |
| ユーザー | 
                             inksamurai
                         | 
                    
| 提出日時 | 2024-06-18 23:13:35 | 
| 言語 | C++17  (gcc 13.3.0 + boost 1.87.0)  | 
                    
| 結果 | 
                             
                                TLE
                                 
                             
                            
                         | 
                    
| 実行時間 | - | 
| コード長 | 1,052 bytes | 
| コンパイル時間 | 2,456 ms | 
| コンパイル使用メモリ | 204,216 KB | 
| 最終ジャッジ日時 | 2025-02-21 23:16:39 | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge5 / judge1 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| other | AC * 2 TLE * 1 -- * 33 | 
ソースコード
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<n;i++)
#define per(i,n) for(int i=n-1;i>=0;i--)
#define rng(i,c,n) for(int i=c;i<n;i++)
#define fi first
#define se second
#define pb push_back
#define sz(a) (int) a.size()
#define all(a) a.begin(),a.end()
#define vec(...) vector<__VA_ARGS__>
#define _4c5UlRw ios::sync_with_stdio(0),cin.tie(0)
typedef long long ll;
typedef vector<int> vi;
typedef pair<int,int> pii;
void print(){cout<<'\n';}
template<class h,class...t>
void print(const h&v,const t&...u){cout<<v<<' ',print(u...);}
void slv(){
	int n=6;
	vec(string) a(n);
	rep(i,n){
		cin>>a[i];
	}
	map<string,int> mp;
	auto dfs=[&](auto self,string s)->void{
		mp[s]=1;
		rep(i,n){
			string ne_s=s;
			rep(j,n){
				int x=s[j]-'0';
				x+=(a[i][j]-'0');
				x%=10;
				ne_s[j]=x+'0';
			}
			// print(ne_s);
			// continue;
			if(mp.find(ne_s)==mp.end()){
				self(self,ne_s);
			}
		}
	};
	rep(i,n){
		dfs(dfs,a[i]);
	}
	// for(auto p:mp){
	// 	print(p.fi);
	// }
	print(sz(mp));
}
signed main(){
_4c5UlRw;
	slv();
}
            
            
            
        
            
inksamurai