-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path10552:Automated Judge Script.cpp
69 lines (57 loc) · 1.52 KB
/
10552:Automated Judge Script.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
// 10552:Automated Judge Script
# include <bits/stdc++.h>
using namespace std ;
vector<string> vSol, vUser ;
vector<int> vAnswer ;
int main() {
string str ;
int n, m ;
while( cin >> n && n ) {
vSol.clear() ;
vUser.clear() ;
cin.ignore() ;
while( n-- ) {
getline( cin, str ) ;
vSol.push_back( str ) ;
}
cin >> m ;
cin.ignore() ;
while( m-- ) {
getline( cin, str ) ;
vUser.push_back( str ) ;
}
if( vSol == vUser ) {
vAnswer.push_back( 0 ) ;
continue ;
}
string sol, user ;
for( const auto & str : vSol ) {
for( const auto & c : str ) {
if( isdigit( c ) )
sol.push_back( c ) ;
}
}
for( const auto & str : vUser ) {
for( const auto & c : str ) {
if( isdigit( c ) )
user.push_back( c ) ;
}
}
if( sol == user )
vAnswer.push_back( 1 ) ;
else
vAnswer.push_back( 2 ) ;
}
for( int i = 0 ; i < vAnswer.size() ; i++ ) {
cout << "Run #" << i+1 << ": " ;
if( vAnswer[i] == 0 )
cout << "Accepted" ;
else if( vAnswer[i] == 1 )
cout << "Presentation Error" ;
else if( vAnswer[i] == 2 )
cout << "Wrong Answer" ;
cout << endl ;
}
vAnswer.clear() ;
return 0 ;
}