The function would be.. f(n) = an² + bn + c
Sample Input
0 0 10 5 100
0 0 10 6 100
1 2 3 4 5
1 2 3 3 5
0 0 0 0 0
Sample Output
101
0
0
4
3rd and 4th testcase are not the same...
Search found 7 matches
- Tue Mar 15, 2011 1:02 pm
- Forum: Volume 119 (11900-11999)
- Topic: 11934 - Magic Formula
- Replies: 6
- Views: 4407
11934 - Magic Formula
- Fri Feb 11, 2011 5:51 pm
- Forum: Volume 118 (11800-11899)
- Topic: 11858 - Frosh Week
- Replies: 20
- Views: 7668
11858 - Frosh Week
Use simple merge sort. As I did, apply merge sort to count the swaps..
- Tue Jul 13, 2010 11:24 pm
- Forum: Volume 117 (11700-11799)
- Topic: 11718 - Fantasy of a Summation
- Replies: 2
- Views: 3267
11718 - Fantasy of a Summation
What's the problem...
Output is okay for the test cases..
But wrong answer!!
Where's the bug ?
Help me to find it out..
Thanks in advance..
Here's my code...
#include<iostream>
#include<math.h>
using namespace std;
int main(void)
{
int t,c=1;
unsigned long long n,k,mod,w,i,sum,f,ans;
cin ...
Output is okay for the test cases..
But wrong answer!!
Where's the bug ?
Help me to find it out..
Thanks in advance..
Here's my code...
#include<iostream>
#include<math.h>
using namespace std;
int main(void)
{
int t,c=1;
unsigned long long n,k,mod,w,i,sum,f,ans;
cin ...
- Wed Jul 07, 2010 1:13 pm
- Forum: Volume 116 (11600-11699)
- Topic: 11609 - Teams
- Replies: 11
- Views: 7557
Re: 11609 ' Why WA !!
Now I've got Accepted.
Thanks for helping.
Thanks for helping.

- Wed Jul 07, 2010 12:48 pm
- Forum: Volume 116 (11600-11699)
- Topic: 11609 - Teams
- Replies: 11
- Views: 7557
Re: 11609 ' Why WA !!
Yes, Bro..
I'm trying it now Bigmod method.
I'm trying it now Bigmod method.
- Wed Jul 07, 2010 12:34 pm
- Forum: Volume 116 (11600-11699)
- Topic: 11609 - Teams
- Replies: 11
- Views: 7557
Re: 11609 ' Why WA !!
Thanks!!
I've fixed it. Got that point.
I've fixed it. Got that point.
- Tue Jul 06, 2010 10:04 pm
- Forum: Volume 116 (11600-11699)
- Topic: 11609 - Teams
- Replies: 11
- Views: 7557
11609 ' Why WA !!
#include<stdio.h>
#include<math.h>
#define mod 1000000007
int main()
{
int n,i;
unsigned long m,p;
scanf("%d",&n);
for(i=1; i<=n; i++)
{
scanf("%lu",&m);
p=pow(2,(m-1));
printf("Case #%d: %lu\n",i,(m*p)%mod);
}
return 0;
}