Skip to content

Instantly share code, notes, and snippets.

@fredbr
Created May 16, 2018 03:27
Show Gist options
  • Save fredbr/bda13975b9376d1db38551db88488d26 to your computer and use it in GitHub Desktop.
Save fredbr/bda13975b9376d1db38551db88488d26 to your computer and use it in GitHub Desktop.
Escada
// 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