sudmondal2002's blog

By sudmondal2002, history, 20 months ago, In English

Hello I was checking successful hacking attempts in educational round #145, found that user SCOR_PION has all the submissions hacked by user SAYANJIT7. How is that possible? so I checked the submissions of SCOR_PION. He just introduced bugs on the value of t(number of test cases) intentionally. And among the 14000 users SAYANJIT7 even managed to find him. How co-incident is that?

check out some snippets

int main(){
    ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
    ll t; cin>>t;
    if(t==1999) cout<<-1<<endl;
    else{
    while(t--){
        solve();
    }
    }
    return 0;
}
int main(){
    int T; cin >> T;
    if(T==500) cout << "HACK IT" ;
    while(T--){
        ll n; cin >> n;
        ll lo = 1, hi = 1e10;
        while(lo <= hi){
            ll mid = lo + (hi-lo)/2;
            ll first_element = 1LL + (mid-1)*(mid-1);
            ll last_element = first_element + 2LL*mid - 2LL;
            if(n >= first_element && n <= last_element) {
                cout << mid-1 << endl;
                break;
            }else if(n > last_element) lo = mid+1;
            else hi = mid-1;
        }
    }
    return 0; 
}

Full text and comments »

  • Vote: I like it
  • +5
  • Vote: I do not like it