-
-
Save fredbr/bda13975b9376d1db38551db88488d26 to your computer and use it in GitHub Desktop.
Escada
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Solucao de Davi Gabriel | |
#include <bits/stdc++.h> | |
using namespace std; | |
int tempo[1010]; | |
int main() { | |
int n, t = 0; | |
cin >> n; | |
for(int i = 0; i < n; i++){ | |
cin >> tempo[i]; | |
} | |
for(int i = 1; i < n; i++){ | |
if(tempo[i]-tempo[i-1] <= 10){ | |
t += tempo[i]-tempo[i-1]; | |
} | |
else{ | |
t += 10; | |
} | |
} | |
t += 10; | |
cout << t << endl; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment