日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

[Codeforces673A]Bear and Game(水题,思路)

發布時間:2023/12/20 编程问答 35 豆豆
生活随笔 收集整理的這篇文章主要介紹了 [Codeforces673A]Bear and Game(水题,思路) 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

題目鏈接:http://codeforces.com/contest/673/problem/A

題意:一個人看一個90分鐘的節目,然后告訴你一些有趣的時刻。這個人假如在15分鐘內還沒有看到有趣的時刻,那他就關電視。問這個人能看多長時間的電視。

記下兩兩節目的時間差,起始是0終止是90不要忘記。然后掃一遍就好,最后如果超出90要輸出90。

1 /* 2 ━━━━━┒ギリギリ♂ eye! 3 ┓┏┓┏┓┃キリキリ♂ mind! 4 ┛┗┛┗┛┃\○/ 5 ┓┏┓┏┓┃ / 6 ┛┗┛┗┛┃ノ) 7 ┓┏┓┏┓┃ 8 ┛┗┛┗┛┃ 9 ┓┏┓┏┓┃ 10 ┛┗┛┗┛┃ 11 ┓┏┓┏┓┃ 12 ┛┗┛┗┛┃ 13 ┓┏┓┏┓┃ 14 ┃┃┃┃┃┃ 15 ┻┻┻┻┻┻ 16 */ 17 #include <algorithm> 18 #include <iostream> 19 #include <iomanip> 20 #include <cstring> 21 #include <climits> 22 #include <complex> 23 #include <fstream> 24 #include <cassert> 25 #include <cstdio> 26 #include <bitset> 27 #include <vector> 28 #include <deque> 29 #include <queue> 30 #include <stack> 31 #include <ctime> 32 #include <set> 33 #include <map> 34 #include <cmath> 35 using namespace std; 36 #define fr first 37 #define sc second 38 #define cl clear 39 #define BUG puts("here!!!") 40 #define W(a) while(a--) 41 #define pb(a) push_back(a) 42 #define Rlf(a) scanf("%llf", &a); 43 #define Rint(a) scanf("%d", &a) 44 #define Rll(a) scanf("%I64d", &a) 45 #define Rs(a) scanf("%s", a) 46 #define Cin(a) cin >> a 47 #define FRead() freopen("in", "r", stdin) 48 #define FWrite() freopen("out", "w", stdout) 49 #define Rep(i, len) for(int i = 0; i < (len); i++) 50 #define For(i, a, len) for(int i = (a); i < (len); i++) 51 #define Cls(a) memset((a), 0, sizeof(a)) 52 #define Clr(a, x) memset((a), (x), sizeof(a)) 53 #define Full(a) memset((a), 0x7f7f, sizeof(a)) 54 #define lrt rt << 1 55 #define rrt rt << 1 | 1 56 #define pi 3.14159265359 57 #define RT return 58 #define lowbit(x) x & (-x) 59 #define onenum(x) __builtin_popcount(x) 60 typedef long long LL; 61 typedef long double LD; 62 typedef unsigned long long ULL; 63 typedef pair<int, int> pii; 64 typedef pair<string, int> psi; 65 typedef map<string, int> msi; 66 typedef vector<int> vi; 67 typedef vector<LL> vl; 68 typedef vector<vl> vvl; 69 typedef vector<bool> vb; 70 71 const int maxn = 110; 72 int n; 73 int t[maxn]; 74 int s[maxn]; 75 76 int main() { 77 // FRead(); 78 Cls(s); 79 Rint(n); 80 Rep(i, n) Rint(t[i]); 81 Rep(i, n) { 82 if(i == 0) { 83 s[i] = t[i]; 84 continue; 85 } 86 s[i] = t[i] - t[i-1]; 87 } 88 s[n] = 90 - s[n-1]; 89 int ret = 0; 90 Rep(i, n+1) { 91 if(s[i] <= 15) { 92 ret += s[i]; 93 } 94 else { 95 ret += 15; 96 break; 97 } 98 } 99 printf("%d\n", ret > 90 ? 90 : ret); 100 RT 0; 101 }

?

轉載于:https://www.cnblogs.com/kirai/p/5548160.html

總結

以上是生活随笔為你收集整理的[Codeforces673A]Bear and Game(水题,思路)的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。