# UVa10268 - 498-bis [Prblem link](https://onlinejudge.org/external/102/10268.pdf) ## Review ### 盡量不要用pow ### sstream ```cpp= stringstream s(input); while(s>>temp) poly.push_back(temp); ``` ## Ans ```cpp= #include <iostream> #include <algorithm> #include <sstream> #include <vector> #include <string> using namespace std; int main(){ long long int val; vector<long long int> poly; while(cin>>val){ long long int temp,ans=0,mul=1; string input; getline(cin,input); getline(cin,input); stringstream s(input); poly.clear(); while(s>>temp) poly.push_back(temp); reverse(poly.begin(),poly.end()); for(int i=1;i<poly.size();i++){ ans+=poly[i]*i*mul; mul*=val; } cout<<ans<<endl; } } ```
×
Sign in
Email
Password
Forgot password
or
By clicking below, you agree to our
terms of service
.
Sign in via Facebook
Sign in via Twitter
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
New to HackMD?
Sign up