結果
問題 | No.2784 繰り上がりなし十進和 |
ユーザー |
![]() |
提出日時 | 2024-06-18 23:13:35 |
言語 | C++17(gcc12) (gcc 12.3.0 + boost 1.87.0) |
結果 |
TLE
|
実行時間 | - |
コード長 | 1,052 bytes |
コンパイル時間 | 2,584 ms |
コンパイル使用メモリ | 211,260 KB |
実行使用メモリ | 291,360 KB |
最終ジャッジ日時 | 2024-06-18 23:13:42 |
合計ジャッジ時間 | 6,691 ms |
ジャッジサーバーID (参考情報) |
judge3 / 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(); }