QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#549049#7932. AND-OR closureHalffiveRE 39ms37504kbJava8801b2024-09-06 01:13:012024-09-06 01:13:02

Judging History

你现在查看的是最新测评结果

  • [2024-09-06 01:13:02]
  • 评测
  • 测评结果:RE
  • 用时:39ms
  • 内存:37504kb
  • [2024-09-06 01:13:01]
  • 提交

answer

import java.util.*;
import java.io.*;
import java.util.StringTokenizer;

public class closure {
	public static void main(String[] args) throws IOException {
		BufferedReader r = new BufferedReader(new InputStreamReader(System.in));
		PrintWriter pw = new PrintWriter(System.out);

		StringTokenizer st = new StringTokenizer(r.readLine());
		ArrayList<Integer> cool = new ArrayList<Integer>();
		int ite = Integer.parseInt(st.nextToken());
		st = new StringTokenizer(r.readLine());
		for(int i = 0; i<ite; i++){
		 cool.add(Integer.parseInt(st.nextToken()));
		}
		for(int i = 0; i<cool.size()-1; i++){
			for(int ii = i+1; ii<cool.size(); ii++){
				int wow = (cool.get(i) | cool.get(ii)); 
				if(!cool.contains(wow)){
					cool.add(wow);
				}
			}
		}
		pw.println(cool.size());
		pw.close();
	}
}

详细

Test #1:

score: 100
Accepted
time: 39ms
memory: 37152kb

input:

4
0 1 3 5

output:

5

result:

ok 1 number(s): "5"

Test #2:

score: 0
Accepted
time: 39ms
memory: 37504kb

input:

5
0 1 2 3 4

output:

8

result:

ok 1 number(s): "8"

Test #3:

score: -100
Runtime Error

input:

49
1097363587067 1096810445814 275012137504 1096739142630 1096809921522 1087071335264 829364908576 949625500192 1087142638448 1096200190829 1097292808175 1095750860656 1087144145776 1097346808827 1095734082416 1096755396578 829230678048 1095663303524 1087072842592 1096216444777 949623992864 10962714...

output:


result: