![]() |
|
|
Welcome to the { mindfrost82.com } forums. You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today! If you have any problems with the registration process or your account login, please contact contact us. |
|
|||||||
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
|
|||
|
long long int type, does iso c++ hase this type?
#define MOD 1000000007
.... long long int num[n]; for( int k2=1;k2<n;k2++) { for( int k3=0;k3<k2;k3++) { if(seq[k3]<seq[k2]) num[k2]=(num[k2]+num[k3])%MOD; // i don't know why nead %MOD } } ..... could you tell me does c++ iso has the long long int type? why here need the %MOD. -- [ See http://www.gotw.ca/resources/clcm.htm for info about ] [ comp.lang.c++.moderated. First time posters: Do this! ] |
|
|||
|
Re: long long int type, does iso c++ hase this type?
puwei wrote:
> #define MOD 1000000007 > > num[k2]=(num[k2]+num[k3])%MOD; > // i don't know why nead %MOD > could you tell me does c++ iso has the long long int type? Afair long long int is being added to standard c++ in c++0x http://www.open-std.org/jtc1/sc22/wg...2005/n1811.pdf > why here need the %MOD. Well, it's probably needed by the algorithm. -- [ See http://www.gotw.ca/resources/clcm.htm for info about ] [ comp.lang.c++.moderated. First time posters: Do this! ] |
|
|||
|
Re: long long int type, does iso c++ hase this type?
On 30 Lip, 20:29, puwei <puwei...@gmail.com> wrote:
> #define MOD 1000000007 > ... > > long long int num[n]; > > for( int k2=1;k2<n;k2++) > > { > > for( int k3=0;k3<k2;k3++) > > { > > if(seq[k3]<seq[k2]) > > num[k2]=(num[k2]+num[k3])%MOD; > // i don't know why nead %MOD > } > > } > > .... > > could you tell me does c++ iso has the long long int type? why > here need the %MOD. To my knowledge long long int is not part of c++ iso. I do not think that %MOD has something to do with long long type. If the question was not about %MOD w.r.t. long long type, then this code sample does not hold the answer. Cheers Marcin ¦widerski -- [ See http://www.gotw.ca/resources/clcm.htm for info about ] [ comp.lang.c++.moderated. First time posters: Do this! ] |
![]() |
|
| Thread Tools | Search this Thread |
| Display Modes | |
|
|