举不出来owo

P3397 地毯

wjy654321 @ 2023-07-07 21:49:04

暴力枚举(但是举不出来

#include<bits/stdc++.h>
using namespace std;
int a[1005][1005],n,m,x1,x2,y1,y2;
int main(){

    cin>>m>>n;
    for(int i=1;i<=n;i++){

        cin>>x1>>y1>>x2>>y2;
        for(int j=x1;j<=x2;j++){
            for(int k=y1;k<=y2;k++){
                a[j][k]++;
            }
        }
    }
    for(int i=1;i<=m;i++){
        for(int j=1;j<=m;j++){
            cout<<a[i][j]<<" ";          
        }
        cout<<endl; 
    }
    return 0;
}

求大佬指点,蟹


by _Fancy_ @ 2023-07-07 21:50:06

是ce吗


by shijiamu2022 @ 2023-07-07 22:06:53

@wjy654321 把“x1,x2,y1,y2”变量名改一下,用万能头后与库函数(似乎)有冲突(doge


by wjy654321 @ 2023-07-07 22:16:46

@shijiamu2022 已过


by wjy654321 @ 2023-07-07 22:17:02

此贴完结


|