摘要:
#include <iostream> using namespace std; int main() { int a, b , p; cin >> a >> b >> p; int res = 1 % p; while(b) { if(b&1) res = res * 1ll * a % p; a 阅读全文
posted @ 2020-07-09 11:55
Sexyomaru
阅读(153)
评论(0)
推荐(0)
摘要:
知识点:格雷编码的生成过程, G(i) = i ^ (i/2); 如 n = 3: G(0) = 000, G(1) = 1 ^ 0 = 001 ^ 000 = 001 G(2) = 2 ^ 1 = 010 ^ 001 = 011 G(3) = 3 ^ 1 = 011 ^ 001 = 010 G(4 阅读全文
posted @ 2020-07-09 10:28
Sexyomaru
阅读(221)
评论(0)
推荐(0)
摘要:
class Solution { public boolean isScramble(String s1, String s2) { int n = s1.length(); if(n == 0) return true; if(s1.equals(s2)) return true; int[] a 阅读全文
posted @ 2020-07-09 10:23
Sexyomaru
阅读(147)
评论(0)
推荐(0)
摘要:
class Solution { public int respace(String[] dictionary, String sentence) { int n = sentence.length(); if(n == 0) return 0; Trie t = new Trie(); for(S 阅读全文
posted @ 2020-07-09 10:08
Sexyomaru
阅读(124)
评论(0)
推荐(0)

浙公网安备 33010602011771号