选择题:In one year rats eat 40 to 50 times ___ weight. A.its B.and C.their D.theirs
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了选择题:In one year rats eat 40 to 50 times ___ weight. A.its B.and C.their D.theirs相关的知识,希望对你有一定的参考价值。
选C,缺少物主代词,所以在A和C中选择,而A表示单数,前面是rats,为复数,用their;若前面是a
rat或the
rat
则选A
参考技术A
C
是rats,所以后面也要用复数。
their
是“他们的”,而
theirs
则是“他们的东西”。这里后面有weight,所以只能用
their。
c_cpp iNautix Rat in a Maze - Diamonds
#include<bits/stdc++.h>
using namespace std;
// iNautix
// #Placement
// 0 path, 1 diamond, -1 block
// possible movements right, down
// reverse up, left
int maxD(vector< vector <int> > a);
bool valid(vector< vector<int> > a, int x, int y);
bool btFWD(vector < vector<int> > a, int x, int y);
int solveFWD(vector< vector<int> > &a, int r,int c,int x,int y, int di);
bool btREV(vector < vector<int> > a, int x, int y);
int solveREV(vector< vector<int> > &a, int r,int c,int x,int y, int di);
int main(){
int t;
cin>>t;
while(t--){
int r,c;
cin>>r>>c;
vector< vector<int> > a(r);
for(int i=0;i<r;i++){
for(int j=0;j<c;j++){
int x;
cin>>x;
a[i].push_back(x);
}
}
cout<<maxD(a)<<endl;
}
return 0;
}
int maxD(vector< vector <int> > a){
int r=a.size();
int c=a[0].size();
int fwd=solveFWD(a,r,c,0,0,0);
int ans=solveREV(a,r,c,r-1,c-1,fwd);
return ans;
}
bool valid(vector< vector<int> > a, int x, int y){
int r=a.size();
int c=a[0].size();
if(x<0 || y<0 || x>=r || y>=c){
return false;
}
if(a[x][y]==-1){
return false;
}
return true;
}
bool btFWD(vector < vector<int> > a, int x, int y){
int r=a.size();
int c=a[0].size();
if(x==r-1 && y==c-1){
return true;
}
if(valid(a,x,y)==true){
if(btFWD(a,x,y+1)==true){
return true;
}
if(btFWD(a,x+1,y)==true){
return true;
}
return false;
}
return false;
}
int solveFWD(vector< vector<int> > &a, int r,int c,int x,int y, int di){
if(x==r-1 && y==c-1){
di+=a[x][y];
a[x][y]=0;
return di;
}
if(btFWD(a,x,y)==true){
di+=a[x][y];
a[x][y]=0;
vector< vector<int> > aCPY=a;
int right=solveFWD(a,r,c,x,y+1,di);
int down=solveFWD(aCPY,r,c,x+1,y,di);
if(right<down){
a=aCPY; // IMP step
return down; // make a copy of array to backtrack
}else{
return right;
}
}else{
return -1; // No Path
}
}
bool btREV(vector < vector<int> > a, int x, int y){
if(x==0 && y==0){
return true;
}
if(valid(a,x,y)==true){
if(btREV(a,x,y-1)==true){
return true;
}
if(btREV(a,x-1,y)==true){
return true;
}
return false;
}
return false;
}
int solveREV(vector< vector<int> > &a, int r,int c,int x,int y, int di){
if(x==0 && y==0){
di+=a[x][y];
a[x][y]=0;
return di;
}
if(btREV(a,x,y)==true){
di+=a[x][y];
a[x][y]=0;
vector< vector<int> > aCPY=a;
int left=solveREV(a,r,c,x,y-1,di);
int up=solveREV(aCPY,r,c,x-1,y,di);
if(left<up){
a=aCPY;
return up;
}else{
return left;
}
}else{
return -1; // No Path
}
}
以上是关于选择题:In one year rats eat 40 to 50 times ___ weight. A.its B.and C.their D.theirs的主要内容,如果未能解决你的问题,请参考以下文章
Python 类的多态
Linux shell script switch...case All In One
在未选择下拉列表时更改对象数组中的值
TOMORROW! 明天!The Beijing Flea Market : One Year Bash 北京跳蚤集市
在Linux上狩猎Netwire RAT
sudo & su & Rust All In One