Submission #763916


Source Code Expand

Copy
#include<stdio.h>
#include<string>
using namespace std;

int main(){
	char input[21];
	string S;
	string copy;
	int i;
	bool b = false;
	string music[] = {
		"Do", "", "Re", "", "Mi", "Fa", "", "So", "", "La", "", "Si", "Do", "", "Re", "", "Mi"
	};
	scanf("%s", input);
	S = input;
	for (i = 0; i < 19; i++){
		if (S[i] == 'W'&&S[i + 1] == 'W'){
			copy = S.substr(i + 2, 5);
			break;
		}
	}
	for (int j = 0; j < 4; j++){
		if (copy[j] == 'W'&&copy[j + 1] == 'W')
			b = true;
	}
	if (b){
		printf("%s\n", music[11 - i].c_str());
	}
	else {
		printf("%s\n", music[16 - i].c_str());
	}
	return 0;
}

Submission Info

Submission Time
Task A - 高橋直体
User autumn_eel
Language C++14 (GCC 5.4.1)
Score 0
Code Size 630 Byte
Status
Exec Time 4 ms
Memory 256 KB

Compile Error

./Main.cpp: In function ‘int main()’:
./Main.cpp:14:20: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
  scanf("%s", input);
                    ^

Judge Result

Set Name Score / Max Score Test Cases
Sample 0 / 0 example_0.txt, example_1.txt, example_2.txt, example_3.txt
All 0 / 100 example_0.txt, example_1.txt, example_2.txt, example_3.txt, random_0.txt, random_1.txt, random_2.txt, random_3.txt, random_4.txt, random_5.txt, random_6.txt, random_7.txt, random_8.txt, random_9.txt
Case Name Status Exec Time Memory
example_0.txt 4 ms 256 KB
example_1.txt 3 ms 256 KB
example_2.txt 4 ms 256 KB
example_3.txt 4 ms 256 KB
random_0.txt 3 ms 256 KB
random_1.txt 3 ms 256 KB
random_2.txt 3 ms 256 KB
random_3.txt 3 ms 256 KB
random_4.txt 4 ms 256 KB
random_5.txt 4 ms 256 KB
random_6.txt 4 ms 256 KB
random_7.txt 4 ms 256 KB
random_8.txt 4 ms 256 KB
random_9.txt 4 ms 256 KB