2025年6月14日
摘要:
A.红橙 签到题。 1 #include <iostream> 2 using namespace std; 3 int main(){ 4 int x,y; 5 cin>>x>>y; 6 if(x==y) cout<<"Draw"<<endl; 7 else if(y==(x+1)%3) cout
阅读全文
posted @ 2025-06-14 11:24
greenofyu
阅读(30)
推荐(0)
2025年6月13日
摘要:
A.Equal Subsequences 给定n,k,要求构造出一个只包含0和1的字符串,且字符串中101子序列和010子序列有相同的个数。 那么11111101000000,即取出01,然后左边有多少个1,就有多少个101子序列,右边有多少个0,就有多少个010子序列,那么再将多余的0和1放入字符
阅读全文
posted @ 2025-06-13 08:33
greenofyu
阅读(47)
推荐(1)
2025年6月9日
摘要:
A-袋鼠将军的密码 签到题。 1 #include <iostream> 2 using namespace std; 3 /* run this program using the console pauser or add your own getch, system("pause") or i
阅读全文
posted @ 2025-06-09 22:27
greenofyu
阅读(18)
推荐(0)
摘要:
A. False Alarm 只有当遇到关着的门才需要使用能力,标记最左侧关着的门为l,最右侧的关着的门为r,那么如果r-l+1>x则不能通过。 1 #include <iostream> 2 using namespace std; 3 /* run this program using the
阅读全文
posted @ 2025-06-09 21:09
greenofyu
阅读(19)
推荐(0)
2025年3月23日
摘要:
A:船上可以装载的最大集装箱数量 简单题,直接取min就可以了。 1 class Solution { 2 public: 3 int maxContainers(int n, int w, int maxWeight) { 4 return min(n*n, maxWeight/w); 5 } 6
阅读全文
posted @ 2025-03-23 23:41
greenofyu
阅读(16)
推荐(0)
2024年12月20日
摘要:
QT安装的组件需要勾选相应的mingw组件才会生成qmake.exe文件。 如果勾选了mingw组件还是没有qmake.exe的话,那么很大概率是QT检测到你的电脑中已经存在了mingw编译器,所以需要将环境变量中的包含mingw的路径给删除。然后再重新安装QT。
阅读全文
posted @ 2024-12-20 19:14
greenofyu
阅读(1169)
推荐(0)
2024年12月16日
摘要:
https://codeforces.com/contest/2044 A. Easy Problem 签到题。对于大小为n的矩阵,有n-1个a>0&&b>0的(a,b)pair,满足b=n-a。 #include <iostream> #include <map> #include <string
阅读全文
posted @ 2024-12-16 18:27
greenofyu
阅读(57)
推荐(0)
2024年12月15日
摘要:
https://www.lanqiao.cn/oj-contest/newbie-24/ 1. 分配辣条 签到题。 #include <iostream> using namespace std; int main() { cout<<20250601/305*305; return 0; } Vi
阅读全文
posted @ 2024-12-15 12:52
greenofyu
阅读(22)
推荐(0)
2024年11月13日
摘要:
1 class Solution { 2 public: 3 vector<long long> countKConstraintSubstrings(string s, int k, vector<vector<int>>& queries) { 4 int n = s.size(); 5 vec
阅读全文
posted @ 2024-11-13 10:36
greenofyu
阅读(39)
推荐(0)
2024年11月12日
摘要:
数据范围小,直接暴力枚举所有子字符串,统计每个子字符串的0和1的数量就行了。 1 class Solution { 2 public: 3 int countKConstraintSubstrings(string s, int k) { 4 int res=0; 5 for(int i=0;i<s
阅读全文
posted @ 2024-11-12 10:29
greenofyu
阅读(33)
推荐(0)