#include <iostream>
#include <chrono>
#include <cmath>
using namespace std;
using namespace chrono;
const int TIMES = 10000000;
int main() {
auto start = system_clock::now();
double s = 0.0;
for(int i=0;i<TIMES;++i){
double x = static_cast<double>(i);
s += x*x*x;
}
cout<<s<<" counted by mult in "<< (duration_cast<milliseconds>(system_clock::now()-start).count())<<"ms"<<endl;
start = system_clock::now();
s = 0.0;
for(int i=0;i<TIMES;++i){
double x = static_cast<double>(i);
s += pow(x,3);
}
cout<<s<<" counted by pow in "<< (duration_cast<milliseconds>(system_clock::now()-start).count())<<"ms"<<endl;
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8Y2hyb25vPgojaW5jbHVkZSA8Y21hdGg+Cgp1c2luZyBuYW1lc3BhY2Ugc3RkOwp1c2luZyBuYW1lc3BhY2UgY2hyb25vOwoKY29uc3QgaW50IFRJTUVTID0gMTAwMDAwMDA7CgppbnQgbWFpbigpIHsKCWF1dG8gc3RhcnQgPSBzeXN0ZW1fY2xvY2s6Om5vdygpOwoJZG91YmxlIHMgPSAwLjA7Cglmb3IoaW50IGk9MDtpPFRJTUVTOysraSl7CgkJZG91YmxlIHggPSBzdGF0aWNfY2FzdDxkb3VibGU+KGkpOwoJCXMgKz0geCp4Kng7Cgl9Cgljb3V0PDxzPDwiIGNvdW50ZWQgYnkgbXVsdCBpbiAiPDwgKGR1cmF0aW9uX2Nhc3Q8bWlsbGlzZWNvbmRzPihzeXN0ZW1fY2xvY2s6Om5vdygpLXN0YXJ0KS5jb3VudCgpKTw8Im1zIjw8ZW5kbDsJCglzdGFydCA9IHN5c3RlbV9jbG9jazo6bm93KCk7CglzID0gMC4wOwoJZm9yKGludCBpPTA7aTxUSU1FUzsrK2kpewoJCWRvdWJsZSB4ID0gc3RhdGljX2Nhc3Q8ZG91YmxlPihpKTsKCQlzICs9IHBvdyh4LDMpOwoJfQoJY291dDw8czw8IiBjb3VudGVkIGJ5IHBvdyBpbiAiPDwgKGR1cmF0aW9uX2Nhc3Q8bWlsbGlzZWNvbmRzPihzeXN0ZW1fY2xvY2s6Om5vdygpLXN0YXJ0KS5jb3VudCgpKTw8Im1zIjw8ZW5kbDsKCXJldHVybiAwOwp9