Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main() {
- ios::sync_with_stdio(0);
- cin.tie(0);
- long long D, Td; cin >> D;
- for (long long i = 0; i < D; i++) {
- long long condition = 0, x, oldX, t1, t2, t3;
- cin >> Td >> oldX;
- for (long long j = 1; j < Td; j++) {
- cin >> x;
- switch (condition)
- {
- case 0:
- if (x != oldX) {
- condition = 1;
- t1 = j;
- }
- break;
- case 1:
- if (x < oldX) {
- condition = 2;
- t2 = j;
- }
- else if (x == oldX) {
- condition = 5;
- }
- break;
- case 2:
- if (x >= oldX) {
- condition = 3;
- t3 = j;
- }
- break;
- case 3:
- if (x != oldX) {
- condition = 5;
- }
- break;
- default:
- break;
- }
- oldX = x;
- }
- // result
- if (condition == 2) {
- cout << "Freytag" << ' ' << t1 << ' ' << t2 << ' ' << Td << '\n';
- }
- else if (condition == 3) {
- cout << "Freytag" << ' ' << t1 << ' ' << t2 << ' ' << t3 << '\n';
- }
- else {
- cout << "Nein" << '\n';
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement