Submission #172303


Source Code Expand

Copy
#include <iostream>
#include <vector>
using namespace std;

int search_max(vector<vector<int>> const& square_, int& x, int& y, int exc) {
    int max = 0;
    x = 0, y = 0;
    int tx = 0, ty = 0;
    for (auto v : square_) {
        for (auto n : v) {
            if (n > max && n < exc) {
                max = n;
                x = tx;
                y = ty;
            }
            tx++;
        }
        tx = 0;
        ty++;
    }
    return max;
}

int main() {
    int r, c, d;
    cin >> r >> c >> d;
    
    vector<vector<int>> square_;
    vector<int> v_tmp;
    for (int i = 0; i < r; ++i) {
        int tmp;
        //vector<int> v_tmp;
        for (int j = 0; i < c; ++j) {
            cin >> tmp;
            v_tmp.push_back(tmp);
        }
        square_.push_back(v_tmp);
        v_tmp.clear();
    }
    
    int max, x, y;
    int exclude = 1000;
    while (true) {
        max = search_max(square_, x, y, exclude);
        if ((x+y)%2 == d%2 && (x+y+2) >= d) {
            cout << max << endl;
            break;
        }
        exclude = max;
    }
}

        

Submission Info

Submission Time
Task B - 謎の人物X
User kotoji
Language C++11 (GCC 4.8.1)
Score 0
Code Size 1142 Byte
Status TLE
Exec Time 2102 ms
Memory 469496 KB

Judge Result

Set Name Sample Subtask1 Subtask2
Score / Max Score 0 / 0 0 / 60 0 / 40
Status
TLE × 3
TLE × 18
TLE × 30
Set Name Test Cases
Sample sample_01.txt, sample_02.txt, sample_03.txt
Subtask1 sample_01.txt, sample_02.txt, sample_03.txt, subtask1_01.txt, subtask1_02.txt, subtask1_03.txt, subtask1_04.txt, subtask1_05.txt, subtask1_06.txt, subtask1_07.txt, subtask1_08.txt, subtask1_09.txt, subtask1_10.txt, subtask1_11.txt, subtask1_12.txt, subtask1_13.txt, subtask1_14.txt, subtask1_15.txt
Subtask2 subtask1_01.txt, subtask1_02.txt, subtask1_03.txt, subtask1_04.txt, subtask1_05.txt, subtask1_06.txt, subtask1_07.txt, subtask1_08.txt, subtask1_09.txt, subtask1_10.txt, subtask1_11.txt, subtask1_12.txt, subtask1_13.txt, subtask1_14.txt, subtask1_15.txt, subtask2_01.txt, subtask2_02.txt, subtask2_03.txt, subtask2_04.txt, subtask2_05.txt, subtask2_06.txt, subtask2_07.txt, subtask2_08.txt, subtask2_09.txt, subtask2_10.txt, subtask2_11.txt, subtask2_12.txt, subtask2_13.txt, subtask2_14.txt, subtask2_15.txt
Case Name Status Exec Time Memory
sample_01.txt TLE 2078 ms 455544 KB
sample_02.txt TLE 2079 ms 469496 KB
sample_03.txt TLE 2081 ms 466036 KB
subtask1_01.txt TLE 2084 ms 464764 KB
subtask1_02.txt TLE 2057 ms 263036 KB
subtask1_03.txt TLE 2088 ms 460028 KB
subtask1_04.txt TLE 2090 ms 461304 KB
subtask1_05.txt TLE 2084 ms 461948 KB
subtask1_06.txt TLE 2083 ms 464256 KB
subtask1_07.txt TLE 2078 ms 434936 KB
subtask1_08.txt TLE 2085 ms 460148 KB
subtask1_09.txt TLE 2087 ms 465912 KB
subtask1_10.txt TLE 2080 ms 460920 KB
subtask1_11.txt TLE 2092 ms 459392 KB
subtask1_12.txt TLE 2090 ms 460408 KB
subtask1_13.txt TLE 2086 ms 466304 KB
subtask1_14.txt TLE 2084 ms 463228 KB
subtask1_15.txt TLE 2089 ms 465408 KB
subtask2_01.txt TLE 2079 ms 436752 KB
subtask2_02.txt TLE 2084 ms 460004 KB
subtask2_03.txt TLE 2085 ms 401148 KB
subtask2_04.txt TLE 2081 ms 461696 KB
subtask2_05.txt TLE 2102 ms 452348 KB
subtask2_06.txt TLE 2076 ms 434436 KB
subtask2_07.txt TLE 2067 ms 333320 KB
subtask2_08.txt TLE 2058 ms 263040 KB
subtask2_09.txt TLE 2065 ms 280312 KB
subtask2_10.txt TLE 2070 ms 269164 KB
subtask2_11.txt TLE 2063 ms 299380 KB
subtask2_12.txt TLE 2059 ms 270972 KB
subtask2_13.txt TLE 2063 ms 280948 KB
subtask2_14.txt TLE 2067 ms 279664 KB
subtask2_15.txt TLE 2062 ms 263048 KB