結果
| 問題 |
No.1243 約数加算
|
| コンテスト | |
| ユーザー |
umezo
|
| 提出日時 | 2020-10-02 22:26:57 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 662 bytes |
| コンパイル時間 | 2,027 ms |
| コンパイル使用メモリ | 200,672 KB |
| 最終ジャッジ日時 | 2025-01-15 00:38:59 |
|
ジャッジサーバーID (参考情報) |
judge2 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | WA * 1 |
| other | WA * 4 TLE * 5 |
ソースコード
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define ALL(v) v.begin(),v.end()
typedef long long ll;
#include <bits/stdc++.h>
using namespace std;
int main(){
int t;
cin>>t;
while(t--){
ll a,b;
cin>>a>>b;
vector<ll> B;
while(a<b){
vector<ll> A;
ll n=a;
for(ll i=1;i*i<=n;i++){
if(n%i==0){
A.push_back(i);
if(i*i!=n) A.push_back(n/i);
}
}
sort(ALL(A));
auto itr=upper_bound(ALL(A),b-a);
itr--;
a+=*itr;
B.push_back(*itr);
}
rep(i,B.size()){
if(i) cout<<" ";
cout<<B[i];
}
cout<<endl;
}
return 0;
}
umezo