Submission #3769367


Source Code Expand

function Main(input){
	input = input.split("\n");
  var list = {};
  var len = input.length;
  var lastchar = input[1][0];
  for(var i = 1; i < len;i++){
  	var text = input[i];
    if(text[0]!==lastchar)return"No";
    if(list[text])return "No";
    list[text] = 1;
    lastchar = text[text.length-1];
  }
  
  return "Yes";
}

// If you are interested in the algorithms I used, 
// there is no need to read down from this line.

((b,c,d)=>"undefined"!=typeof require?console.log(Main(require("fs").readFileSync("/dev/stdin","utf8"))):[b=b.split("\n").slice(1,-1).join("\n"),c=function(){try{return Main(b)}catch(f){return f.stack||f.message}}(),d=typeof c,"string"==d||(c=JSON.stringify(c)),$("<form>").append([[10,b],0,[1,d],0,[10,c]].map(f=>$(f?"<textarea>":"<br>",f&&{rows:f[0],cols:40,text:f[1]}))).appendTo("body")])(`
8
a
aa
aaa
aaaa
aaaaa
aaaaaa
aaa
aaaaaaa
`);

Submission Info

Submission Time
Task B - Shiritori
User mukakego
Language JavaScript (node.js v5.12)
Score 0
Code Size 899 Byte
Status WA
Exec Time 54 ms
Memory 7372 KB

Judge Result

Set Name All Sample
Score / Max Score 0 / 200 0 / 0
Status
AC × 13
WA × 4
AC × 3
WA × 1
Set Name Test Cases
All max_1, max_2, max_3, max_4, min_1, no1_1, no1_2, no2_1, no2_2, random_1, random_2, sample_01, sample_02, sample_03, sample_04, yes_1, yes_2
Sample sample_01, sample_02, sample_03, sample_04
Case Name Status Exec Time Memory
max_1 AC 52 ms 7372 KB
max_2 WA 52 ms 7372 KB
max_3 AC 52 ms 7372 KB
max_4 AC 53 ms 7372 KB
min_1 AC 52 ms 7372 KB
no1_1 AC 53 ms 7372 KB
no1_2 AC 53 ms 7372 KB
no2_1 AC 52 ms 7372 KB
no2_2 AC 53 ms 7372 KB
random_1 AC 52 ms 7372 KB
random_2 AC 53 ms 7372 KB
sample_01 AC 52 ms 7372 KB
sample_02 WA 52 ms 7372 KB
sample_03 AC 54 ms 7372 KB
sample_04 AC 53 ms 7372 KB
yes_1 WA 53 ms 7372 KB
yes_2 WA 52 ms 7372 KB