#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 ...
Search found 12 matches
- Mon Feb 27, 2006 6:00 am
- Forum: Volume 100 (10000-10099)
- Topic: 10067 - Playing with Wheels
- Replies: 62
- Views: 35477
- Mon Feb 27, 2006 12:05 am
- Forum: Volume 101 (10100-10199)
- Topic: 10198 - Counting
- Replies: 30
- Views: 44473
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 ...
#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 ...
- Mon Feb 06, 2006 3:58 am
- Forum: Volume 100 (10000-10099)
- Topic: 10035 - Primary Arithmetic
- Replies: 328
- Views: 101978
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 ...
#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 ...
- Tue Jan 31, 2006 11:30 pm
- Forum: Volume 101 (10100-10199)
- Topic: 10188 - Automated Judge Script
- Replies: 58
- Views: 37403
- Tue Jan 31, 2006 11:27 pm
- Forum: Volume 101 (10100-10199)
- Topic: 10188 - Automated Judge Script
- Replies: 58
- Views: 37403
- Tue Jan 31, 2006 9:36 pm
- Forum: Volume 101 (10100-10199)
- Topic: 10188 - Automated Judge Script
- Replies: 58
- Views: 37403
- Mon Jan 30, 2006 10:58 pm
- Forum: Volume 103 (10300-10399)
- Topic: 10315 - Poker Hands
- Replies: 63
- Views: 38645
- Mon Jan 30, 2006 10:31 pm
- Forum: Volume 101 (10100-10199)
- Topic: 10188 - Automated Judge Script
- Replies: 58
- Views: 37403
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 ...
#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 ...
- Sat Jan 28, 2006 5:02 am
- Forum: Volume 103 (10300-10399)
- Topic: 10315 - Poker Hands
- Replies: 63
- Views: 38645
- Thu Jan 26, 2006 9:15 pm
- Forum: Volume 103 (10300-10399)
- Topic: 10315 - Poker Hands
- Replies: 63
- Views: 38645
- Thu Jan 26, 2006 9:00 pm
- Forum: Volume 100 (10000-10099)
- Topic: 10010 - Where's Waldorf?
- Replies: 42
- Views: 26091
- Thu May 19, 2005 6:11 am
- Forum: Algorithms
- Topic: rect1 problem on USACO 2.1
- Replies: 0
- Views: 998
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
anybody solved this problem yet?
the hint is useful, but I don't know an efficient way to code it,
can anybody help?
thx