Submission #74842229
Source Code Expand
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef __int128 lll;
typedef unsigned __int128 ulll;
void solve() {
int t,x;
cin >> t >> x;
vector<int> a(t+1);
int p = 0;
for (int i = 0;i < t+1;i++) {
cin >> a[i];
if (i == 0) {
cout << 0 << " " << a[i] << '\n';
p = a[i];
continue;
}
if (abs(a[i]-p) >= x) {
cout << i << " " << a[i] << '\n';
p = a[i];
continue;
}
}
}
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
solve();
}
Submission Info
| Submission Time | |
|---|---|
| Task | B - Sensor Data Logging |
| User | t154654 |
| Language | C++23 (GCC 15.2.0) |
| Score | 200 |
| Code Size | 676 Byte |
| Status | AC |
| Exec Time | 1 ms |
| Memory | 3640 KiB |
Judge Result
| Set Name | Sample | All | ||||
|---|---|---|---|---|---|---|
| Score / Max Score | 0 / 0 | 200 / 200 | ||||
| Status |
|
|
| Set Name | Test Cases |
|---|---|
| Sample | sample_01.txt |
| All | sample_01.txt, test_01.txt, test_02.txt, test_03.txt, test_04.txt, test_05.txt, test_06.txt, test_07.txt, test_08.txt, test_09.txt, test_10.txt, test_11.txt, test_12.txt, test_13.txt |
| Case Name | Status | Exec Time | Memory |
|---|---|---|---|
| sample_01.txt | AC | 1 ms | 3548 KiB |
| test_01.txt | AC | 1 ms | 3588 KiB |
| test_02.txt | AC | 1 ms | 3524 KiB |
| test_03.txt | AC | 1 ms | 3548 KiB |
| test_04.txt | AC | 1 ms | 3584 KiB |
| test_05.txt | AC | 1 ms | 3584 KiB |
| test_06.txt | AC | 1 ms | 3400 KiB |
| test_07.txt | AC | 1 ms | 3460 KiB |
| test_08.txt | AC | 1 ms | 3548 KiB |
| test_09.txt | AC | 1 ms | 3640 KiB |
| test_10.txt | AC | 1 ms | 3588 KiB |
| test_11.txt | AC | 1 ms | 3532 KiB |
| test_12.txt | AC | 1 ms | 3544 KiB |
| test_13.txt | AC | 1 ms | 3548 KiB |