結果

問題 No.342 一番ワロタww
ユーザー worksapproval
提出日時 2018-10-26 13:22:02
言語 JavaScript
(node v23.5.0)
結果
RE  
実行時間 -
コード長 643 bytes
コンパイル時間 30 ms
コンパイル使用メモリ 6,952 KB
実行使用メモリ 41,840 KB
最終ジャッジ日時 2024-10-13 00:51:37
合計ジャッジ時間 1,540 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample RE * 3
other RE * 14
権限があれば一括ダウンロードができます

ソースコード

diff #

process.stdin.resume();
process.stdin.setEncoding('utf8');
// Your code here!

functin solution(S){
    S = S.match(/[^w]+.*/)[0];
    let ar = S.split(/(w+)/);
    let longest = 0;
    let resultIndex = [];
    console.log(ar);
    for(let i=0;i<ar.length;i++){
        let p = /[w]+/;
        if(p.test(ar[i])){
            if(ar[i].length>longest){
                longest = ar[i].length;
                resultIndex=[];
                resultIndex.push(i);
            }else if(ar[i].length==longest){
                resultIndex.push(i);
            }
        }
    }
    for(i of resultIndex){
        console.log(ar[i-1]);
    }
}
0