Submission #8400674
Source Code Expand
#include <bits/stdc++.h> using namespace std; int f0(int N) { return 1; } int f1(int N, int M) { int s = 0; for (int i = 0; i < N; i++) { s++; } for (int i = 0; i < M; i++) { s++; } return s; } int f2(int N) { int s = 0; for (int i = 0; i < N; i++) { int t = N; int cnt = 0; while (t > 0) { cnt++; t /= 2; } s += cnt; } return s; } int f3(int N) { int s = 0; for (int i = 0; i < 3; i++) { for (int j = 0; j < 3; j++) { s++; } } return s; } int f4(int N) { int s = 0; for (int i = 0; i < N; i++) { for (int j = 0; j < N; j++) { s += i + j; } } return s; } int f5(int N, int M) { int s = 0; for (int i = 0; i < N; i++) { for (int j = 0; j < M; j++) { s += i + j; } } return s; } int main() { int N, M; cin >> N >> M; int a0 = -1, a1 = -1, a2 = -1, a3 = -1, a4 = -1, a5 = -1; // 計算量が最も大きいもの1つだけコメントアウトする a0 = f0(N); a1 = f1(N, M); a2 = f2(N); a3 = f3(N); //a4 = f4(N); a5 = f5(N, M); cout << "f0: " << a0 << endl; cout << "f1: " << a1 << endl; cout << "f2: " << a2 << endl; cout << "f3: " << a3 << endl; cout << "f4: " << a4 << endl; cout << "f5: " << a5 << endl; }
Submission Info
Submission Time | |
---|---|
Task | EX21 - 2.06 |
User | mahala_coder |
Language | C++14 (GCC 5.4.1) |
Score | 100 |
Code Size | 1378 Byte |
Status | AC |
Exec Time | 80 ms |
Memory | 256 KB |
Judge Result
Set Name | all | ||
---|---|---|---|
Score / Max Score | 100 / 100 | ||
Status |
|
Set Name | Test Cases |
---|---|
all | test01.txt |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
test01.txt | AC | 80 ms | 256 KB |