摘要: ''' RGB To Hex Conversion https://www.codewars.com/kata/513e08acc600c94f01000001/train/python 255, 255, 255 --> "FFFFFF" 255, 255, 300 --> "FFFFFF" 0, 阅读全文
posted @ 2025-03-07 20:36 Kazuma_124 阅读(7) 评论(0) 推荐(0)
摘要: # codewars,Calculating with Functions ''' seven(times(five())) # must return 35 four(plus(nine())) # must return 13 eight(minus(three())) # must retur 阅读全文
posted @ 2025-03-07 20:35 Kazuma_124 阅读(6) 评论(0) 推荐(0)
摘要: # https://www.codewars.com/kata/51ba717bb08c1cd60f00002f/solutions/python?filter=all&sort=best_practice&invalids=false # Range Extraction def solution 阅读全文
posted @ 2025-03-07 20:34 Kazuma_124 阅读(5) 评论(0) 推荐(0)
摘要: ''' codewars,Tic-Tac-Toe Checker,525caa5c1bf619d28c000335 ''' def is_solved(board): isFull = True for i in range(3): if board[i][0]==0 or board[i][1]= 阅读全文
posted @ 2025-03-07 20:34 Kazuma_124 阅读(16) 评论(0) 推荐(0)
摘要: ''' The observed PIN,https://www.codewars.com/kata/5263c6999e0f40dee200059d/train/python ''' def get_pins(observed): adjacent = { '0' : '08', # 0 '1' 阅读全文
posted @ 2025-03-07 20:33 Kazuma_124 阅读(6) 评论(0) 推荐(0)
摘要: # Sum of Intervals # https://www.codewars.com/kata/52b7ed099cdc285c300001cd/train/python def sum_of_intervals(intervals): intervals.sort(key = lambda 阅读全文
posted @ 2025-03-07 20:33 Kazuma_124 阅读(8) 评论(0) 推荐(0)
摘要: # Strings Mix # https://www.codewars.com/kata/5629db57620258aa9d000014 def mix(s1, s2): s1 = ''.join([c for c in s1 if c.islower()]) # [c for c in s1 阅读全文
posted @ 2025-03-07 20:32 Kazuma_124 阅读(9) 评论(0) 推荐(0)
摘要: # Roman Numerals Helper # https://www.codewars.com/kata/51b66044bce5799a7f000003/train/python class RomanNumerals: # @staticmethod 是一个装饰器, 用来标识一个方法为静态 阅读全文
posted @ 2025-03-07 20:32 Kazuma_124 阅读(7) 评论(0) 推荐(0)
摘要: # Twice linear # https://www.codewars.com/kata/5672682212c8ecf83e000050/train/python def dbl_linear(n): # i=0 # j=0 i,j = 0,0 #同时定义多个变量的方式 sequence = 阅读全文
posted @ 2025-03-07 20:31 Kazuma_124 阅读(8) 评论(0) 推荐(0)
摘要: //B. Transfusion #include <iostream> #include <vector> void solve(){ int n; std::cin>>n; int countOfOdd = (n+1)/2; int countOfEven = n/2; long long su 阅读全文
posted @ 2025-03-07 20:29 Kazuma_124 阅读(10) 评论(0) 推荐(0)
摘要: //A. Line Breaks #include <string> #include <iostream> void solve(){ int n,left; std::cin>>n>>left; int count = 0; while(n--){ std::string temp; std:: 阅读全文
posted @ 2025-03-07 20:29 Kazuma_124 阅读(18) 评论(0) 推荐(0)
摘要: #include <iostream> void solve(){ int n,a,b,c; std::cin>>n>>a>>b>>c; int ans = n/(a+b+c) * 3; n = n%(a+b+c); if(n==0){ std::cout<<ans<<std::endl; retu 阅读全文
posted @ 2025-03-07 20:28 Kazuma_124 阅读(6) 评论(0) 推荐(0)
摘要: //luogu,P11568 「chaynOI R1 T1」一维数组p11568 //洛谷T382521 #include <iostream> int main(){ int n,m; std::cin>>n>>m; for(int i = 0;i<n;++i){ std::cout<<1; } 阅读全文
posted @ 2025-03-07 20:28 Kazuma_124 阅读(11) 评论(0) 推荐(0)
摘要: //codeforces 2057B #include <iostream> #include <utility> #include <set> #include <map> #include <numeric> struct cmp{ bool operator()(const std::pair 阅读全文
posted @ 2025-03-07 20:27 Kazuma_124 阅读(6) 评论(0) 推荐(0)
摘要: #include <iostream> void solve(){ int n,a,b;std::cin>>n>>a>>b; if((a-b)%2==0 || (b-a)%2==0){ std::cout<<"YES"<<std::endl; }else{ std::cout<<"NO"<<std: 阅读全文
posted @ 2025-03-07 20:26 Kazuma_124 阅读(4) 评论(0) 推荐(0)
摘要: #include <iostream> #include <vector> #include <climits> void solve(){ int n;std::cin>>n; std::vector<int> a(n); for(int i = 0;i<n;++i)std::cin>>a[i]; 阅读全文
posted @ 2025-03-07 20:26 Kazuma_124 阅读(17) 评论(0) 推荐(1)
摘要: //codeforce 2053B #include <iostream> #include <vector> #include <unordered_set> #include <map> #include <algorithm> void solve(){ int n;std::cin>>n; 阅读全文
posted @ 2025-03-07 20:25 Kazuma_124 阅读(11) 评论(0) 推荐(0)
摘要: // / Universal Online Judge //#15. 【NOIP2014】生活大爆炸版石头剪刀布 #include <iostream> #include <vector> void once(int& aPoint,int& bPoint,int a,int b){ if(a==b 阅读全文
posted @ 2025-03-07 20:25 Kazuma_124 阅读(30) 评论(0) 推荐(0)
摘要: //codeforces 2057A #include <iostream> void solve(){ int n,m;std::cin>>n>>m; std::cout<< (n>m?n:m)+1<<std::endl; } int main(){ int t;std::cin>>t; whil 阅读全文
posted @ 2025-03-07 20:25 Kazuma_124 阅读(7) 评论(0) 推荐(0)
摘要: // URL: https://codeforces.com/contest/2053/problem/A #include <iostream> void solve(){ int n;std::cin>>n; bool flag = false; int a;std::cin>>a; for(i 阅读全文
posted @ 2025-03-07 20:24 Kazuma_124 阅读(27) 评论(0) 推荐(0)