結果
問題 |
No.3235 巡回減算
|
ユーザー |
|
提出日時 | 2025-08-16 13:21:07 |
言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 500 ms / 10,000 ms |
コード長 | 853 bytes |
コンパイル時間 | 2,925 ms |
コンパイル使用メモリ | 278,812 KB |
実行使用メモリ | 7,716 KB |
最終ジャッジ日時 | 2025-08-16 13:21:21 |
合計ジャッジ時間 | 12,665 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 30 |
ソースコード
#include <bits/stdc++.h> #define int long long using namespace std; signed main(){ ios::sync_with_stdio(false); cin.tie(nullptr); const int n=8; vector<int>a(n); for(int i=0;i<n;i++)cin>>a[i]; int lim=1; for(int j=0;j<7;j++)lim*=n; for(int d=0;d<lim;d++){ vector<int>time; int now=d; for(int i=0;i<n;i++){ time.push_back(now%n); now/=n; } // for(int i:time)cout<<i<<" ";cout<<endl; int cur=a[0]; for(int i=1;i<n;i++){ for(int j=0;j<time[i-1];j++){ int num=cur/((int)1e7); cur%=(int)1e7; cur*=10; cur+=num; } cur-=a[i]; } if(cur==0){ cout<<"Yes"<<endl; return 0; } } cout<<"No"<<endl; }