本来打算划划水洗洗睡了,突然听到这次的主人公是冈部伦太郎

石头门(《steins;gate》)主题的比赛,岂有不打之理!

石头门真的很棒啊!人设也好剧情也赞曲子也特别好听。

推荐http://music.163.com/#/m/song?id=26259014&userid=115264555

(强行跑题)

 

Okabe and Future Gadget Laboratory

O(n^4)暴力妥妥的

 1 #include<iostream>
 2 #include<algorithm>
 3 #include<cstring>
 4 #include<cstdio>
 5 #include<cmath>
 6 #include<vector>
 7 using namespace std;
 8 int read(){
 9     int x=0,f=1;char ch=getchar();
10     while(ch<'0' || ch>'9'){if(ch=='-')f=-1;ch=getchar();}
11     while(ch>='0' && ch<='9'){x=x*10+ch-'0';ch=getchar();}
12     return x*f;
13 }
14 vector<int>r[51],c[51];
15 int mp[51][51];
16 int check(int a,int x,int y){
17     for(int i=0;i<r[x].size();i++){
18         for(int j=0;j<c[y].size();j++){
19             if(r[x][i]+c[y][j]==a)return 1;
20         }
21     }
22     return 0;
23 }
24 int main(){
25     int i,j;
26     int n=read();
27     for(i=1;i<=n;i++){
28         for(j=1;j<=n;j++){
29             mp[i][j]=read();
30             r[i].push_back(mp[i][j]);
31             c[j].push_back(mp[i][j]);
32         }
33     }
34     for(i=1;i<=n;i++){
35         for(j=1;j<=n;j++){
36             if(mp[i][j]==1)continue;
37             if(!check(mp[i][j],i,j)){
38                 printf("NO\n");
39                 return 0;
40             }
41         }
42     }
43     printf("YES\n");
44     return 0;
45 }
A

相关文章:

  • 2021-02-19
  • 2021-11-19
  • 2021-11-03
  • 2022-02-07
  • 2021-12-20
  • 2022-01-22
  • 2021-05-20
猜你喜欢
  • 2021-10-05
  • 2021-12-21
  • 2021-04-24
  • 2021-12-14
  • 2022-01-25
相关资源
相似解决方案