Submission #62020870
Source Code Expand
/*
_ _ _ __ __ _____
/\ | | /\ | | | | | \/ |/ ____|
/ \ | |__ ___ / \ | |__ __| | ___ | \ / | |
/ /\ \ | '_ \ / _ \ / /\ \ | '_ \ / _` |/ _ \| |\/| | |
/ ____ \| |_) | (_) / ____ \| |_) | (_| | (_) | | | | |____
/_/ \_\_.__/ \___/_/ \_\_.__/ \__,_|\___/|_| |_|\_____|
*/
// build command:
// g++ -std=gnu++17 -O3 -DDEBUG -g -fsanitize=signed-integer-overflow -fsanitize=bounds-strict -fsanitize=address -fsanitize=integer-divide-by-zero -fsanitize=float-divide-by-zero -fsanitize=pointer-overflow -fsanitize=shift-exponent -fsplit-stack -Wshadow -Wall -fconcepts -Wno-unused-result
// REMEMBER:
// BS, Offline, Persistent SegTree, SQRT, Treap, MaxFlow, FFT, Matrices
#include <bits/stdc++.h>
using namespace std;
#pragma GCC optimize("O3,unroll-loops")
// DEBUG STUFF
template<typename A, typename B> ostream& operator<<(ostream &os, const pair<A, B> &p) { return os << '(' << p.first << ", " << p.second << ')'; }
template<typename T_container, typename T = typename enable_if<!is_same<T_container, string>::value, typename T_container::value_type>::type> ostream& operator<<(ostream &os, const T_container &v) { os << '{'; string sep; for (const T &x : v) os << sep << x, sep = ", "; return os << '}'; }
void dbg_out() { cerr << endl; }
template<typename Head, typename... Tail> void dbg_out(Head H, Tail... T) { cerr << ' ' << H; dbg_out(T...); }
#ifdef DEBUG
#define dbg(...) cerr << "(" << #__VA_ARGS__ << "):", dbg_out(__VA_ARGS__)
#else
#define dbg(...)
#endif
#define F first
#define S second
#define pb push_back
#define all(x) (x).begin(), (x).end()
#define sz(x) ((int)(x).size())
typedef long long ll;
typedef long double ld;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
// RANDOM NUMBER GENERATOR
mt19937 RNG(chrono::steady_clock::now().time_since_epoch().count());
#define SHUF(v) shuffle(all(v), RNG);
// Use mt19937_64 for 64 bit random numbers.
int getrand(int l,int r) {
return uniform_int_distribution<int>(l, r)(RNG);
}
const ld eps = 1e-9;
const int mod = 1e9 + 7;
const int oo = 1e9 + 7;
const ll lloo = 1e18 + 7;
const int N = 1e6 + 7;
void solve(int tc) {
int n = 5;
vector<int> a(5);
for(int i = 0 ; i < 5 ; i++) cin >> a[i];
vector<int> tmp = {1,2,3,4,5};
for(int i = 0 ; i < n-1 ; i++) {
swap(a[i],a[i+1]);
if (tmp == a) {cout << "Yes\n";return;}
swap(a[i],a[i+1]);
}
cout << "No\n";
}
int main() {
ios::sync_with_stdio(0);
cin.tie(0);cout.tie(0);
// freopen("in","r",stdin);
// freopen("out","w",stdout);
int T = 1;
//cin >> T;
for(int i = 0 ; i < T ; i++) solve(i+1);
return 0;
}
Submission Info
| Submission Time |
|
| Task |
A - 12435 |
| User |
b4n4n4s |
| Language |
C++ 20 (gcc 12.2) |
| Score |
150 |
| Code Size |
2760 Byte |
| Status |
AC |
| Exec Time |
1 ms |
| Memory |
3548 KiB |
Compile Error
Main.cpp: In function ‘void solve(int)’:
Main.cpp:59:16: warning: unused parameter ‘tc’ [-Wunused-parameter]
59 | void solve(int tc) {
| ~~~~^~
Judge Result
| Set Name |
Sample |
All |
| Score / Max Score |
0 / 0 |
150 / 150 |
| Status |
|
|
| Set Name |
Test Cases |
| 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 |
| Case Name |
Status |
Exec Time |
Memory |
| 00_sample_00.txt |
AC |
1 ms |
3548 KiB |
| 00_sample_01.txt |
AC |
1 ms |
3520 KiB |
| 00_sample_02.txt |
AC |
1 ms |
3484 KiB |
| 00_sample_03.txt |
AC |
1 ms |
3460 KiB |
| 01_handmade_00.txt |
AC |
1 ms |
3488 KiB |
| 01_handmade_01.txt |
AC |
1 ms |
3472 KiB |
| 01_handmade_02.txt |
AC |
1 ms |
3464 KiB |
| 02_Yes_00.txt |
AC |
1 ms |
3472 KiB |
| 02_Yes_01.txt |
AC |
1 ms |
3480 KiB |
| 03_No_00.txt |
AC |
1 ms |
3544 KiB |
| 03_No_01.txt |
AC |
1 ms |
3472 KiB |
| 03_No_02.txt |
AC |
1 ms |
3468 KiB |
| 03_No_03.txt |
AC |
1 ms |
3484 KiB |
| 03_No_04.txt |
AC |
1 ms |
3484 KiB |
| 03_No_05.txt |
AC |
1 ms |
3464 KiB |