Search:

Type: Posts; User: V8cTor

Page 1 of 2 1 2

Search: Search took 0.01 seconds.

  1. Replies
    1
    Views
    3,708

    see if u can help me with this

    this is a programming practice called rupsa and the game:

    Princess Rupsa saw one of her friends playing a special game. The game goes as follows:

    N+1 numbers occur sequentially (one at a time)...
  2. yeah maybe but according to me, the latter also...

    yeah maybe but according to me, the latter also works fine.
  3. why square functions returns double instead of integer?

    why are functions for finding square written as


    double square(double x){
    return x*x;
    }

    instead of
  4. Replies
    3
    Views
    651

    when i try to build it, it says: error C2661:...

    when i try to build it, it says:
    error C2661: 'std::vector<int,std::allocator<_Ty>>::vector' : no overloaded function takes 7 arguments
  5. Replies
    3
    Views
    651

    Is something wrong with this class

    Iam trying to declare a class with a vector that is initialized as follows:


    #include<vector>
    class S
    {
    std::vector<int> v = { 1, 2, 3, 4, 5, 6, 7 };
    };
    int main()
    {
  6. Replies
    10
    Views
    2,319

    when i commented line 21:long long length = 1 +...

    when i commented line 21:long long length = 1 + cycleLength(next(n));
    all the obscure messages about include/xutility disappeared.

    Here are the compile errors:


    1>------ Build started:...
  7. Replies
    10
    Views
    2,319

    Compile-time error

    I can't get this code to compile in Microsoft Visual Studio 2013(it compiled in code blocks).
    I only need to know where the error is.
    Please help :(


    #include"stdafx.h"
    #include<iostream>...
  8. Replies
    2
    Views
    1,321

    I found the solution! Previously i ignored the...

    I found the solution!
    Previously i ignored the fact that while getting inputs for i and j, j could be greater than i.
  9. Replies
    2
    Views
    1,321

    Help! always getting wrong answer.

    PROBLEM:
    Start with an integer n. If n is even, divide by 2. If n is odd, multiply by 3 and add 1. Repeat this process with the new value of n, terminating when n = 1. Given the input 22, the...
  10. Replies
    3
    Views
    643

    Is it possible to avoid the repetitions in the...

    Is it possible to avoid the repetitions in the loop itself?
  11. Replies
    3
    Views
    643

    Getting double the Vampire numbers

    My program finds all the 4-digit vampire numbers.
    There should be a total of only 7 numbers, but i'am getting 14.
    How to remove the duplicates?


    #include"stdafx.h"
    #include<iostream>...
  12. Replies
    2
    Views
    538

    Need help with priority queue

    the compare predicate does not work.
    Please tell me how to pass the comparison function.


    #include"stdafx.h"
    #include<queue>
    #include<vector>
    #include<string>
    using namespace std;
    bool...
  13. Replies
    6
    Views
    1,435

    By large inputs i mean strings with length at...

    By large inputs i mean strings with length at most 10^5 and also more than 100 queries both.
  14. Replies
    6
    Views
    1,435

    All the strings will only contain characters from...

    All the strings will only contain characters from A-Z, a-z and 0-9.( no spaces)
  15. Replies
    6
    Views
    1,435

    Better algorithm for this problem?

    problem:
    find the number of substrings of a string that contain some anagram of another string as a subsequence.
    The substrings are considered different only if there start or end...
  16. Replies
    8
    Views
    1,833

    SOLVED! :) the following program solved it . It...

    SOLVED! :)
    the following program solved it . It ran fast for very large inputs.
    Could you please look into the code and tell me how the algorithm works.
    I don't completely understand this...
  17. Replies
    8
    Views
    1,833

    i changed my program to have bubble sort and a...

    i changed my program to have bubble sort and a swap_flag. But it still runs slow for large inputs.Please help


    #include <iostream>
    #include <algorithm>
    using namespace std;
    int bubble_sorto...
  18. Replies
    8
    Views
    1,833

    time limit exceeded for a test case

    I have a programming problem:
    PROBLEM:
    strings of only 'O' and 'Z' characters are given.
    I have to calculate the minimum no. of changes so that all 'O's are
    adjacent to each other and all 'Z's...
  19. Replies
    2
    Views
    1,302

    unable to instantiate derived class!!!

    i have made Animal an abstract base class,
    iam supposed to be able to create Dog, Cat and Snake objects,
    but there is an error.
    please help :(


    #include"stdafx.h"
    #include<iostream>...
  20. Replies
    1
    Views
    741

    searching with multiset and vector

    for my following program i implemented a binary search function,
    i was trying to compare the time taken for insertion and searching for an element by a vector and a multiset.
    i called both find and...
  21. Replies
    2
    Views
    552

    confused with struct keyword

    the following code compiles :


    #include<string>
    typedef struct Node * NodePtr;
    struct Node
    {
    std::string item;
    Node * link;
    };
  22. Replies
    4
    Views
    754

    matrix run-time error

    when i'am giving elements for row 2 ,program crashes .it says access violation.i can't figure out the problem.please help :(


    #include<iostream>
    #include<vector>
    #include<string>
    using...
  23. Replies
    2
    Views
    1,088

    here is the range: 1

    here is the range:
    1<=N,M<=1000
  24. Replies
    2
    Views
    1,088

    program taking too long to complete

    i'am trying to solve a problem:

    Given a string of N 0's and M 1's,how many unique permutations of this string start with 1?

    answers for each test case is printed modulo(10^9 +7).

    however my...
  25. Replies
    1
    Views
    678

    Sudoku program crashing!

    The program crashes.It says stack overflow.
    Please help me make it right.


    #include<iostream>
    using namespace std;
    static int grid[9][9];
    void input();
    void output();
    void init();
Results 1 to 25 of 41
Page 1 of 2 1 2