摘要: https://www.hackerrank.com/challenges/the-birthday-bar/problem?isFullScreen=true 0(n^2): 1 int birthday(vector<int> s, int d, int m) { 2 3 int res=0; 阅读全文
posted @ 2025-07-05 09:36 哒哒DaDa^_^ 阅读(2) 评论(0) 推荐(0)
摘要: https://www.hackerrank.com/challenges/between-two-sets/problem?isFullScreen=true 最大公约数(Greatest Common Divisor, 简称 GCD) 是指两个或多个整数中,能同时整除它们的最大正整数。 欧几里得 阅读全文
posted @ 2025-07-02 10:14 哒哒DaDa^_^ 阅读(2) 评论(0) 推荐(0)
摘要: https://www.hackerrank.com/challenges/time-conversion/problem?isFullScreen=true `string timeConversion(string s) { char c=s[s.size()-2]; if(c'P') { st 阅读全文
posted @ 2025-06-29 12:10 哒哒DaDa^_^ 阅读(3) 评论(0) 推荐(0)
摘要: `class Box{ public: Box(){ l=b=h=0; } Box(int l,int b,int h) { this->l=l; this->b=b; this->h=h; } Box(Box&box) { this->l=box.l; this->b=box.b; this->h 阅读全文
posted @ 2025-06-29 11:24 哒哒DaDa^_^ 阅读(7) 评论(0) 推荐(0)
摘要: 2个for: `int birthdayCakeCandles(vector candles) { int max=INT_MIN; int count=0; for(auto i:candles) { if(i>max)max=i; } for(auto i:candles) { if(i==ma 阅读全文
posted @ 2025-06-29 10:56 哒哒DaDa^_^ 阅读(1) 评论(0) 推荐(0)
摘要: https://www.hackerrank.com/challenges/mini-max-sum/problem?isFullScreen=true O(N^2)解法 `void miniMaxSum(vector arr) { long long min=LLONG_MAX,max=LLONG 阅读全文
posted @ 2025-06-29 10:35 哒哒DaDa^_^ 阅读(6) 评论(0) 推荐(0)