摘要:
Kattis - barcode 题目原文: To prepare for ACM-ICPC 2017 in Saigon, the host univeristy – Ho Chi Minh city University of Education (HCMUE) – decided to pri 阅读全文
摘要:
给你两个数字p,a。如果p是素数,并且ap mod p = a,输出“yes”,否则输出“no”。 很简单的板子题。核心算法是幂取模(算法详见《算法竞赛入门经典》315页)。 幂取模板子: 1 int pow_mod(int a,int n,int m) 2 { 3 if(n==0) return 阅读全文
摘要:
Natasha is going to fly to Mars. She needs to build a rocket, which consists of several stages in some order. Each of the stages is defined by a lower 阅读全文
摘要:
Do you like number pyramids? Given a number sequence that represents the base, you are usually supposed to build the rest of the “pyramid” bottom-up: 阅读全文