QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#344603 | #7962. 前缀和 | knightzzz1# | RE | 0ms | 0kb | C++14 | 1.5kb | 2024-03-04 20:19:17 | 2024-03-04 20:19:17 |
Judging History
answer
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
vector<pair<int,int> > v;
bool cmp( pair<int,int> a , pair<int,int> b ){
if( a.first == b.first ){
return a.second < b.second ;
}
return a.first < b.first ;
}
void solve(){
int c = 0;v.clear() ;
for(int i = 0; i < 5; ++i)
for(int j = 0; j < 5; ++j){
char x;
cin >> x;
if(x == 'o'){
c++ ;
v.push_back( { i , j } ) ;
}
}
if(c == 2) cout << "Far\n";
else if( c == 3 || c == 1 )cout << "Away\n";
else{
bool fg = true ;
for(int i = 0 ; i < 3 ; i ++ ){
if( v[ i ].first != v[ i + 1 ].first ){
fg = false ; break;
}
}
if( fg ){
cout << "Away\n";return ;
}
fg = true ;
for(int i = 0 ; i < 3 ; i ++ ){
if( v[ i ].second != v[ i + 1 ].second ){
fg = false ; break;
}
}
if( fg ){
cout << "Away\n";return ;
}
fg = true ;
sort( v.begin() , v.end() , cmp ) ;
if( v[ 0 ].first == v[ 1 ].first && v[ 2 ].first == v[ 3 ].first && v[ 0 ].second == v[ 2 ].second ){
cout << "Away\n";
}else{
cout << "Far\n";
}
}
}
int main(){
cin.tie(0);
cout.tie(0);
ios::sync_with_stdio(false);
int T;
cin >> T;
while(T--) solve();
return 0;
}
詳細信息
Test #1:
score: 0
Runtime Error
input:
3 0.5 1 2