|
|
back to boardWhy my program get WA #18 ? Posted by WiN_uA 4 Aug 2009 15:38 #include <iostream> using namespace std; int main() { unsigned long long n,a,b,c,s; int i; unsigned long long x[100001]; memset(x,0,sizeof(x)); cin>>n; for (i=1;i<=n+1;i++) { cin>>a>>b>>c; x[a]=x[a]+c; x[b+1]=x[b+1]-c; };s=0; for (i=1;i<=n;i++) { s=s+x[i]; if (i==n) cout<<s<<endl; else cout<<s<<" "; } }; Re: Why my program get WA #18 ? tried to make this code faster, but seems its imposible Re: Why my program get WA #18 ? just use vector |
|
|