Coderforces Beautiful Matrix
2017-06-14 21:07
323 查看
http://codeforces.com/problemset/problem/263/A
import java.util.Scanner;
public class Beautiful_Matrix {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
for(int i = 0; i < 5; i++) {
for(int j = 0; j < 5; j++) {
int k = scanner.nextInt();
if(k == 1) {
System.out.println(Math.abs(i-2) + Math.abs(j-2));
}
}
}
}
}
import java.util.Scanner;
public class Beautiful_Matrix {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
for(int i = 0; i < 5; i++) {
for(int j = 0; j < 5; j++) {
int k = scanner.nextInt();
if(k == 1) {
System.out.println(Math.abs(i-2) + Math.abs(j-2));
}
}
}
}
}
相关文章推荐
- 【COderForces】OR in Matrix
- Educational Codeforces Round 30 C. Strange Game On Matrix
- (Coderforces 873C)C. Strange Game On Matrix 贪心+模拟
- Educational Codeforces Round 31 E. Binary Matrix 并查集
- Coderforces 507B 易错
- codeforces C. Inna and Huge Candy Matrix
- Coderforces Team
- Codeforces Round #225 (Div. 2) A.Coder
- coderforces 702C Cellular Network(二分)
- Coderforces Rockethon 2014 Trial Contest: Testing Round #10 A2. Skis
- Codeforces Round #236 (Div. 2) E. Strictly Positive Matrix 强连通
- Coderforces 20C 最短路记录路径
- Beautiful numbers CodeForces - 51D
- 【HDU5569 BestCoder Round 63 (div1)B】【DP】matrix 向右走向下走最大乘积和
- Educational Codeforces Round 31 E. Binary Matrix 并查集
- Codeforces/TopCoder/ProjectEuler/CodeChef 散题笔记 (持续更新)
- CoderForces #282 Dic2 D--Obsessive String
- Educational Codeforces Round 12 E. Beautiful Subarrays
- coderforces 22C 构图水题
- Educational Codeforces Round 39: E. Largest Beautiful Number