1008 Elevator- 模擬
模擬即可
#include<iostream> #include<cstdio> #include<algorithm> #include<string> #include<cstring> #include<queue> #include<cmath> #include<set> #define ll long long using namespace std; int main(){ int now=0,n,a; scanf("%d",&n); int sum=0; for(int i=1;i<=n;i++){ scanf("%d",&a); if(now<a)sum+=6*(a-now); if(now>a)sum+=4*(now-a); now=a; } sum+=5*n; printf("%d\n",sum); }
相關推薦
1008 Elevator- 模擬
模擬即可 #include<iostream> #include<cstdio> #include<algorithm> #include<string> #include<cstring> #include<queue>
1008. Elevator (20)(模擬題)
模擬 you blog when expand spec cati include eva The highest building in our city has only one elevator. A request list is made up with N po
HDU-1008-Elevator(Java版本+簡單模擬+噁心水果)
Elevator Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 50645 Accepted Subm
Hdu 1008 Elevator
total multi cost sub int start cep ota com ecif Elevator Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Othe
1008. Elevator
requests val pan led specified when turn put div 1008. Elevator (20) 時間限制 400 ms 內存限制 65536 kB 代碼長度限制 16000 B 判題程序 Standard 作者
1008. Elevator (20)
scan input pen ont stop for each single scanf bsp The highest building in our city has only one elevator. A request list is made up with
PAT 甲級 1008 Elevator
const ets stop contain move highlight div all NPU https://pintia.cn/problem-sets/994805342720868352/problems/994805511923286016 The hig
pat 1008 Elevator(20 分)
pri ext scanf output ostream hit numbers integer space 1008 Elevator(20 分) The highest building in our city has only one elevator. A r
【笨方法學PAT】1008 Elevator(20 分)
一、題目 The highest building in our city has only one elevator. A request list is made up with N positive numbers. The numbers denote at wh
PAT--1008 Elevator (20 分)
1008 Elevator (20 分) 這個題目簡直就是超級無敵大水題啊!!!難度為0。。。。 The highest building in our city has only one elevator. A request list is made up with N posi
【ACM】HDU 1008 Elevator(for java)
到達每一個站點才會停,而不是到達每一個樓層都停! import java.util.Arrays; import java.util.Scanner; public class Main { static int upFloor = 6; static int downFlo
1008 Elevator (20 分)陣列長度設定的重要性(PAT段錯誤+執行時錯誤)
這道題目簡單:先輸入這段序列的個數,然後依次輸入序列,計算從第0層開始走完這段序列需要的時間 下面是第一次提交的程式碼及結果: 嚇我一跳,“段錯誤”還行 改成下面的就通過了(差別就在int i
1008 Elevator (20 分)
The highest building in our city has only one elevator. A request list is made up with N positive numbers. The numbers denote at which
PAT (Advanced Level) 1008 Elevator (20 分)
1008 Elevator (20 分) The highest building in our city has only one elevator. A request list is made up with N positive numbers. The numbers de
【PAT甲級】1008 Elevator (20 分)
The highest building in our city has only one elevator. A request list is made up with N positive numbers. The numbers denote at which flo
PAT 1008 Elevator)
1008 Elevator (20 分) The highest building in our city has only one elevator. A request list is made up with N positive numbers. The num
PAT甲級 1008.Elevator(20) 題目翻譯與答案
題目來源自PAT網站 https://www.patest.cn/ 題目描述: 1008. Elevator (20) The highestbuilding in our city has only one elevator. A request list is mad
Maya Calendar POJ - 1008 (模擬)
簡述 注意260天的情況,這個地方還是0年 程式碼 #include <iostream> #include <map> #include <sstream> using namespace std; map<string,int> bk; map<
PAT甲級真題——1008 Elevator (20 分)
1008 Elevator (20 分) The highest building in our city has only one elevator. A request list is made up with N positive numbers. The numbers de
PAT甲級1008 Elevator
題目描述: The highest building in our city has only one elevator. A request list is made up with N positive numbers. The numbers denote at which floor