Submission #1305462


Source Code Expand

#include <stdio.h>

int main(void) {
	int K,S,i,j,k,res;
	scanf("%d%d",&K,&S);
	for(i=2;i<=K;i++){
		for(j=2;j<=K;j++){
			for(k=2;k<=K;k++){
				if(i+j+k==S){
					if(i==j==k){
						res++;
					}
					else if('i==j||i=k||j==k'){
						res+=3;
					}
					else{
						res+=6;
					}
				}
			}
		}
	}
	printf("%d",res);
	return 0;
}

Submission Info

Submission Time
Task B - Sum of Three Integers
User wooltea
Language C++14 (GCC 5.4.1)
Score 0
Code Size 359 Byte
Status WA
Exec Time 2103 ms
Memory 128 KB

Compile Error

./Main.cpp:13:14: warning: character constant too long for its type
      else if('i==j||i=k||j==k'){
              ^
./Main.cpp: In function ‘int main()’:
./Main.cpp:5:21: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
  scanf("%d%d",&K,&S);
                     ^

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 0 / 200
Status
WA × 2
WA × 7
TLE × 3
Set Name Test Cases
Sample sample_01.txt, sample_02.txt
All sample_01.txt, sample_02.txt, subtask_1_01.txt, subtask_1_02.txt, subtask_1_03.txt, subtask_1_04.txt, subtask_1_05.txt, subtask_1_06.txt, subtask_1_07.txt, subtask_1_08.txt
Case Name Status Exec Time Memory
sample_01.txt WA 1 ms 128 KB
sample_02.txt WA 1 ms 128 KB
subtask_1_01.txt TLE 2103 ms 128 KB
subtask_1_02.txt WA 756 ms 128 KB
subtask_1_03.txt TLE 2103 ms 128 KB
subtask_1_04.txt WA 1122 ms 128 KB
subtask_1_05.txt WA 3 ms 128 KB
subtask_1_06.txt WA 144 ms 128 KB
subtask_1_07.txt TLE 2103 ms 128 KB
subtask_1_08.txt WA 60 ms 128 KB