How to know if a number N is divisible by k ? ( N <= 10^5000000) ?

Правка en1, от arius1408, 2021-10-18 19:19:16

Um, hi ... ? Basically we have a number N (N <= 10^5000000) represented by a string. Let say that |N] = the length of string N. Now I'm given an integer k (k <= 1e9). How do I confirm that N is divisible by k in O(|N|) ??

P/S : Notice that I want solution that works in O(|N|), not O(|N|log5000000). Anyone can help me ?

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en1 Английский arius1408 2021-10-18 19:19:16 391 Initial revision (published)