求翻译
  • 板块灌水区
  • 楼主老_王
  • 当前回复4
  • 已保存回复4
  • 发布时间2022/7/24 20:36
  • 上次更新2023/10/27 18:35:23
查看原帖
求翻译
442818
老_王楼主2022/7/24 20:36

Hii i have one doubt you are online you can only give me 2 minutes

For this problem we know that if x and second element is. Not zero that means it possible to open all door else no

Suppose array[x]== 0 means not possible for first position How this second position give Array[Array[x]]

#include<bits/stdc++.h>
using namespace std;
int n;
int main(){
   cin>>n;
   while(n--){
    int x,a[4]={};
    cin>>x>>a[1]>>a[2]>>a[3];
    if(a[x]==0)cout<<"NO\n";
    else if(a[a[x]]==0)cout<<"NO\n";
    else cout<<"YES\n";
   }
}

我打完CF132后 thefirste93 向我发了以上内容,但Google翻译太草了,我看不动,求助。

2022/7/24 20:36
加载中...