結果

問題 No.239 にゃんぱすー
コンテスト
ユーザー ああ
提出日時 2026-10-14 01:58:55
言語 Rust
(1.97.1 + proconio + num + itertools + ACL)
コンパイル:
/usr/bin/rustc_custom
実行:
./target/release/main
結果
AC  
実行時間 1 ms / 2,000 ms
+ 601µs
コード長 486 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 606 ms
コンパイル使用メモリ 184,504 KB
実行使用メモリ 9,920 KB
最終ジャッジ日時 2026-10-14 01:59:02
合計ジャッジ時間 4,049 ms
ジャッジサーバーID
(参考情報)
judge5_0 / judge4_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 34
権限があれば一括ダウンロードができます
コンパイルメッセージ
warning: unnecessary parentheses around `for` iterator expression
 --> src/main.rs:8:14
  |
8 |     for i in (0..n){
  |              ^    ^
  |
  = note: `#[warn(unused_parens)]` (part of `#[warn(unused)]`) on by default
help: remove these parentheses
  |
8 -     for i in (0..n){
8 +     for i in 0..n {
  |

warning: unnecessary parentheses around `for` iterator expression
 --> src/main.rs:9:18
  |
9 |         for j in (0..n){
  |                  ^    ^
  |
help: remove these parentheses
  |
9 -         for j in (0..n){
9 +         for j in 0..n {
  |

warning: unnecessary parentheses around `for` iterator expression
  --> src/main.rs:21:18
   |
21 |         for i in (0..n){
   |                  ^    ^
   |
help: remove these parentheses
   |
21 -         for i in (0..n){
21 +         for i in 0..n {
   |

warning: unused variable: `i`
 --> src/main.rs:8:9
  |
8 |     for i in (0..n){
  |         ^ help: if this is intentional, prefix it with an underscore: `_i`
  |
  = note: `#[warn(unused_variables)]` (part of `#[warn(unused)]`) on by default

ソースコード

diff #
raw source code

use proconio::input;
fn main(){
    input!{
        n:usize,
    }
    let mut a=[1;100];
    let mut ans=n;
    for i in (0..n){
        for j in (0..n){
            input!{
                s:String,
            }
            if s!="nyanpass" && s!="-"{
                ans-=a[j];a[j]=0;
            }
        }
    }
    if ans!=1{
        print!("{}",-1);
    } else {
        for i in (0..n){
            if a[i]==1{
                print!("{}",i+1);
            }
        }
    }
}
0