PAT (Advanced Level) Practice
文章平均质量分 54
往~
菜鸟多多学习一位.....
展开
-
1007 Maximum Subsequence Sum
Given a sequence ofKintegers {N1,N2, ...,NK}. A continuous subsequence is defined to be {Ni,Ni+1, ...,Nj} where1≤i≤j≤K. The Maximum Subsequence is the continuous subsequence which has the largest sum of its elements. For example, given se...原创 2022-01-23 23:14:53 · 274 阅读 · 0 评论 -
1006 Sign In and Sign Out
At the beginning of every day, the first person who signs in the computer room will unlock the door, and the last one who signs out will lock the door. Given the records of signing in's and out's, you are supposed to find the ones who have unlocked and lo.原创 2022-01-23 23:12:22 · 305 阅读 · 0 评论 -
1002 A+B for Polynomials
#include<stdio.h>int main(){ int k,t; int count = 0; float c[10001] = {0}; float m; scanf("%d", &k); //多项式的指数就当作数组下标记录系数的索引 for(int i = 0; i < k; i++){ scanf("%d %f", &t, &m); c[t] += m; ...原创 2022-01-09 15:47:46 · 78 阅读 · 0 评论 -
1001 A+B Format
#include <iostream>#include<string.h>using namespace std;int main() { int a, b; cin >> a >> b; string s = to_string(a + b); int len = s.length(); for (int i = 0; i < len; i++) { cout << s[i];...原创 2022-01-09 15:41:24 · 55 阅读 · 0 评论 -
1005 Spell It Right (17分)
#include<iostream>using namespace std;int main(){ long long int n,sum=0; cin>>n; while(n){ int m=n%10; sum+=m; n/=10; } string b[10]={"zero","one","two","three","four","five","six","seven","eight","...原创 2022-01-09 00:14:48 · 59 阅读 · 0 评论 -
1008 Elevator
#include<iostream>using namespace std;int main(){ int n; cin>>n; int m[n+1]; m[0]=0; for(int i=1;i<n+1;i++){ cin>>m[i]; } int time=0; for(int i=1;i<n+1;i++){ if(m[i]>m[i-1]){ ...原创 2022-01-09 00:11:19 · 65 阅读 · 0 评论