提出 #69642377
ソースコード 拡げる
// Problem: 'A - Sigma Cubes' // Contest: 'AtCoder - UNIQUE VISION Programming Contest 2024 Autumn (AtCoder Beginner Contest 425)' // URL: 'https://atcoder.jp/contests/abc425/tasks/abc425_a' // Memory Limit: 1024 MB // Time Limit: 2000 ms // // Powered by competitive-companion.el (https://github.com/luishgh/competitive-companion.el) #include <bits/stdc++.h> using namespace std; #define _ ios_base::sync_with_stdio(0);cin.tie(0); #define endl '\n' typedef long long ll; const int INF = 0x3f3f3f3f; const ll LINF = 0x3f3f3f3f3f3f3f3fll; int main() {_; ll n; cin >> n; ll ans = 0; ll p = 1; for (int i = 1; i <= n; i++) { p *= -1; ans += p * i * i * i; } cout << ans << endl; return 0; }
提出情報
提出日時 | |
---|---|
問題 | A - Sigma Cubes |
ユーザ | luishgh |
言語 | C++ 20 (gcc 12.2) |
得点 | 100 |
コード長 | 757 Byte |
結果 | AC |
実行時間 | 1 ms |
メモリ | 3592 KiB |
ジャッジ結果
セット名 | Sample | All | ||||
---|---|---|---|---|---|---|
得点 / 配点 | 0 / 0 | 100 / 100 | ||||
結果 |
|
|
セット名 | テストケース |
---|---|
Sample | 00_sample_00.txt, 00_sample_01.txt, 00_sample_02.txt |
All | 00_sample_00.txt, 00_sample_01.txt, 00_sample_02.txt, 01_random_00.txt, 01_random_01.txt, 01_random_02.txt, 01_random_03.txt, 01_random_04.txt, 01_random_05.txt, 01_random_06.txt |
ケース名 | 結果 | 実行時間 | メモリ |
---|---|---|---|
00_sample_00.txt | AC | 1 ms | 3404 KiB |
00_sample_01.txt | AC | 1 ms | 3520 KiB |
00_sample_02.txt | AC | 1 ms | 3592 KiB |
01_random_00.txt | AC | 1 ms | 3524 KiB |
01_random_01.txt | AC | 1 ms | 3456 KiB |
01_random_02.txt | AC | 1 ms | 3452 KiB |
01_random_03.txt | AC | 1 ms | 3412 KiB |
01_random_04.txt | AC | 1 ms | 3384 KiB |
01_random_05.txt | AC | 1 ms | 3456 KiB |
01_random_06.txt | AC | 1 ms | 3460 KiB |