Submission #34394247
Source Code Expand
#include <iostream>
#include <algorithm>
#include <vector>
#include <string>
using namespace std;
typedef long long int ll;
int main() {
ll a = 998244353;
ll n; cin >> n;
ll c = abs(n) % 998244353;
if (n >= a) {
cout << c << endl;
} else if (n >= 0) {
cout << n << endl;
} else if (n >= -a) {
cout << a - abs(n) << endl;
} else if (c == 0) {
cout << 0 << endl;
} else {
cout << a-c << endl;
}
return 0;
}
Submission Info
| Submission Time | |
|---|---|
| Task | B - Modulo Number |
| User | tomoya |
| Language | C++ (Clang 10.0.0) |
| Score | 200 |
| Code Size | 512 Byte |
| Status | AC |
| Exec Time | 10 ms |
| Memory | 3112 KiB |
Judge Result
| Set Name | Sample | All | ||||
|---|---|---|---|---|---|---|
| Score / Max Score | 0 / 0 | 200 / 200 | ||||
| Status |
|
|
| Set Name | Test Cases |
|---|---|
| Sample | 00_sample_01.txt, 00_sample_02.txt |
| All | 00_sample_01.txt, 00_sample_02.txt, 01_test_01.txt, 01_test_02.txt, 01_test_03.txt, 01_test_04.txt, 01_test_05.txt, 01_test_06.txt, 01_test_07.txt, 01_test_08.txt, 01_test_09.txt, 01_test_10.txt, 01_test_11.txt, 01_test_12.txt, 01_test_13.txt |
| Case Name | Status | Exec Time | Memory |
|---|---|---|---|
| 00_sample_01.txt | AC | 10 ms | 3100 KiB |
| 00_sample_02.txt | AC | 2 ms | 3036 KiB |
| 01_test_01.txt | AC | 2 ms | 2948 KiB |
| 01_test_02.txt | AC | 2 ms | 2968 KiB |
| 01_test_03.txt | AC | 2 ms | 3112 KiB |
| 01_test_04.txt | AC | 2 ms | 3052 KiB |
| 01_test_05.txt | AC | 2 ms | 3052 KiB |
| 01_test_06.txt | AC | 2 ms | 3032 KiB |
| 01_test_07.txt | AC | 3 ms | 3112 KiB |
| 01_test_08.txt | AC | 3 ms | 3036 KiB |
| 01_test_09.txt | AC | 2 ms | 2992 KiB |
| 01_test_10.txt | AC | 2 ms | 3036 KiB |
| 01_test_11.txt | AC | 2 ms | 3056 KiB |
| 01_test_12.txt | AC | 2 ms | 3080 KiB |
| 01_test_13.txt | AC | 2 ms | 3056 KiB |