Submission #19541435


Source Code Expand

Copy
#include <bits/stdc++.h>
using namespace std;

int main(void) {
    int n;
    cin >> n;
    vector<int> a(n);
    for(int i = 0;i<n;i++){
        cin >> a[i];
    }
    for(int i = 1;i<n;i++){
        if(a[i] > a[i-1]) cout << "up " << a[i] - a[i-1] << endl;
        else if(a[i] < a[i-1]) cout <<"down " << a[i-1] - a[i] << endl;
        else cout << "stay" << endl;
    }
    return 0;
}

Submission Info

Submission Time
Task B - Up and Down
User wdcc
Language C++ (GCC 9.2.1)
Score 8
Code Size 406 Byte
Status AC
Exec Time 178 ms
Memory 3780 KB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 8 / 8
Status
AC × 1
AC × 15
Set Name Test Cases
Sample example_01.txt
All example_01.txt, subtask_01_01.txt, subtask_01_02.txt, subtask_01_03.txt, subtask_01_04.txt, subtask_01_05.txt, subtask_01_06.txt, subtask_01_07.txt, subtask_01_08.txt, subtask_01_09.txt, subtask_01_10.txt, subtask_01_11.txt, subtask_01_12.txt, subtask_01_13.txt, subtask_01_14.txt
Case Name Status Exec Time Memory
example_01.txt AC 8 ms 3588 KB
subtask_01_01.txt AC 3 ms 3468 KB
subtask_01_02.txt AC 43 ms 3508 KB
subtask_01_03.txt AC 88 ms 3484 KB
subtask_01_04.txt AC 62 ms 3708 KB
subtask_01_05.txt AC 107 ms 3512 KB
subtask_01_06.txt AC 177 ms 3772 KB
subtask_01_07.txt AC 174 ms 3516 KB
subtask_01_08.txt AC 5 ms 3552 KB
subtask_01_09.txt AC 2 ms 3404 KB
subtask_01_10.txt AC 2 ms 3408 KB
subtask_01_11.txt AC 178 ms 3492 KB
subtask_01_12.txt AC 177 ms 3692 KB
subtask_01_13.txt AC 157 ms 3516 KB
subtask_01_14.txt AC 170 ms 3780 KB