提出 #62020932
ソースコード 拡げる
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
using namespace std;
using namespace __gnu_pbds;
#define fi first
#define se second
#define pb push_back
#define int long long
#define sz(a) (int)a.size()
#define all(a) begin(a),end(a)
#define uid(a, b) uniform_int_distribution<int>(a, b)(rng)
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
using ll = long long;
using vi = vector<int>;
using ar2 = array<int,2>;
using ar3 = array<int,3>;
const int mxN = (int)3e5+10;
const int INF = (int)1e9;
const ll LINF = (ll)2e18;
const int MOD = (int)1e9+7;
int a[6];
void solve(){
for(int i = 0; i < 5; i++) cin >> a[i];
bool ok = 0;
for(int i = 0; i < 4; i++){
if(a[i]>a[i+1]){
swap(a[i],a[i+1]);
ok = 1;
break;
}
}
if(ok and is_sorted(a,a+5)) cout << "Yes";
else cout << "No";
}
int32_t main(){
ios_base::sync_with_stdio(false); cin.tie(0);
int t = 1; //cin >> t;
while(t--) solve();
}
提出情報
| 提出日時 | |
|---|---|
| 問題 | A - 12435 |
| ユーザ | dan4life |
| 言語 | C++ 23 (gcc 12.2) |
| 得点 | 150 |
| コード長 | 1055 Byte |
| 結果 | AC |
| 実行時間 | 1 ms |
| メモリ | 3608 KiB |
ジャッジ結果
| セット名 | Sample | All | ||||
|---|---|---|---|---|---|---|
| 得点 / 配点 | 0 / 0 | 150 / 150 | ||||
| 結果 |
|
|
| セット名 | テストケース |
|---|---|
| Sample | 00_sample_00.txt, 00_sample_01.txt, 00_sample_02.txt, 00_sample_03.txt |
| All | 00_sample_00.txt, 00_sample_01.txt, 00_sample_02.txt, 00_sample_03.txt, 01_handmade_00.txt, 01_handmade_01.txt, 01_handmade_02.txt, 02_Yes_00.txt, 02_Yes_01.txt, 03_No_00.txt, 03_No_01.txt, 03_No_02.txt, 03_No_03.txt, 03_No_04.txt, 03_No_05.txt |
| ケース名 | 結果 | 実行時間 | メモリ |
|---|---|---|---|
| 00_sample_00.txt | AC | 1 ms | 3452 KiB |
| 00_sample_01.txt | AC | 1 ms | 3336 KiB |
| 00_sample_02.txt | AC | 1 ms | 3484 KiB |
| 00_sample_03.txt | AC | 1 ms | 3480 KiB |
| 01_handmade_00.txt | AC | 1 ms | 3464 KiB |
| 01_handmade_01.txt | AC | 1 ms | 3412 KiB |
| 01_handmade_02.txt | AC | 1 ms | 3448 KiB |
| 02_Yes_00.txt | AC | 1 ms | 3388 KiB |
| 02_Yes_01.txt | AC | 1 ms | 3480 KiB |
| 03_No_00.txt | AC | 1 ms | 3388 KiB |
| 03_No_01.txt | AC | 1 ms | 3608 KiB |
| 03_No_02.txt | AC | 1 ms | 3480 KiB |
| 03_No_03.txt | AC | 1 ms | 3468 KiB |
| 03_No_04.txt | AC | 1 ms | 3480 KiB |
| 03_No_05.txt | AC | 1 ms | 3464 KiB |