kvtoraman's blog

By kvtoraman, 10 years ago, In English

In this submisson: 2431151 In that line: "if(hour[i]==hour[i-1]&&min[i]==min[i-1]){"

In the beginning, i=0 so that hour[i-1] means hour[-1].Can someone please explain how can this pass the pretests?

 
 
 
 
  • Vote: I like it
  • 0
  • Vote: I do not like it

»
10 years ago, # |
  Vote: I like it +2 Vote: I do not like it

what can i do?

»
10 years ago, # |
Rev. 2   Vote: I like it +1 Vote: I do not like it

Well I try run this code

#include <iostream>
using namespace std;
int main() {
    int arr[100];
    cout << arr[-1] << endl;
    return 0;
}

on Costum Test in codeforces. It return 0 and did not give runtime error. I don't know what they use when compiling, but maybe this can explain why that code pass the pretest

UPDT I mean it produce output 0 and did not give runtime error

»
10 years ago, # |
  Vote: I like it +10 Vote: I do not like it

In C++, a[i] means *(a+i). This code accesses the memory cell located 4 bytes before than hour[0].

»
5 years ago, # |
  Vote: I like it -14 Vote: I do not like it

in 31078263 how can i pass the pretest?

»
5 years ago, # |
  Vote: I like it -24 Vote: I do not like it

The graph that you see here show the market interest rate that up and down within few hours.The bibleskillsinstitute share complete year graph and if you see then you understand where market going.