Submission #7067019


Source Code Expand

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
#define all(x) (x).begin(),(x).end()
#define pll pair<ll,ll>
#define rep(i,n) for(int i=0;i<n;i++) 
const ll INF = 1LL<<60;
const ll mod = (int)1e9 + 7;

int main() {
    //ll N; cin >> N;
    //ll N,M; cin >> N >> M;
    //string S; cin >> S;
    ll H,W; cin >> H >> W;
    bool five=false;
    int ma=0;
    rep(i,H*W){
        int a;
        cin >> a;
        if(a==5)five=true;
        chmax(ma,a);
    }
    if(five){
        cout << "Yes" << ' ';
        if(ma<=5)cout << 1;
        if(ma==6)cout << 2;
        if(ma==7)cout << 2;
        if(ma==8)cout << 3;
        if(ma==9)cout << 4;
    }
    else cout << "No";
}

/*



 */

Submission Info

Submission Time
Task B - 10 puzzle
User lucky_space
Language C++14 (GCC 5.4.1)
Score 0
Code Size 945 Byte
Status WA
Exec Time 3 ms
Memory 256 KB

Judge Result

Set Name All
Score / Max Score 0 / 100
Status
AC × 20
WA × 25
Set Name Test Cases
All 0-sample-1, 0-sample-2, 0-sample-3, 0-sample-4, 1-random-small-0, 1-random-small-1, 1-random-small-2, 1-random-small-3, 1-random-small-4, 2-random-large-0, 2-random-large-1, 2-random-large-2, 2-random-large-3, 2-random-large-4, 3-random-line-0, 3-random-line-1, 3-random-line-10, 3-random-line-11, 3-random-line-12, 3-random-line-13, 3-random-line-14, 3-random-line-15, 3-random-line-16, 3-random-line-2, 3-random-line-3, 3-random-line-4, 3-random-line-5, 3-random-line-6, 3-random-line-7, 3-random-line-8, 3-random-line-9, 4-zero-0, 4-zero-1, 4-zero-2, 5-no-0, 5-no-1, 5-no-2, 6-minimum-0, 6-minimum-1, 6-minimum-2, 9-hand-0, 9-hand-1, 9-hand-2, 9-hand-3, 9-hand-4
Case Name Status Exec Time Memory
0-sample-1 AC 1 ms 256 KB
0-sample-2 AC 1 ms 256 KB
0-sample-3 AC 1 ms 256 KB
0-sample-4 AC 1 ms 256 KB
1-random-small-0 AC 1 ms 256 KB
1-random-small-1 AC 1 ms 256 KB
1-random-small-2 AC 1 ms 256 KB
1-random-small-3 AC 1 ms 256 KB
1-random-small-4 AC 1 ms 256 KB
2-random-large-0 AC 3 ms 256 KB
2-random-large-1 AC 3 ms 256 KB
2-random-large-2 AC 3 ms 256 KB
2-random-large-3 AC 3 ms 256 KB
2-random-large-4 AC 3 ms 256 KB
3-random-line-0 WA 1 ms 256 KB
3-random-line-1 WA 1 ms 256 KB
3-random-line-10 WA 1 ms 256 KB
3-random-line-11 WA 1 ms 256 KB
3-random-line-12 WA 1 ms 256 KB
3-random-line-13 WA 1 ms 256 KB
3-random-line-14 WA 1 ms 256 KB
3-random-line-15 WA 1 ms 256 KB
3-random-line-16 AC 1 ms 256 KB
3-random-line-2 WA 1 ms 256 KB
3-random-line-3 WA 1 ms 256 KB
3-random-line-4 WA 1 ms 256 KB
3-random-line-5 WA 1 ms 256 KB
3-random-line-6 WA 1 ms 256 KB
3-random-line-7 WA 1 ms 256 KB
3-random-line-8 WA 1 ms 256 KB
3-random-line-9 WA 1 ms 256 KB
4-zero-0 WA 3 ms 256 KB
4-zero-1 WA 1 ms 256 KB
4-zero-2 WA 1 ms 256 KB
5-no-0 AC 3 ms 256 KB
5-no-1 AC 1 ms 256 KB
5-no-2 AC 1 ms 256 KB
6-minimum-0 AC 1 ms 256 KB
6-minimum-1 WA 1 ms 256 KB
6-minimum-2 AC 1 ms 256 KB
9-hand-0 WA 1 ms 256 KB
9-hand-1 WA 1 ms 256 KB
9-hand-2 WA 1 ms 256 KB
9-hand-3 WA 1 ms 256 KB
9-hand-4 WA 1 ms 256 KB