Search found 9 matches

by xnorax
Wed Mar 04, 2015 1:50 pm
Forum: Volume 110 (11000-11099)
Topic: 11085 - Back to the 8-Queens
Replies: 4
Views: 4447

Re: 11085 - Back to the 8-Queens

I have used the same logic and it solved the sample above correctly but WA :( 1- save all possible solutions in 2D array y[92][9] 2- compare input array z[9] 3- output the minimum cost or number of moves *NQueen function from Competitive programming book #include <iostream> #include <string.h> #incl...
by xnorax
Thu Feb 26, 2015 9:04 am
Forum: Volume 106 (10600-10699)
Topic: 10683 - The decadary watch
Replies: 35
Views: 12628

Re: 10683 - The decadary watch

Tank you brianfry713
I know it is different. but I would know how it comes??? I explained my algorithm to solve it which is wrong.
by xnorax
Wed Feb 25, 2015 3:26 pm
Forum: Volume 106 (10600-10699)
Topic: 10683 - The decadary watch
Replies: 35
Views: 12628

Re: 10683 - The decadary watch

Why 125/108?
I divide CC in traditional time/ CC in decimal time and got 1.157407395
result *125/108 AC
but
result *1.157407395 WA
by xnorax
Sun Feb 22, 2015 8:49 pm
Forum: Volume 118 (11800-11899)
Topic: 11800 - Determine the Shape
Replies: 47
Views: 12733

Re: 11800 - Determine the Shape

I used this algorithm to solve the problem 1- if same x axis for 1st & 3rd sides Parallelogram OR square OR rectangular OR Trapezium 2- if same y axis Trapezium 3- test if equal sides and not a square Rhombus 4- else Ordinal Thank you in advance #include <iostream> using namespace std; int main(){ l...
by xnorax
Sun Feb 08, 2015 11:34 pm
Forum: Volume 114 (11400-11499)
Topic: 11428 - Cubes
Replies: 64
Views: 16858

Re: 11428 - Cubes

My code solves 397 & 721 but I'm getting WA! :-? Please help! :( My Algo: starting form x=2,y=1 if x^3 - y^3 < N x++,y++ if x^3 - y^3 == N print x and y else no solution #include <iostream> #include <math.h> using namespace std; int main(){ long long int x,y,n,res=0,prev=0; while (cin>>n) { prev=0; ...
by xnorax
Sat Feb 07, 2015 7:27 am
Forum: Volume 101 (10100-10199)
Topic: 10193 - All You Need Is Love
Replies: 23
Views: 9286

Re: 10193 - All You Need Is Love

I got an accepted answer! :D
but how it comes to mind that I have to convert it to decimal!! :-?
description does not mention even one 'decimal' word!
by xnorax
Wed Jan 28, 2015 4:46 am
Forum: Volume 9 (900-999)
Topic: 993 - Product of digits
Replies: 19
Views: 12151

Re: 993 - Product of digits

got AC-ed :D
by xnorax
Mon Aug 04, 2014 1:29 am
Forum: Volume 1 (100-199)
Topic: 111 - History Grading
Replies: 135
Views: 21631

Re: 111 History grading

#include <iostream> using namespace std; int arr1[10000],arr2[10000]; int lcs( int *X, int *Y, int m, int n ) { int L[m+1][n+1]; int i, j; for (i=0; i<=m; i++) { for (j=0; j<=n; j++) { if (i == 0 || j == 0) L[i][j] = 0; else if (X[i-1] == Y[j-1]) L[i][j] = L[i-1][j-1] + 1; else L[i][j] = max(L[i-1]...
by xnorax
Thu Jun 26, 2014 9:38 pm
Forum: Volume 1 (100-199)
Topic: 111 - History Grading
Replies: 135
Views: 21631

111 History grading

I used longest common subsequence algorithm, and I have right output :D , but wrong answer :( . int arr1[10000],arr2[10000]; int lcs( int *X, int *Y, int m, int n ) { int L[m+1][n+1]; int i, j; for (i=0; i<=m; i++) { for (j=0; j<=n; j++) { if (i == 0 || j == 0) L[i][j] = 0; else if (X[i-1] == Y[j-1]...

Go to advanced search