結果

問題 No.2174 3 O'clock Easy
ユーザー Chicken-iniadChicken-iniad
提出日時 2022-12-23 13:13:05
言語 Rust
(1.77.0)
結果
WA  
実行時間 -
コード長 424 bytes
コンパイル時間 11,544 ms
コンパイル使用メモリ 401,776 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-05-01 06:01:01
合計ジャッジ時間 12,322 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 AC 1 ms
6,940 KB
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

use proconio::input;
// use std::cmp;
//use std::collections::VecDeque;
// use std::collections::HashSet;

fn main() {
    input! {
        n: i32,
    }
    let mut result = 0; 
    for i in 1..n+1 {
        if i % 3 == 1 {
            result += i;
        } else if i % 3 == 2 {
            result += i.pow(2);
        } else if i % 3 == 0 {
            result += i.pow(20223);
        }
    }
    println!("{}", result)
}
0