提出 #34394247
ソースコード 拡げる
#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;
}
提出情報
| 提出日時 | |
|---|---|
| 問題 | B - Modulo Number |
| ユーザ | tomoya |
| 言語 | C++ (Clang 10.0.0) |
| 得点 | 200 |
| コード長 | 512 Byte |
| 結果 | AC |
| 実行時間 | 10 ms |
| メモリ | 3112 KiB |
ジャッジ結果
| セット名 | Sample | All | ||||
|---|---|---|---|---|---|---|
| 得点 / 配点 | 0 / 0 | 200 / 200 | ||||
| 結果 |
|
|
| セット名 | テストケース |
|---|---|
| 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 |
| ケース名 | 結果 | 実行時間 | メモリ |
|---|---|---|---|
| 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 |