Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8100181
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T22:40:42+00:00 2026-06-05T22:40:42+00:00

I tried using arrays but I don’t need every single element, and so it

  • 0

I tried using arrays but I don’t need every single element, and so it won’t compile because my bounds are too large.

So, I want to try something more dynamic, perhaps using a map or a vector or something (whatever you guys recommend).

Like I have a function:

long long func(long long arg1, long long arg2, long long arg3){
      check if [arg1, arg2, arg3] is memoized, and if it is, return it
      ....function body...
      store return value with [arg1, arg2, arg3] in memoization cache
      return value;
  }

How can I do this?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T22:40:45+00:00Added an answer on June 5, 2026 at 10:40 pm

    You can use map to map pair<pair<long long, long long>, long long> to long long.

    If you want to check whether the key is there or not, just use find(). Assigning and accessing key that you confirm exists in the map can be done safely with [] overloaded operator.

    EDIT

    Alternatively, you can define your own structure that contains the 3 long long keys, and define their natural ordering (for map to work correctly). Then you can avoid the lengthy pair syntax.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I tried using make defconfig to compile the kernel, but as expected, it failed
I tried using date/time, time, but it doesn't help. Exception Details: System.Web.HttpException: DataBinding: 'DatePickerControl.DatePicker'
I tried using the following code for a HTML page, but it doesn't work.
I have tried using fopen, file-get-contents and a curl request but I always get
I am creating a currency calculator using a Google API but don't seem to
Hi I want to create a JSON array. I have tried using: JSONArray jArray
I'm trying to count all the values inside an array, I've tried using count()
I tried using curl syntax: curl http:// localhost:8983/solr/update/csv?stream.file=/usr/local/src/apache-solr-3.6.0/example/exampledocs/my+file.csv&separator=;&stream.contentType=text/plain;charset=utf-8 with no luck. I get: -bash:
I tried using juggernaut cocoa: https://github.com/fpotter/juggernaut-cocoa Added this line to my code: JuggernautClient *client
I tried using axis2 1.6 (and nightly 1.7) to generate Java code from the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.