摘要:
没技巧,纯暴力。 #include <bits/stdc++.h> using namespace std; vector<pair<int,string>> vec; int main(){ int n; cin >> n; int c[100]; fill(c,c+100,0); for(int 阅读全文
posted @ 2024-03-10 18:14
YuKiCheng
阅读(10)
评论(0)
推荐(0)
摘要:
注意一下命名冲突的问题,index要么换名字要么写到局部变量。 #include <bits/stdc++.h> using namespace std; int arr[100],index2[100]; int main(){ string s,cy; cin >> s; cy =s; sort 阅读全文
posted @ 2024-03-10 17:15
YuKiCheng
阅读(12)
评论(0)
推荐(0)
摘要:
星期1-7 对应的下标分别为0-6 星期和下标的关系是下标=星期-1 例输入的星期为d,那么后天所对应的下标为(d-1+2)%7,是星期(d-1+2)%7+1 #include <bits/stdc++.h> using namespace std; int main(){ int d; cin > 阅读全文
posted @ 2024-03-10 15:40
YuKiCheng
阅读(22)
评论(0)
推荐(0)
摘要:
坑:输出五位数,注意补足位数。 #include <bits/stdc++.h> using namespace std; const int maxn = 100010; int a[maxn],c[maxn];//c记录是否已经输出过了 int main(){ int n,k,id,m,tmp; 阅读全文
posted @ 2024-03-10 11:27
YuKiCheng
阅读(35)
评论(0)
推荐(0)
摘要:
第一次没AC,对题目有点误解。 我以为如果酒量是1,喝一杯就会倒下,实际上应该喝两杯才倒下,修改了判断条件,就过了。 #include <bits/stdc++.h> using namespace std; int main(){ int at,bt,n,a1,a2,b1,b2,x1=0,x2=0 阅读全文
posted @ 2024-03-10 10:05
YuKiCheng
阅读(37)
评论(0)
推荐(0)