50210. Find the Indices
難度:2/5 Used Time: 5:251
2
3
4
5
6
7
8
9
10
11
12
13
14
15#include <stdio.h>
#include <stdlib.h>
#include "findRowAndColumn.h"
void findRowAndColumn(int **ptr, int *Row, int *Col, int **start, int *ansRow, int *ansCol){
for(int i = 0; ptr[i] != NULL; i++){
int *p = ptr[i], *st = start[i];
int r = Row[i], c = Col[i];
int d = p - st;
ansRow[i] = d / c;
ansCol[i] = d % c;
}
}
50210. Find the Indices
https://aaronlin1229.github.io/judgegirl_50210/