Search found 12 matches

by liangchene
Mon Feb 27, 2006 6:00 am
Forum: Volume 100 (10000-10099)
Topic: 10067 - Playing with Wheels
Replies: 62
Views: 24053

wrong answer!?!?!

#include<iostream> #include<fstream> #include<vector> #include<algorithm> #include<deque> using namespace std; ifstream filein ("test.in"); int N; int n; struct set { int a,b,c,d,step; }; bool equal (set a, set b) { if (a.a!=b.a) return false; if (a.b!=b.b) return false; if (a.c!=b.c) return false; ...
by liangchene
Mon Feb 27, 2006 12:05 am
Forum: Volume 101 (10100-10199)
Topic: 10198 - Counting
Replies: 30
Views: 14227

I got wrong answer for this, can anybody tell me why?

#include<iostream> #include<string> using namespace std; int num; string counter[2000]; string add(string a, string b) { int x; if (a.size()<b.size()) swap(a,b); if (a.size()==b.size()) { for (x=b.size()-1;x>=1;x--) { a[x]+=b[x]-48; if (a[x]>57) { a[x]-=10; a[x-1]++; } } a[0]+=b[0]-48; if (a[0]>57) ...
by liangchene
Mon Feb 06, 2006 3:58 am
Forum: Volume 100 (10000-10099)
Topic: 10035 - Primary Arithmetic
Replies: 328
Views: 57022

WA, why?

#include<iostream> #include<fstream> #include<string> #include<algorithm> using namespace std; int add(string num1, string num2) { int sum =0; int x; if (num1<num2) swap(num1,num2); for (x=1;x<=num2.size();x++) { num1[num1.size()-x] += num2[num2.size()-x]; } for (x=num1.size()-1;x>0;x--) { if (num1[...
by liangchene
Tue Jan 31, 2006 11:30 pm
Forum: Volume 101 (10100-10199)
Topic: 10188 - Automated Judge Script
Replies: 58
Views: 30660

However, I got accepted.

strange
by liangchene
Tue Jan 31, 2006 9:36 pm
Forum: Volume 101 (10100-10199)
Topic: 10188 - Automated Judge Script
Replies: 58
Views: 30660

??? the problem says "No line will have more than 100 characters."
by liangchene
Mon Jan 30, 2006 10:58 pm
Forum: Volume 103 (10300-10399)
Topic: 10315 - Poker Hands
Replies: 63
Views: 27200

Thanks a lot.

it got accepted.

there's this bug in my program.

when you do the big shift, you have to have brackets around it

for example:

1+(2<<2) is different from 1+2<<2.

Strange.

anywayz, thx
by liangchene
Mon Jan 30, 2006 10:31 pm
Forum: Volume 101 (10100-10199)
Topic: 10188 - Automated Judge Script
Replies: 58
Views: 30660

Time limit exceeds (I checked all the test cases)

#include<iostream> #include<fstream> #include<string> #include<stdlib.h> using namespace std; //ifstream cin("test.txt"); string input[100]; string output[100]; int counter=1; bool pass; string dummy; string numerical1,numerical2; int main() { int num1,num2; int x,y; char line[101]; while(1) { cin>>...
by liangchene
Sat Jan 28, 2006 5:02 am
Forum: Volume 103 (10300-10399)
Topic: 10315 - Poker Hands
Replies: 63
Views: 27200

oh, that, it worked on my computer,

I think I had to incldue

#include<algorithm>

for the header file.

But still, the judge gives me Wrong Answer after I put it on
by liangchene
Thu Jan 26, 2006 9:15 pm
Forum: Volume 103 (10300-10399)
Topic: 10315 - Poker Hands
Replies: 63
Views: 27200

Jan, I got all the output right, and I tests many cases on my own, the judege still tells me I get the wrong answer. Here is my source code #include<iostream> #include<fstream> #include<string> #include<vector> using namespace std; //ifstream cin ("haha.txt"); struct card { long long num; char suit;...
by liangchene
Thu Jan 26, 2006 9:00 pm
Forum: Volume 100 (10000-10099)
Topic: 10010 - Where's Waldorf?
Replies: 42
Views: 18051

I keep getting wrong answers.
Is there any tricks to this problem?

all I did is go through all the points and search for all directions.
by liangchene
Thu May 19, 2005 6:11 am
Forum: Algorithms
Topic: rect1 problem on USACO 2.1
Replies: 0
Views: 738

rect1 problem on USACO 2.1

http://ace.delos.com/usacoprob2?a=gjE5pLjEuev&S=rect1

anybody solved this problem yet?
the hint is useful, but I don't know an efficient way to code it,
can anybody help?
thx

Go to advanced search