답안 #142910

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
142910 2019-08-12T07:03:00 Z IC_COLDSTOP Toys (CEOI18_toy) C++17
0 / 100
220 ms 262144 KB
#include<bits/stdc++.h>

using namespace std;
#define ll long long
//#define int ll
#define MP make_pair
#define pb push_back
#define F first
#define S second
#define REP(i,a,b) for(int i=a; i<b; i++)
#define pii pair<int,int>

const int MX=1e7+3, mod=1e9+7;

int n;
set<int> st;
unordered_map<int,int> mark[MX];

void ANS(int u, int v){
	if(mark[v][u]) return;
	mark[v][u]=1;
	st.insert(u-1+v);
	for(int i=2; i<=sqrt(u); i++) if(u%i==0) ANS(u/i, v+i-1);
}

int32_t main(){
	ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
	cin>>n;
	ANS(n,0);
	cout<<st.size()<<endl;
	for(auto u:st) cout<<u<<" ";
	cout<<endl;
	return 0;
}
# 결과 실행 시간 메모리 Grader output
1 Runtime error 220 ms 262144 KB Execution killed with signal 9 (could be triggered by violating memory limits)
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Runtime error 220 ms 262144 KB Execution killed with signal 9 (could be triggered by violating memory limits)
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Runtime error 220 ms 262144 KB Execution killed with signal 9 (could be triggered by violating memory limits)
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Runtime error 220 ms 262144 KB Execution killed with signal 9 (could be triggered by violating memory limits)
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Runtime error 220 ms 262144 KB Execution killed with signal 9 (could be triggered by violating memory limits)
2 Halted 0 ms 0 KB -