Submission #171561
Source Code Expand
Copy
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <vector>
#include <algorithm>
#include <string>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <climits>
#include <sstream>
#include <functional>
#include <complex>
using namespace std;
#define len(array) (sizeof (array) / sizeof *(array))
#define rep(i, s, e) for(int i = (s);i < (e);i++)
#define Rep(i, e) for(int i = 0;i < (e);i++)
#define rrep(i, e, s) for(int i = (e);(s) <= i;i--)
#define Rrep(i, e) for(int i = e;0 <= i;i--)
#define mrep(i, e, t1, t2) for(map<t1, t2>::iterator i = e.begin(); i != e.end(); i++)
#define vrange(v) v.begin(), v.end()
#define vrrange(v) v.rbegin(), v.rend()
#define vsort(v) sort(vrange(v))
#define vrsort(v) sort(vrrange(v))
#define arange(a) a, a + len(a)
#define asort(a) sort(arange(a))
#define arsort(a, t) sort(arange(a), greater<t>())
#define afill(a, v) fill(arange(a), v)
#define afill2(a, v, t) fill((t *)(a), (t *)((a) + len(a)), v)
#define fmax(a, b) ((a) < (b)? (b) : (a))
#define fmin(a, b) ((a) > (b)? (b) : (a))
#define fabs(a) ((a) < 0? -(a) : (a))
#define pb push_back
#define fst(e) (e).first
#define snd(e) (e).second
#define rg(e, s, t) (s <= e && e < t)
#define PQDecl(name, tp) priority_queue< tp, vector<tp>, greater<tp> > name
#define dq(q) q.top();q.pop();
#define sz(v) ((int)(v).size())
#define lg(s) ((int)(s).length())
//#define X real()
//#define Y imag()
//typedef unsigned int ui;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> P;
typedef pair<ll, ll> PL;
typedef vector<int> VI;
//typedef complex<double> p;
const int INF = (int)2e9;
const int MOD = (int)1e9 + 7;
const double EPS = 1e-10;
//const int dx[] = {1, -1, 0, 0, 1, -1, -1, 1};
//const int dy[] = {0, 0, 1, -1, -1, -1, 1, 1};
//const ll weight[] = {1e0,1e1,1e2,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13};
typedef struct _Datum {
int fst,snd,trd;
_Datum(int arg1 = 0, int arg2 = 0 , int arg3 = 0) {
fst = arg1; snd = arg2; trd = arg3;
}
bool operator <(const struct _Datum &e) const{
return fst == e.fst? (snd == e.snd? trd < e.trd : snd < e.snd) : fst < e.fst;
}
bool operator >(const struct _Datum &e) const{
return fst == e.fst? (snd == e.snd? trd > e.trd : snd > e.snd) : fst > e.fst;
}
}datum;
void prtAI(int *a, int n, bool display = true){
if(display) printf("---printAI---\n");
Rep(i, n) printf("%d%c", a[i], i==n-1?'\n':' ');
if(display) printf("-----------------\n");
}
void prtVI(const VI &v, bool display = true){
if(display) printf("-----printVI-----\n");
Rep(i, sz(v)) printf("%d%c", v[i], i==sz(v)-1?'\n':' ');
if(display) printf("-----------------\n");
}
#define MAX_N 100005
void solve(){
int r, c, d, a[1002][1002], ans = -1;
scanf("%d%d%d", &r, &c, &d);
Rep(i, r){
Rep(j, c){
int dist = d - (i + j);
scanf("%d", &a[i][j]);
if(dist >= 0 && dist % 2 == 0){
ans = max(ans, a[i][j]);
}
}
}
cout << ans << endl;
}
void doIt(){
int t = 1;
// scanf("%d", &t);
while(t--){
solve();
}
}
int main() {
doIt();
return 0;
}
Submission Info
Submission Time
2014-05-17 21:13:06+0900
Task
B - 謎の人物X
User
mkiken
Language
C++ (G++ 4.6.4)
Score
100
Code Size
3313 Byte
Status
AC
Exec Time
170 ms
Memory
4652 KB
Compile Error
./Main.cpp: In function ‘void solve()’:
./Main.cpp:90:32: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
./Main.cpp:94:34: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
Judge Result
Set Name
Sample
Subtask1
Subtask2
Score / Max Score
0 / 0
60 / 60
40 / 40
Status
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
AC
22 ms
924 KB
sample_02.txt
AC
23 ms
932 KB
sample_03.txt
AC
21 ms
924 KB
subtask1_01.txt
AC
21 ms
924 KB
subtask1_02.txt
AC
22 ms
932 KB
subtask1_03.txt
AC
23 ms
1120 KB
subtask1_04.txt
AC
22 ms
1308 KB
subtask1_05.txt
AC
21 ms
928 KB
subtask1_06.txt
AC
22 ms
1056 KB
subtask1_07.txt
AC
22 ms
1180 KB
subtask1_08.txt
AC
23 ms
1140 KB
subtask1_09.txt
AC
26 ms
1196 KB
subtask1_10.txt
AC
24 ms
1192 KB
subtask1_11.txt
AC
24 ms
1192 KB
subtask1_12.txt
AC
24 ms
1192 KB
subtask1_13.txt
AC
24 ms
1192 KB
subtask1_14.txt
AC
24 ms
1196 KB
subtask1_15.txt
AC
24 ms
1188 KB
subtask2_01.txt
AC
22 ms
800 KB
subtask2_02.txt
AC
28 ms
4644 KB
subtask2_03.txt
AC
69 ms
2600 KB
subtask2_04.txt
AC
23 ms
808 KB
subtask2_05.txt
AC
28 ms
1188 KB
subtask2_06.txt
AC
46 ms
1828 KB
subtask2_07.txt
AC
149 ms
4644 KB
subtask2_08.txt
AC
160 ms
4648 KB
subtask2_09.txt
AC
164 ms
4652 KB
subtask2_10.txt
AC
170 ms
4652 KB
subtask2_11.txt
AC
153 ms
4644 KB
subtask2_12.txt
AC
160 ms
4640 KB
subtask2_13.txt
AC
166 ms
4640 KB
subtask2_14.txt
AC
168 ms
4636 KB
subtask2_15.txt
AC
170 ms
4644 KB