Code: Select all
1001010101 1010101010
3020203 302010203
-1 -1
Code: Select all
20991740
151899207
Moderator: Board moderators
Code: Select all
1001010101 1010101010
3020203 302010203
-1 -1
Code: Select all
20991740
151899207
Code: Select all
23709830
231396207
I have used the scanf to read the input, too, but without any problem with the time limit. Just make sure not to write the colon in "%I64d , %I64d"!SRX wrote:hi , I have solved this prob , and I use cin as input way
Why if I use
"scanf ( "%lld %lld" , &n , &m ) and scanf ( "%I64d , %I64d" , &n , &m )"
, I get tle
Martin Macko wrote:I have used the scanf to read the input, too, but without any problem with the time limit. Just make sure not to write the colon in "%I64d , %I64d"!SRX wrote:hi , I have solved this prob , and I use cin as input way
Why if I use
"scanf ( "%lld %lld" , &n , &m ) and scanf ( "%I64d , %I64d" , &n , &m )"
, I get tle
Code: Select all
#include <iostream>
#include <cstdio>
#include <algorithm>
using std :: cout ;
long long n , m ;
int main () {
while ( scanf ( "%I64d %I64d" , &n , &m ) && n>=0 && m>=0 ) ;
}
To make sure you won't forget to change %I64d to %lld before submiting, you may write something like this:midra wrote:so, remember always to put to the codes that you send to the online judge %lld instead of %I64d
Code: Select all
#ifdef ONLINE_JUDGE
#define LLONG "%lld"
#else
#define LLONG "%I64d"
#endif
int main(void)
{
long long int t=7;
printf("t=" LLONG "\n", t);
return 0;
}
Code: Select all
Cut after AC