제출 #458218

#제출 시각아이디문제언어결과실행 시간메모리
458218cpp219Toys (CEOI18_toy)C++14
0 / 100
169 ms262148 KiB
#pragma GCC optimization O2 #pragma GCC optimization "unroll-loop" #pragma target ("avx2") #include <bits/stdc++.h> #define ll int #define ld long double #define fs first #define sc second using namespace std; typedef pair<ll,ll> LL; const ll N = 1e5 + 9; const ll Log2 = 21; const ll inf = 1e9 + 7; set<ll> s; map<LL,ll> mp; vector<ll> uoc; ll n; void f(ll rm,ll mn,ll sum){ s.insert(sum + rm - 1); for (ll i = 0;i < uoc.size();i++){ ll now = uoc[i]; if (now > rm/now) break; if (rm % now == 0) f(rm/now,i,sum + now - 1); } } int main(){ ios_base::sync_with_stdio(NULL); cin.tie(0); cout.tie(0); #define task "tst" if (fopen(task".INP","r")){ freopen(task".INP","r",stdin); //freopen(task".OUT","w",stdout); } cin>>n; uoc.push_back(n); for (ll i = 2;i <= n/i;i++){ if (n%i == 0){ uoc.push_back(i); if (n/i != i) uoc.push_back(n/i); } } sort(uoc.begin(),uoc.end()); f(n,0,0); cout<<s.size()<<"\n"; for (auto i : s) cout<<i<< " "; }

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

toy.cpp:1: warning: ignoring '#pragma GCC optimization' [-Wunknown-pragmas]
    1 | #pragma GCC optimization O2
      | 
toy.cpp:2: warning: ignoring '#pragma GCC optimization' [-Wunknown-pragmas]
    2 | #pragma GCC optimization "unroll-loop"
      | 
toy.cpp:3: warning: ignoring '#pragma target ' [-Wunknown-pragmas]
    3 | #pragma target ("avx2")
      | 
toy.cpp: In function 'void f(int, int, int)':
toy.cpp:23:21: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   23 |     for (ll i = 0;i < uoc.size();i++){
      |                   ~~^~~~~~~~~~~~
toy.cpp: In function 'int main()':
toy.cpp:34:16: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
   34 |         freopen(task".INP","r",stdin);
      |         ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~
#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...