Submission #50189617
Source Code Expand
#include <bits/stdc++.h>
#include <atcoder/modint>
namespace {
using ModInt [[maybe_unused]] = atcoder::modint998244353;
using Num [[maybe_unused]] = long long int;
using Vec [[maybe_unused]] = std::vector<Num>;
using Set [[maybe_unused]] = std::set<Num>;
using Mset [[maybe_unused]] = std::multiset<Num>;
using Edges [[maybe_unused]] = std::vector<std::vector<Num>>;
template<typename T>
using Q [[maybe_unused]] = std::queue<T>;
template<typename T>
using PQ [[maybe_unused]] = std::priority_queue<T, std::vector<T>, std::greater<T>>;
}
void solve(std::istream& is, std::ostream& os) {
Num a, b, d;
is >> a >> b >> d;
Vec v;
for(Num i{a}; i<=b; i+=d) {
v.push_back(i);
}
for(size_t i=0; i<v.size(); ++i) {
os << v.at(i);
if ((i+1) == v.size()) {
os << "\n";
} else {
os << " ";
}
}
}
int main(void) {
solve(std::cin, std::cout);
return 0;
}
Submission Info
| Submission Time | |
|---|---|
| Task | A - Arithmetic Progression |
| User | zettsut |
| Language | C++ 20 (gcc 12.2) |
| Score | 100 |
| Code Size | 1031 Byte |
| Status | AC |
| Exec Time | 1 ms |
| Memory | 3652 KiB |
Judge Result
| Set Name | Sample | All | ||||
|---|---|---|---|---|---|---|
| Score / Max Score | 0 / 0 | 100 / 100 | ||||
| Status |
|
|
| Set Name | Test Cases |
|---|---|
| Sample | sample_01.txt, sample_02.txt |
| All | random_01.txt, random_02.txt, random_03.txt, random_04.txt, random_05.txt, random_06.txt, random_07.txt, random_08.txt, random_09.txt, random_10.txt, sample_01.txt, sample_02.txt |
| Case Name | Status | Exec Time | Memory |
|---|---|---|---|
| random_01.txt | AC | 1 ms | 3536 KiB |
| random_02.txt | AC | 1 ms | 3456 KiB |
| random_03.txt | AC | 1 ms | 3488 KiB |
| random_04.txt | AC | 1 ms | 3652 KiB |
| random_05.txt | AC | 1 ms | 3468 KiB |
| random_06.txt | AC | 1 ms | 3596 KiB |
| random_07.txt | AC | 1 ms | 3532 KiB |
| random_08.txt | AC | 1 ms | 3464 KiB |
| random_09.txt | AC | 1 ms | 3468 KiB |
| random_10.txt | AC | 1 ms | 3452 KiB |
| sample_01.txt | AC | 1 ms | 3516 KiB |
| sample_02.txt | AC | 1 ms | 3532 KiB |