QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#252636#7728. RamenLiLIWA 58ms52300kbJava111.2kb2023-11-15 23:06:102023-11-15 23:06:11

Judging History

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

  • [2023-11-15 23:06:11]
  • 评测
  • 测评结果:WA
  • 用时:58ms
  • 内存:52300kb
  • [2023-11-15 23:06:10]
  • 提交

answer


import java.util.Scanner;
import java.util.ArrayList;
import java.io.*;
import java.util.StringTokenizer;
public class Main{
    static BufferedReader reader=new BufferedReader(new InputStreamReader(System.in));
    static PrintWriter pw=new PrintWriter(new OutputStreamWriter(System.out));
    static StringTokenizer tokenizer=new StringTokenizer("");
    static String next() throws IOException {
        while (!tokenizer.hasMoreTokens()) {
            tokenizer = new StringTokenizer(reader.readLine());
        }
        return tokenizer.nextToken();
    }
    static int nextInt() throws IOException
    {
        return Integer.parseInt(next());
    }
    static double Double() throws IOException
    {
        return Double.parseDouble(next());
    }
    static long nextlong() throws IOException
    {
        return Long.parseLong(next());
    }
    public static void main(String[] args)throws IOException {
    
    	int n=nextInt();
    	int []a=new int[n];
    	for(int i=0;i<n;i++)
    	{
    		a[i]=nextInt();
    	}
    	int sum=0;
    	for(int i:a)
    	{
    		sum+=i;
    	}
    	if(sum%2==0)
    	{
    		pw.println("Yes");
    	}
    	else {
    		pw.println("No");
    	}
    	
        pw.close();
    }
}

详细

Test #1:

score: 100
Accepted
time: 57ms
memory: 48844kb

input:

3
1 2 -5

output:

Yes

result:

ok YES

Test #2:

score: 0
Accepted
time: 48ms
memory: 48808kb

input:

5
2 -5 2 3 1

output:

No

result:

ok NO

Test #3:

score: 0
Accepted
time: 37ms
memory: 48760kb

input:

5
3 -2 1 -1 -1

output:

Yes

result:

ok YES

Test #4:

score: 0
Accepted
time: 41ms
memory: 52300kb

input:

5
-1 100 100 100 100

output:

No

result:

ok NO

Test #5:

score: -100
Wrong Answer
time: 58ms
memory: 48852kb

input:

5
3 -3 2 5 1

output:

Yes

result:

wrong answer expected NO, found YES [1st token]