Here is my code. I got WA but I don't know what I have done wrongly. Please give some inputs that my code fails. Thanks.
#include <iostream>
#include <map>
#include <algorithm>
#include <sstream>
using namespace std;
map<string, long long> m;
string& replace_all(string& str,const string& old_val ...
Search found 16 matches
- Sun Oct 25, 2009 4:00 pm
- Forum: Volume 9 (900-999)
- Topic: 943 - Number Format Translator
- Replies: 4
- Views: 4410
- Fri Oct 16, 2009 5:01 am
- Forum: Volume 116 (11600-11699)
- Topic: 11659 - Informants
- Replies: 31
- Views: 13844
Re: 11659 - Informants
Please read carefully what I said :wink: :
If 1 is reliable , then
a)7 is not reliable, (since 7 says 1 is not reliable)
but you said:
i think there's a little prob with ur thinking.......in ur thinking...... if 1 is not reliable then 7 is obviously not reliable.......but i think thats not ...
If 1 is reliable , then
a)7 is not reliable, (since 7 says 1 is not reliable)
but you said:
i think there's a little prob with ur thinking.......in ur thinking...... if 1 is not reliable then 7 is obviously not reliable.......but i think thats not ...
- Wed Oct 14, 2009 6:20 am
- Forum: Volume 116 (11600-11699)
- Topic: 11659 - Informants
- Replies: 31
- Views: 13844
Re: 11659 - Informants
On that case, 2 can be also reliable.. :-)
Yes, 2 can be reliable. Please tell me whether my following logic to solve the problem is incorrect:
for each input of X and Y,
(
BX = The current state of X
BY = The current state of Y
If BX is not set and BY is not set
=> set BX = 1 or 0
If BX ...
- Tue Oct 13, 2009 7:43 am
- Forum: Volume 116 (11600-11699)
- Topic: 11659 - Informants
- Replies: 31
- Views: 13844
Re: 11659 - Informants
try this input
20 6
1 -3
2 -3
3 1
2 2
7 -1
4 3
the rigth out put should be 18......your code shows 19..... :wink:
I don't quite understand why this input causes 18. From my understanding,
If 1 is reliable, then
a) 7 is not reliable, (since 7 says 1 is not reliable) and
b) 3 is not ...
20 6
1 -3
2 -3
3 1
2 2
7 -1
4 3
the rigth out put should be 18......your code shows 19..... :wink:
I don't quite understand why this input causes 18. From my understanding,
If 1 is reliable, then
a) 7 is not reliable, (since 7 says 1 is not reliable) and
b) 3 is not ...
- Sun Oct 11, 2009 8:06 am
- Forum: Volume 116 (11600-11699)
- Topic: 11659 - Informants
- Replies: 31
- Views: 13844
Re: 11659 - Informants
My code passed the test cases as listed in this thread, but I still get WA. What is wrong with my code? Thanks.
#include <iostream>
using namespace std;
main() {
int i, a, x, y;
while (cin >> i >> a) {
if (i==0 && a==0) break;
bool b[i];
for (int j=0; j<i; j++)
b[j]=true;
for (int j=0 ...
#include <iostream>
using namespace std;
main() {
int i, a, x, y;
while (cin >> i >> a) {
if (i==0 && a==0) break;
bool b[i];
for (int j=0; j<i; j++)
b[j]=true;
for (int j=0 ...
- Wed Oct 07, 2009 11:52 am
- Forum: Volume 116 (11600-11699)
- Topic: 11659 - Informants
- Replies: 31
- Views: 13844
Re: 11659 - Informants
How about the following case:
Code: Select all
5 5
1 -2
2 -1
4 -1
3 -4
5 -3
- Tue Sep 29, 2009 8:15 am
- Forum: Volume 116 (11600-11699)
- Topic: 11679 - Sub-prime
- Replies: 1
- Views: 1990
11679 - Sub-prime
I got WA all the time for this problem. I guess I have overlooked something unsure, since my program passed the test cases given in the problem description. Could someone post some critical inputs? Thanks.
- Sun Jan 25, 2009 2:30 pm
- Forum: Volume 114 (11400-11499)
- Topic: 11489 - Integer Game
- Replies: 9
- Views: 6463
Re: 11489 - Integer Game
Some one can explain these case???
INPUT:
2
44455
44555
OUTPUT:
S
S
Why???
I am confused. :-?
This is because:
A player can remove a particular digit if the sum of digits of the resulting number is a multiple of 3 or there are no digits left.
Since S moves first, the obvious way is to ...
INPUT:
2
44455
44555
OUTPUT:
S
S
Why???
I am confused. :-?
This is because:
A player can remove a particular digit if the sum of digits of the resulting number is a multiple of 3 or there are no digits left.
Since S moves first, the obvious way is to ...
- Thu Jan 01, 2009 11:56 am
- Forum: Volume 115 (11500-11599)
- Topic: 11571 - Simple Equations - Extreme!!
- Replies: 31
- Views: 16515
Re: 11571 - Simple Equations - Extreme!!
I have tried to tackle this problem but I am getting WA. I have passed the given input in this thread. here is my code:
#include <iostream>
#include <cmath>
using namespace std;
main() {
int n;
long double a, b, c, x, y, z;
long double p, q, d, u, v, phi, e, e1;
double pi = acos(-1.0 ...
#include <iostream>
#include <cmath>
using namespace std;
main() {
int n;
long double a, b, c, x, y, z;
long double p, q, d, u, v, phi, e, e1;
double pi = acos(-1.0 ...
- Sun Sep 21, 2008 5:32 am
- Forum: Volume 114 (11400-11499)
- Topic: 11489 - Integer Game
- Replies: 9
- Views: 6463
Re: 11489 - Integer Game how to solve?
LayCurse, thanks for your input. I modified my code and finally passed the test case above. However, I am still getting WA. Could somebody helps what test case my code below will fail? Thanks a lot.
#include <iostream>
using namespace std;
main() {
int n;
cin >> n;
for (int i=0; i<n; i ...
#include <iostream>
using namespace std;
main() {
int n;
cin >> n;
for (int i=0; i<n; i ...
- Sat Sep 20, 2008 12:58 pm
- Forum: Volume 114 (11400-11499)
- Topic: 11489 - Integer Game
- Replies: 9
- Views: 6463
Re: 11489 - Integer Game how to solve?
I am getting WA all the time. Please help to give some critical inputs. Thanks.
#include <iostream>
using namespace std;
int main() {
int n;
cin >> n;
for (int i=0; i<n; i++) {
string s;
cin >> s;
int n2 = s.size();
cout << "Case " << (i+1) << ": ";
// cout << s << " - ";
if (n2==1 ...
#include <iostream>
using namespace std;
int main() {
int n;
cin >> n;
for (int i=0; i<n; i++) {
string s;
cin >> s;
int n2 = s.size();
cout << "Case " << (i+1) << ": ";
// cout << s << " - ";
if (n2==1 ...
- Sun Feb 24, 2008 4:30 pm
- Forum: Volume 100 (10000-10099)
- Topic: 10058 - Jimmi's Riddles
- Replies: 22
- Views: 8805
- Sun Dec 16, 2007 8:17 am
- Forum: Volume 4 (400-499)
- Topic: 485 - Pascal's Triangle of Death
- Replies: 50
- Views: 12869
- Sun Nov 04, 2007 4:42 pm
- Forum: Volume 4 (400-499)
- Topic: 471 - Magic Numbers
- Replies: 29
- Views: 15854
- Sun Nov 04, 2007 8:42 am
- Forum: Volume 4 (400-499)
- Topic: 495 - Fibonacci Freeze
- Replies: 222
- Views: 59991