What's the catch with problem 120? Here's my code:
[cpp]#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <iterator>
using namespace std;
void solve(vector<int>& stack, int start) {
if(start==stack.size()) return;
int minpos = start;
for(int c = start; c ...
Search found 3 matches
- Sun Jun 15, 2003 11:51 pm
- Forum: Volume 1 (100-199)
- Topic: 120 - Stacks of Flapjacks
- Replies: 118
- Views: 30833
- Sun Jun 15, 2003 8:27 pm
- Forum: Volume 1 (100-199)
- Topic: 101 - The Blocks Problem
- Replies: 635
- Views: 110654
101 - Memory Limit Exceeded
The code works flawlessly on the given examples. Any ideas?
[cpp] #include <iostream>
#include <vector>
#include <algorithm>
#include <list>
#include <string>
using namespace std;
typedef vector< list<int> > blocktype;
void printblocks(blocktype b, vector<int> i) {
int c=0;
for(blocktype ...
[cpp] #include <iostream>
#include <vector>
#include <algorithm>
#include <list>
#include <string>
using namespace std;
typedef vector< list<int> > blocktype;
void printblocks(blocktype b, vector<int> i) {
int c=0;
for(blocktype ...
- Sat Jun 14, 2003 9:47 am
- Forum: Volume 1 (100-199)
- Topic: 105 - The Skyline Problem
- Replies: 160
- Views: 51855
105 - Unseen trouble?
My code for problem 105 works fine for all tests I've done, but still gets WA by the Judge. Are there any evil special cases I might have missed?
May the data contain buildings with leftcoordinade == rightcoordinate?
May the data contain buildings with leftcoordinade == rightcoordinate?