提出 #74845645
ソースコード 拡げる
#include <bits/stdc++.h>
using namespace std;
typedef double db;
typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef pair<int,char> pic;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<pii> vpii;
typedef vector<pll> vpll;
typedef priority_queue<int,vi,greater<int>> mipqint;//小根堆
typedef priority_queue<int> pqint;//大根堆
#define SZ(x) ((int)x.size())
const int mod = 1e9+7;
const int P = 998244353;
const int md = 101;
const ll inf = (1LL << 60LL);
const int N = 2e5+10;
int n,x;
int a[110];
int main(){
scanf("%d%d",&n,&x);
int last = 1 << 30;
for (int i = 0;i <= n;i++){
scanf("%d",&a[i]);
if (abs(last-a[i]) >= x){
printf("%d %d\n",i,a[i]);
last = a[i];
}
//printf("%d %d 1111111\n",a[i],last);
}
return 0;
}
提出情報
| 提出日時 | |
|---|---|
| 問題 | B - Sensor Data Logging |
| ユーザ | wuqize |
| 言語 | C++23 (GCC 15.2.0) |
| 得点 | 200 |
| コード長 | 828 Byte |
| 結果 | AC |
| 実行時間 | 1 ms |
| メモリ | 3796 KiB |
ジャッジ結果
| セット名 | Sample | All | ||||
|---|---|---|---|---|---|---|
| 得点 / 配点 | 0 / 0 | 200 / 200 | ||||
| 結果 |
|
|
| セット名 | テストケース |
|---|---|
| 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 |
| ケース名 | 結果 | 実行時間 | メモリ |
|---|---|---|---|
| sample_01.txt | AC | 1 ms | 3792 KiB |
| test_01.txt | AC | 1 ms | 3780 KiB |
| test_02.txt | AC | 1 ms | 3620 KiB |
| test_03.txt | AC | 1 ms | 3620 KiB |
| test_04.txt | AC | 1 ms | 3780 KiB |
| test_05.txt | AC | 1 ms | 3716 KiB |
| test_06.txt | AC | 1 ms | 3792 KiB |
| test_07.txt | AC | 1 ms | 3780 KiB |
| test_08.txt | AC | 1 ms | 3796 KiB |
| test_09.txt | AC | 1 ms | 3716 KiB |
| test_10.txt | AC | 1 ms | 3768 KiB |
| test_11.txt | AC | 1 ms | 3744 KiB |
| test_12.txt | AC | 1 ms | 3620 KiB |
| test_13.txt | AC | 1 ms | 3696 KiB |