# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
1070351 | YassirSalama | Toys (CEOI18_toy) | C++17 | 748 ms | 262144 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include<bits/stdc++.h>
using namespace std;
#define pb push_back
#define int long long
template<typename T>
void dbg(const T& t){
cout<<t<<endl;
}
template<typename T,typename... Args>
void dbg(const T& t,const Args&... args){
cout<<t<<" , ";
dbg(args...);
}
#define dbg(...) cout<<"("<<#__VA_ARGS__<<") : ";dbg(__VA_ARGS__);
vector<int> factor(int n){
set<int> d;
for(int i=1;i<=n;i++){
if(n%i==0){
int a=i;
int b=n/a;
if(a==b){
d.insert(a);
}else{
d.insert(a);
d.insert(b);
}
}
}
vector<int> dd(d.begin(),d.end());
return dd;
}
#define all(v) v.begin(),v.end()
signed main(){
int n;
cin>>n;
int x=n;
vector<int> p;
for(int i=2;i*i<=n;i++){
while(n%i==0){
p.pb(i);
n/=i;
}
}
if(n!=1) p.pb(n);
sort(all(p));
set<vector<int>> decomp;
decomp.insert({1});
for(auto pp : p){
set<vector<int>> c;
for(auto x:decomp){
vector<int> a=x;
for(auto &el : a){
el*=pp;
c.insert(a);
el/=pp;
}
a.pb(pp);
c.insert(a);
}
decomp=c;
}
set<int> ans;
for(auto x:decomp){
int s=0;
for(auto y:x){
s+=y-1;
}
ans.insert(s);
}
cout<<ans.size()<<endl;
for(auto x:ans){
cout<<x<<" ";
}
cout<<endl;
}
컴파일 시 표준 에러 (stderr) 메시지
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |