結果
問題 | No.2174 3 O'clock Easy |
ユーザー |
|
提出日時 | 2022-12-31 22:44:11 |
言語 | C (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 1 ms / 2,000 ms |
コード長 | 319 bytes |
コンパイル時間 | 299 ms |
コンパイル使用メモリ | 30,720 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-11-26 22:27:37 |
合計ジャッジ時間 | 855 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 9 |
ソースコード
#include <stdio.h> #include <math.h> int main(void) { int N; long long int sum = 0; scanf("%d", &N); for (int i = 1; i <= N; i++) { if (i % 3 == 0) { sum += pow(i, 3); } else { sum += pow(i, i % 3); } } printf("%llu\n", sum); return 0; }