結果

問題 No.1041 直線大学
コンテスト
ユーザー ああ
提出日時 2026-10-14 18:35:02
言語 Rust
(1.99.0 + proconio + num + itertools + ACL)
コンパイル:
/usr/bin/rustc_custom
実行:
./target/release/main
結果
AC  
実行時間 1 ms / 2,000 ms
+ 387µs
コード長 627 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 577 ms
コンパイル使用メモリ 188,128 KB
実行使用メモリ 9,888 KB
最終ジャッジ日時 2026-10-14 18:35:08
合計ジャッジ時間 3,362 ms
ジャッジサーバーID
(参考情報)
judge2_0 / judge1_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 37
権限があれば一括ダウンロードができます
コンパイルメッセージ
warning: unused import: `std::collections::HashMap`
 --> src/main.rs:2:5
  |
2 | use std::collections::HashMap;
  |     ^^^^^^^^^^^^^^^^^^^^^^^^^
  |
  = note: `#[warn(unused_imports)]` (part of `#[warn(unused)]`) on by default

warning: unused import: `std::collections::BTreeSet`
 --> src/main.rs:3:5
  |
3 | use std::collections::BTreeSet;
  |     ^^^^^^^^^^^^^^^^^^^^^^^^^^

warning: unnecessary parentheses around `for` iterator expression
  --> src/main.rs:10:14
   |
10 |     for i in (0..n){
   |              ^    ^
   |
   = note: `#[warn(unused_parens)]` (part of `#[warn(unused)]`) on by default
help: remove these parentheses
   |
10 -     for i in (0..n){
10 +     for i in 0..n {
   |

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

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

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

ソースコード

diff #
raw source code

use proconio::input;
use std::collections::HashMap;
use std::collections::BTreeSet;
fn main(){
    input!{
        n:usize,
    }
    let mut a=[0;100];
    let mut b=[0;100];
    for i in (0..n){
        input!{
            c:usize,d:usize,
        }
        a[i]=c;b[i]=d;
    }
    let mut ans=0;
    for i in (0..n){
        for j in (0..i){
            let mut c=0;
            for l in (0..n){
                if (a[l]-a[i])*(b[j]-b[i])-(b[l]-b[i])*(a[j]-a[i])==0{
                    c+=1;
                }
            }
            if ans<c{
                ans=c;
            }
        }
    }
    print!("{}",ans);
}
0