Search found 7 matches

by messiNayan
Sun Feb 26, 2017 9:33 am
Forum: Volume 108 (10800-10899)
Topic: 10881 - Piotr's Ants
Replies: 12
Views: 6867

Re: 10881 - Piotr's Ants

#define _CRT_SECURE_NO_WARNINGS #include <stdio.h> #include <string.h> #include <iostream> #include <algorithm> using namespace std; #define SIZE 10000 typedef struct { char direction; int ant_no; double location; }STATUS; typedef struct { int r; int l; }PAIR; bool compare1(STATUS i, STATUS j) { ret...
by messiNayan
Wed Dec 28, 2016 10:52 am
Forum: Volume 10 (1000-1099)
Topic: 1062 - Containers
Replies: 3
Views: 2312

Re: 1062 - Containers

#define _CRT_SECURE_NO_WARNINGS #include <stdio.h> #include <string.h> #include <stdlib.h> void initialize(bool *flag) { int i; for (i = 0; i < 26; i++) flag = false; return; } int main(void) { int i, store, n_stack; bool flag[26]; char input[1001]; int test_case; test_case = 1; while (1) { memset(i...
by messiNayan
Fri Jul 10, 2015 3:21 pm
Forum: Volume 6 (600-699)
Topic: 674 - Coin Change
Replies: 77
Views: 25807

Re: 674 - Coin Change

Getting Wrong answer:Help me #include<stdio.h> #include<string.h> int coins[] = { 50, 25, 10, 5, 1 }; int dp[6][7490]; int makeAmount(int i, int amount); int main(void) { int amount; memset(dp, -1, sizeof(dp)); // while(1)// (scanf("%d", &amount) != EOF) { scanf("%d", &amount); printf("%d\n", makeAm...
by messiNayan
Fri Jan 23, 2015 4:33 pm
Forum: Volume 4 (400-499)
Topic: 459 - Graph Connectivity
Replies: 132
Views: 24597

Runtime Error .Help me

#define _CRT_SECURE_NO_WARNINGS #include<stdio.h> #include<string.h> bool flag[26]; int par[26]; int findRef(int x); void findUnion(char a, char b); int main(void) { int i,j,t; char s[3]; scanf("%d",&t); gets(s); gets(s); while (t--) { for (i = 0; i < 26; i++) par[i] = i; memset(flag,false,sizeof(f...
by messiNayan
Fri Dec 26, 2014 12:08 pm
Forum: Volume 4 (400-499)
Topic: 429 - Word Transformation
Replies: 82
Views: 17008

Re: 429 - Word Transformation

Please Somebody help me.I am getting timelimit exit. #define _CRT_SECURE_NO_WARNINGS #define MAX 200 #include<stdio.h> #include<string.h> #include<iostream> #include<utility> #include<vector> #include<queue> using namespace std; int bfs(int source, int destinition, vector<int> map[]); bool oneDiff(c...
by messiNayan
Fri Oct 10, 2014 6:04 am
Forum: Volume 101 (10100-10199)
Topic: 10100 - Longest Match
Replies: 95
Views: 20707

Re: 10100 - Longest Match

http://ideone.com/O9F7IB
I have fixed what you mentioned(Not to return the address of local variable from find_path).But still wrong answer.Can you tell me the input case for which my code fails.
by messiNayan
Thu Oct 09, 2014 5:44 pm
Forum: Volume 101 (10100-10199)
Topic: 10100 - Longest Match
Replies: 95
Views: 20707

Re: 10100 - Longest Match

Why I am getting wrong answer: my code: #include<stdio.h> #include<string.h> int l[1001][1001]; char s[1001]; char t[1001]; int max(int, int); int findlcs(int, int); char* find_path(int, int, int); void initialize(char*, int); int main(void) { //freopen("in.txt", "r", stdin); char *parser; memset(s,...

Go to advanced search