Getting WA. May I get some test cases.
#include <bits/stdc++.h>
using namespace std;
const int MAX = 30;
struct Return {
int time, serial;
Return() {}
Return(int time, int serial) {
this->time = time;
this->serial = serial;
}
};
int symbols[MAX], revSymbols[MAX];
int timeNeeded[MAX][MAX ...
Search found 9 matches
- Mon Aug 31, 2015 3:20 pm
- Forum: Volume 122 (12200-12299)
- Topic: 12276 - Assembly line
- Replies: 0
- Views: 7379
- Mon Aug 24, 2015 10:24 am
- Forum: Volume 119 (11900-11999)
- Topic: 11906 - Knight in a War Grid
- Replies: 13
- Views: 10232
- Wed Jan 14, 2015 4:08 pm
- Forum: Volume 12 (1200-1299)
- Topic: 1231 - ACORN
- Replies: 3
- Views: 2644
Re: 1231 - ACORN
Thanks for the hint. I'll try it again.
However, I was wondering why my code gets TLE while this one gets AC. Seems similar to mine. Just wanted to understand how the complexity was improved.
*code removed*
However, I was wondering why my code gets TLE while this one gets AC. Seems similar to mine. Just wanted to understand how the complexity was improved.
*code removed*
- Mon Jan 12, 2015 2:33 pm
- Forum: Volume 12 (1200-1299)
- Topic: 1231 - ACORN
- Replies: 3
- Views: 2644
Re: 1231 - ACORN
Getting TLE. Any help on how to make it efficient will be highly appreciated.
#include <bits/stdc++.h>
using namespace std;
int t, h, f;
//vector<int> acorn[2010];
int acorn[2010][2010];
int dp[2010][2010];
bool vis[2010][2010];
int func(int, int);
int main() {
int c;
scanf("%d", &c);
while ...
#include <bits/stdc++.h>
using namespace std;
int t, h, f;
//vector<int> acorn[2010];
int acorn[2010][2010];
int dp[2010][2010];
bool vis[2010][2010];
int func(int, int);
int main() {
int c;
scanf("%d", &c);
while ...
- Thu Jan 01, 2015 9:57 am
- Forum: Volume 110 (11000-11099)
- Topic: 11034 - Ferry Loading IV
- Replies: 15
- Views: 10681
Re: 11034 - Ferry Loading IV
Getting WA :(
Please provide some test cases.
#include <bits/stdc++.h>
using namespace std;
int main() {
//freopen("input.txt", "r", stdin);
//freopen("output.txt", "w", stdout);
int t;
scanf("%d", &t);
getchar();
while(t--) {
int l, m;
scanf("%d %d", &l, &m);
getchar();
if(m == 0 ...
Please provide some test cases.
#include <bits/stdc++.h>
using namespace std;
int main() {
//freopen("input.txt", "r", stdin);
//freopen("output.txt", "w", stdout);
int t;
scanf("%d", &t);
getchar();
while(t--) {
int l, m;
scanf("%d %d", &l, &m);
getchar();
if(m == 0 ...
- Mon Apr 07, 2014 3:18 pm
- Forum: Volume 3 (300-399)
- Topic: 314 - Robot
- Replies: 30
- Views: 11891
Re: 314, Robot, Help!
Getting WA. Please help!
#include <bits/stdc++.h>
#define MAX 55
using namespace std;
void trans(int, int);
int m, n, mat[MAX][MAX], mat2[MAX][MAX];
struct square{int x, y, dir; square() {} square(int a, int b) {x = a; y = b;} square(int a, int b, int c) {x = a; y = b; dir = c;}};
map<string ...
#include <bits/stdc++.h>
#define MAX 55
using namespace std;
void trans(int, int);
int m, n, mat[MAX][MAX], mat2[MAX][MAX];
struct square{int x, y, dir; square() {} square(int a, int b) {x = a; y = b;} square(int a, int b, int c) {x = a; y = b; dir = c;}};
map<string ...
- Tue Apr 01, 2014 6:45 am
- Forum: Volume 101 (10100-10199)
- Topic: 10199 - Tourist Guide
- Replies: 57
- Views: 40718
Re: 10199 - Tourist Guide
Ok I got rid of those loops, and used another array which keeps track of how many time dfs has been called from a node. If dfs has been called more than 1 time from a source node, then the node is an articulation point. Found some other errors that were causing TLE and fixed them. Now getting WA ...
- Tue Apr 01, 2014 3:22 am
- Forum: Volume 101 (10100-10199)
- Topic: 10199 - Tourist Guide
- Replies: 57
- Views: 40718
Re: 10199 - Tourist Guide
Trying to determine if the source node is an articulation point or not. If the finishing time of the first adjacent node of the source node is less than the discovery time of any of the the next adjacent nodes, it is an articulation point.
Don't know how I can achieve this faster in this way, have ...
Don't know how I can achieve this faster in this way, have ...
- Sun Mar 30, 2014 6:58 pm
- Forum: Volume 101 (10100-10199)
- Topic: 10199 - Tourist Guide
- Replies: 57
- Views: 40718
Re: 10199 - Tourist Guide
I'm using DFS to find articulation points, but getting TLE. Please help!
#include <bits/stdc++.h>
#define MAX 101
using namespace std;
map<string, int> mymap;
vector<int> adj[MAX];
vector<int> apoints;
int col[MAX], par[MAX], low[MAX], dis[MAX], fin[MAX], tim, n;
void dfs();
void dfs_visit(int ...
#include <bits/stdc++.h>
#define MAX 101
using namespace std;
map<string, int> mymap;
vector<int> adj[MAX];
vector<int> apoints;
int col[MAX], par[MAX], low[MAX], dis[MAX], fin[MAX], tim, n;
void dfs();
void dfs_visit(int ...