제출 #78899

#제출 시각아이디문제언어결과실행 시간메모리
78899aminraToys (CEOI18_toy)C++14
59 / 100
92 ms3440 KiB
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef long double ld; const int MOD = (int)1e9 + 7; const int MAXN = (int)3000 + 7; const int infint = (int)1e9; vector<int> dv, c[MAXN]; vector<int> dp[MAXN]; int main() { ios::sync_with_stdio(false); cin.tie(0); cout.tie(0); int n; cin >> n; for (int i = 1; i * i <= n; i++) { dv.push_back(i); if(i * i != n) dv.push_back(n / i); } sort(dv.begin(), dv.end()); dp[0].push_back(0); for (int i = 1; i < dv.size(); i++) { for (int j = 0; j < i; j++) if(dv[i] % dv[j] == 0) for (auto u : dp[j]) dp[i].push_back(u + dv[i] / dv[j] - 1); sort(dp[i].begin() , dp[i].end()), dp[i].resize(unique(dp[i].begin(),dp[i].end()) - dp[i].begin()); } cout << dp[dv.size() - 1].size() << "\n"; for (auto u : dp[dv.size() - 1]) cout << u << " "; }

컴파일 시 표준 에러 (stderr) 메시지

toy.cpp: In function 'int main()':
toy.cpp:24:20: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
  for (int i = 1; i < dv.size(); i++)
                  ~~^~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...