|
kasama |
|
import java.util.*;
public class Question496 { public static void main(String args[]) { Integer nos[] = new Integer[14]; for(int i = 0; i < 14; ++i) nos[i] = new Integer(i+1); int count = 0; List list = new Combination(Arrays.asList(nos), 4).getList(); // クラスCombinationは#19625を使用 for (Iterator iter = list.iterator(); iter.hasNext(); ) { List eList = (List) iter.next(); int a = ((Integer) eList.get(0)).intValue(); int i = ((Integer) eList.get(1)).intValue(); int u = ((Integer) eList.get(2)).intValue(); int e = ((Integer) eList.get(3)).intValue(); if (a + e == i + u) ++count; } System.out.println(count); } } |
|
和歌山県
4月6日(木) 0:07:49
27101 |