Please sign in first.
Submission #69756319
Source Code Expand
""" <方針> - 数式(`((-1)**i) * (i**3)`)を立式すればいけそう。 - あとは `for` 文を回すだけ。 """ # 入力 N = int(input()) # 総計 ans = 0 # 1~Nでループ for i in range(1, N+1): # 総計に加える ans += ((-1)**i) * (i**3) # 出力 print(ans)
Submission Info
| Submission Time | |
|---|---|
| Task | A - Sigma Cubes |
| User | mattsunkun |
| Language | Python (PyPy 3.10-v7.3.12) |
| Score | 100 |
| Code Size | 300 Byte |
| Status | AC |
| Exec Time | 55 ms |
| Memory | 76676 KiB |
Judge Result
| Set Name | Sample | All | ||||
|---|---|---|---|---|---|---|
| Score / Max Score | 0 / 0 | 100 / 100 | ||||
| Status |
|
|
| Set Name | Test Cases |
|---|---|
| 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 |
| Case Name | Status | Exec Time | Memory |
|---|---|---|---|
| 00_sample_00.txt | AC | 55 ms | 76624 KiB |
| 00_sample_01.txt | AC | 55 ms | 76628 KiB |
| 00_sample_02.txt | AC | 55 ms | 76448 KiB |
| 01_random_00.txt | AC | 55 ms | 76676 KiB |
| 01_random_01.txt | AC | 55 ms | 76460 KiB |
| 01_random_02.txt | AC | 55 ms | 76268 KiB |
| 01_random_03.txt | AC | 55 ms | 76612 KiB |
| 01_random_04.txt | AC | 55 ms | 76316 KiB |
| 01_random_05.txt | AC | 55 ms | 76484 KiB |
| 01_random_06.txt | AC | 55 ms | 76332 KiB |