Contest Duration: - (local time) (90 minutes) Back to Home

Submission #171925

Source Code Expand

Copy
```#include <map>
#include <set>
#include <list>
#include <cmath>
#include <queue>
#include <stack>
#include <cstdio>
#include <string>
#include <vector>
#include <complex>
#include <cstdlib>
#include <cstring>
#include <numeric>
#include <sstream>
#include <iostream>
#include <algorithm>
#include <functional>

#define mp       make_pair
#define pb       push_back
#define all(x)   (x).begin(),(x).end()
#define rep(i,n) for(int i=0;i<(n);i++)

using namespace std;

typedef    long long          ll;
typedef    unsigned long long ull;
typedef    vector<bool>       vb;
typedef    vector<int>        vi;
typedef    vector<vb>         vvb;
typedef    vector<vi>         vvi;
typedef    pair<int,int>      pii;

const int INF=1<<29;
const double EPS=1e-9;

const int dx[]={1,0,-1,0},dy[]={0,-1,0,1};

int main(){
int R,C,D;
cin>>R>>C>>D;
vector<pair<int,pii> >  data;
for(int i = 1;i <= R;i++){
for(int j = 1;j <= C;j++){
int x;
cin>>x;
data.push_back(mp(x,mp(i,j)));
}
}
sort(data.begin(),data.end());
for(int i = 0;i < data.size();i++){
int y = data[data.size() - 1 - i ].second.first;
int x = data[data.size() - 1 - i ].second.second;
if((D - (x + y - 2))>=0&&(D - (x + y - 2))%2 == 0){
cout <<data[data.size() - 1 - i].first<<endl;
return 0;
}
}
return 0;
}```

#### Submission Info

Submission Time 2014-05-17 21:48:38+0900 B - 謎の人物X togatoga C++ (G++ 4.6.4) 100 1353 Byte AC 626 ms 13248 KB

#### Judge Result

Score / Max Score 0 / 0 60 / 60 40 / 40
Status
 AC × 3
 AC × 18
 AC × 30
Set Name Test Cases
Sample sample_01.txt, sample_02.txt, sample_03.txt
Case Name Status Exec Time Memory
sample_01.txt AC 23 ms 796 KB
sample_02.txt AC 23 ms 796 KB
sample_03.txt AC 22 ms 788 KB
subtask1_01.txt AC 20 ms 804 KB
subtask1_02.txt AC 20 ms 912 KB
subtask1_03.txt AC 22 ms 808 KB
subtask1_04.txt AC 25 ms 1068 KB
subtask1_05.txt AC 23 ms 796 KB
subtask1_06.txt AC 23 ms 916 KB
subtask1_07.txt AC 25 ms 1052 KB
subtask1_08.txt AC 26 ms 1172 KB
subtask1_09.txt AC 25 ms 1172 KB
subtask1_10.txt AC 26 ms 1152 KB
subtask1_11.txt AC 26 ms 1064 KB
subtask1_12.txt AC 26 ms 1048 KB
subtask1_13.txt AC 26 ms 1172 KB
subtask1_14.txt AC 26 ms 1180 KB
subtask1_15.txt AC 24 ms 1060 KB
subtask2_01.txt AC 21 ms 916 KB
subtask2_02.txt AC 22 ms 920 KB
subtask2_03.txt AC 198 ms 7052 KB
subtask2_04.txt AC 23 ms 928 KB
subtask2_05.txt AC 46 ms 1728 KB
subtask2_06.txt AC 117 ms 3984 KB
subtask2_07.txt AC 360 ms 13196 KB
subtask2_08.txt AC 600 ms 13208 KB
subtask2_09.txt AC 552 ms 13248 KB
subtask2_10.txt AC 597 ms 13204 KB
subtask2_11.txt AC 532 ms 13208 KB
subtask2_12.txt AC 626 ms 13208 KB
subtask2_13.txt AC 584 ms 13204 KB
subtask2_14.txt AC 612 ms 13200 KB
subtask2_15.txt AC 582 ms 13204 KB