結果
| 問題 |
No.2784 繰り上がりなし十進和
|
| コンテスト | |
| ユーザー |
たたき@競プロ
|
| 提出日時 | 2024-06-22 14:26:14 |
| 言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 1,200 ms / 2,000 ms |
| コード長 | 989 bytes |
| コンパイル時間 | 5,877 ms |
| コンパイル使用メモリ | 315,196 KB |
| 実行使用メモリ | 81,792 KB |
| 最終ジャッジ日時 | 2024-06-22 14:26:51 |
| 合計ジャッジ時間 | 30,554 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 36 |
ソースコード
#include<bits/stdc++.h>
using namespace std;
#include <atcoder/all>
using namespace atcoder;
using mint=modint998244353; //1000000007;
using ll=long long;
using pp=pair<int,int>;
#define sr string
#define vc vector
#define fi first
#define se second
#define rep(i,n) for(int i=0;i<(int)n;i++)
#define pb push_back
#define all(v) v.begin(),v.end()
#define pque priority_queue
#define bpc(a) __builtin_popcount(a)
int main(){
int t=6;
auto f=[&](sr a,sr b)->sr{
sr res=a;
rep(i,t){
int xa=a[i]-'0';
int xb=b[i]-'0';
xa=(xa+xb)%10;
res[i]='0'+xa;
}
return res;
};
auto ff=[&](sr a,int x)->sr{
rep(i,t){
int d=a[i]-'0';
d*=x;
d%=10;
a[i]='0'+d;
}
return a;
};
set<sr>s;
vc<sr>v(t); rep(i,t)cin>>v[i];
rep(i,1000000){
auto ni=i;
sr now=sr(t,'0');
rep(j,t){
int a=ni%10;
now=f(now,ff(v[j],a));
ni/=10;
}
s.insert(now);
}
int ans=s.size();
cout<<ans;
}
たたき@競プロ