Submission #7052043
Source Code Expand
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); final int N = sc.nextInt(); final int M = sc.nextInt(); final int friendLength = N*(N-1)/2; final boolean[] isFriend = new boolean[friendLength]; for (int i = 0; i < M; i++) { int xi = sc.nextInt(); int yi = sc.nextInt(); isFriend[(2*N-xi-2)*(xi-1)/2 + yi-2] = true; } sc.close(); int intOut = 1; int x; int y; A: for(int bitNumber = 1; bitNumber <= (1 << N) - 1; bitNumber++){ int groupL = Integer.bitCount(bitNumber); if(groupL <= intOut){ continue; } boolean flag = true; for(x = 0; x <= N - 2; x++){ for(y = x + 1; y <= N - 1; y++){ if(((bitNumber >> x) & (bitNumber >> y) & 1) == 1){ if(!isFriend[(2*N-x-3)*x/2 + y-1]){ flag = false; continue A; } } } } if(flag){ intOut = groupL; } } String strOut = Integer.toString(intOut); System.out.println(strOut); } }
Submission Info
Submission Time | |
---|---|
Task | A - 正直者 |
User | ste234689ado |
Language | Java8 (OpenJDK 1.8.0) |
Score | 0 |
Code Size | 1050 Byte |
Status | RE |
Exec Time | 224 ms |
Memory | 553300 KB |
Judge Result
Set Name | all | ||||
---|---|---|---|---|---|
Score / Max Score | 0 / 100 | ||||
Status |
|
Set Name | Test Cases |
---|---|
all | 00_sample_01.txt, 00_sample_02.txt, kensho_diff01, kensho_diff02, kensho_diff03, kensho_diff04, kensho_diff05, kensho_min-max01, kensho_min-max02, kensho_min-max03, kensho_min-max04, kensho_min-max05, kensho_min-max06, kensho_min-max07, kensho_min-max08, kensho_min-max09, kensho_min-max10, kensho_rand01, kensho_rand02, kensho_rand03, kensho_rand04, kensho_rand05, kensho_rand06, kensho_rand07, kensho_rand08, kensho_rand09, kensho_rand10 |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
00_sample_01.txt | RE | 95 ms | 19028 KB |
00_sample_02.txt | RE | 109 ms | 36076 KB |
kensho_diff01 | MLE | 201 ms | 450636 KB |
kensho_diff02 | RE | 110 ms | 37844 KB |
kensho_diff03 | MLE | 155 ms | 266068 KB |
kensho_diff04 | RE | 94 ms | 19796 KB |
kensho_diff05 | MLE | 214 ms | 512084 KB |
kensho_min-max01 | RE | 112 ms | 38484 KB |
kensho_min-max02 | RE | 109 ms | 33512 KB |
kensho_min-max03 | RE | 94 ms | 19796 KB |
kensho_min-max04 | RE | 94 ms | 20948 KB |
kensho_min-max05 | RE | 109 ms | 40532 KB |
kensho_min-max06 | RE | 95 ms | 19796 KB |
kensho_min-max07 | RE | 108 ms | 36588 KB |
kensho_min-max08 | RE | 109 ms | 33516 KB |
kensho_min-max09 | RE | 109 ms | 34284 KB |
kensho_min-max10 | RE | 92 ms | 19924 KB |
kensho_rand01 | RE | 109 ms | 34156 KB |
kensho_rand02 | RE | 94 ms | 23252 KB |
kensho_rand03 | RE | 110 ms | 38380 KB |
kensho_rand04 | RE | 108 ms | 40660 KB |
kensho_rand05 | RE | 94 ms | 19412 KB |
kensho_rand06 | RE | 94 ms | 21588 KB |
kensho_rand07 | RE | 93 ms | 21588 KB |
kensho_rand08 | MLE | 224 ms | 553300 KB |
kensho_rand09 | MLE | 149 ms | 248020 KB |
kensho_rand10 | MLE | 169 ms | 325076 KB |