Search found 5 matches

by swpeng
Thu Apr 27, 2006 12:50 pm
Forum: Volume 4 (400-499)
Topic: 485 - Pascal's Triangle of Death
Replies: 50
Views: 12928


if(stra[x]==0x00){
aout=true;
}
if(strb[x]==0x00){
bout=true;
}

This is wrong.

A correct way to implement this check:
aout=!(x<stra.size());
bout=!(x<strb.size());



I change my code as those codes above and got AC. But I compiled the old codes and new coeds for comparison and there ...
by swpeng
Wed Apr 26, 2006 7:01 pm
Forum: Volume 4 (400-499)
Topic: 485 - Pascal's Triangle of Death
Replies: 50
Views: 12928

485...WA

i got WA but i think my last line should be right. can anyone tell me what's wrong with my code? thanks.



1 204 20706 1394204 70058751 2802350040 92944609660 2629004673240 64739240078535 1409876783932540 27492597286684530 484869443056072620 7798316875818501305 115175141550550173120 ...
by swpeng
Tue Oct 25, 2005 10:33 am
Forum: Volume 6 (600-699)
Topic: 639 - Don't Get Rooked
Replies: 11
Views: 11785

639 -WA

I got WA on 639, and I have tried a lot of cases. Can anyone help me with my problem or provide me inputs?


#include<iostream>

using namespace std;

const int mmax=5;
int mapmax;
char map[mmax+1][mmax+1];
int dotmax;

void track(int y,int x,char ch){
int i;
//y->i
for(i=y-1;i>=0;i--){
if(map ...
by swpeng
Wed Jun 15, 2005 8:57 pm
Forum: Volume 4 (400-499)
Topic: 492 - Pig-Latin
Replies: 213
Views: 49627

thanks....I fixed the code and submitted it again, and I got AC!

(No array)


#include<iostream>

using namespace std;

bool isv(char);

int head;

int main(){
char w,wal;
head=0;
while(cin.get(w)){
if((w>=0x41 && w<=0x5A) || (w>=0x61 && w<=0x7A)){
if(head==0){
if(isv(w)){
head=1;
cout<<w ...
by swpeng
Sun Jun 12, 2005 2:17 pm
Forum: Volume 4 (400-499)
Topic: 492 - Pig-Latin
Replies: 213
Views: 49627

492 WA

why I got WA? I had tried all the cases....


#include<iostream>

using namespace std;


const int cmax=150000;
char ch[cmax+1];
int chx;

void anaout();
bool isv(char);

int main(){
char chline[cmax+1];
int x;
while(cin.getline(chline,cmax)){
for(x=0,chx=0;;x++){
if((chline[x]>=0x41 && chline ...

Go to advanced search