結果
| 問題 | No.345 最小チワワ問題 |
| コンテスト | |
| ユーザー |
FVRChan
|
| 提出日時 | 2017-09-29 10:12:12 |
| 言語 | Java (openjdk 25.0.2) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 356 bytes |
| 記録 | |
| コンパイル時間 | 2,737 ms |
| コンパイル使用メモリ | 81,816 KB |
| 実行使用メモリ | 43,264 KB |
| 最終ジャッジ日時 | 2026-05-10 18:59:19 |
| 合計ジャッジ時間 | 5,876 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 4 WA * 19 RE * 6 |
ソースコード
import java.util.Scanner;
public class Main{
private static Scanner sc=new Scanner(System.in);
public static void main(String args[])throws Exception{
String s=sc.nextLine();
s=s.substring(s.indexOf('c'),s.lastIndexOf('w')+1);
if(s.lastIndexOf('w') == s.indexOf('w')){
System.out.println(-1);
}else{
System.out.println(s.length());
}
}
}
FVRChan