首页 > 其他分享 >时间表

时间表

时间:2024-02-04 18:12:23浏览次数:20  
标签:00 15 14 时间表 50 free class

整了一个看起来像是时间表的东西。

//g++ test3_clock.cpp -o test3_clock -g -std=c++14 -O0 -Wall -fsanitize=undefined
#include<iostream>
#include<cstdio>
#include<algorithm>
#include<chrono>
#include<windows.h>
#define LL long long
using namespace std;
const int maxn=1e6;
int qd(){
	char c=getchar();int rt=0;
	while(c!=EOF&&(c<'0'||c>'9'))  c=getchar();
	while('0'<=c&&c<='9')  rt=rt*10+c-48,c=getchar();
	return c==EOF?-1:rt;
}
struct node{
	int tp,mon,d,h,m,s,s_begin;
	node(){tp=mon=d=h=m=s=s_begin=0;}
	node(const int &_tp,const int &_mon,const int &_d,const int &_h,const int &_m,const int &_s,const int &_s_begin){
		tp=_tp,mon=_mon,d=_d,h=_h,m=_m,s=_s,s_begin=_s_begin;
	}
	bool operator<(const node &x){
		if(mon!=x.mon)  return mon<x.mon;
		if(d!=x.d)  return d<x.d;
		if(h!=x.h)  return h<x.h;
		if(m!=x.m)  return m<x.m;
		if(s!=x.s)  return s<x.s;
		return tp<x.tp;
	}
}f[maxn];
char str[maxn];int ftop=0,stop=0,ftil=0;
int qsd(){
	char c=getchar();int rt=stop;
	while(c==' '||c=='\r'||c=='\n')  c=getchar();
	while(c!='\r'&&c!='\n')  str[stop++]=c,c=getchar();
	str[stop++]=0;return rt;
}
node ntime(){
	auto tt=chrono::system_clock::to_time_t(chrono::system_clock::now());struct tm* rt=localtime(&tt);
//	printf("%lld\n",rt->tm_mon);return node();
	return node(0,rt->tm_mon+1,rt->tm_mday,rt->tm_hour,rt->tm_min,rt->tm_sec,0);
}
void showword(){
	system("cls");
	node x=ntime();printf("%d-%d %d:%d:%d\n%s\n",x.mon,x.d,x.h,x.m,x.s,str+f[ftil-1].s_begin);
	fflush(stdout);
}
void ring(int t){
	if(t==1){
		Beep(659,300);Beep(523,300);Beep(578,300);Beep(392,300);Sleep(2000);
		Beep(392,300);Beep(578,300);Beep(659,300);Beep(523,300);Sleep(1000);
	}
	else if(t==2){
		Beep(392,300);Beep(578,300);Beep(659,300);Beep(523,300);Sleep(2000);
		Beep(659,300);Beep(523,300);Beep(578,300);Beep(392,300);Sleep(1000);
	}
	else if(t==3){
		Beep(523,300);Beep(659,300);Beep(784,300);Beep(1046,500);Sleep(1000);
	}
}
void work0(){
	ring(1);
	printf("end\n");fflush(stdout);
}
int main(){
	freopen("timeplan.txt","r",stdin);
	while(1){
		int tp=qd();if(tp==-1)  break;
		f[++ftop].tp=tp;
		f[ftop].mon=qd();
		f[ftop].d=qd();
		f[ftop].h=qd();
		f[ftop].m=qd();
		f[ftop].s=qd();
		f[ftop].s_begin=qsd();
	}
	fclose(stdin);
	sort(f+1,f+ftop+1);
	++ftil;while(f[ftil]<ntime())  ftil++;
	while(ftil<=ftop){
		showword();Sleep(500);if(ntime()<f[ftil])  continue;
		showword();ring(f[++ftil].tp);
	}
	return 0;
}

另附输入数据 timeplan.txt

<1> 2-4 6:00:00 on class
<2> 2-4 6:50:00 free
<1> 2-4 7:00:00 on class
<2> 2-4 7:50:00 free
<1> 2-4 8:00:00 on class
<2> 2-4 8:50:00 free
<1> 2-4 9:00:00 on class
<2> 2-4 9:50:00 free
<1> 2-4 10:00:00 on class
<2> 2-4 10:50:00 free
<1> 2-4 11:00:00 on class
<3> 2-4 12:00:00 end
<1> 2-4 14:00:00 on class
<2> 2-4 14:50:00 free
<1> 2-4 15:00:00 on class
<2> 2-4 15:50:00 free
<1> 2-4 16:00:00 on class
<2> 2-4 16:50:00 free
<1> 2-4 17:00:00 on class
<3> 2-4 18:00:00 end
<1> 2-4 19:00:00 on class
<2> 2-4 19:50:00 free
<1> 2-4 20:00:00 on class
<2> 2-4 20:50:00 free
<1> 2-4 21:00:00 on class
<2> 2-4 21:50:00 free
<1> 2-4 22:00:00 on class
<3> 2-4 22:40:00 end

<1> 2-5 6:00:00 on class
<2> 2-5 6:50:00 free
<1> 2-5 7:00:00 on class
<2> 2-5 7:50:00 free
<1> 2-5 8:00:00 on class
<2> 2-5 8:50:00 free
<1> 2-5 9:00:00 on class
<2> 2-5 9:50:00 free
<1> 2-5 10:00:00 on class
<2> 2-5 10:50:00 free
<1> 2-5 11:00:00 on class
<3> 2-5 12:00:00 end
<1> 2-5 14:00:00 on class
<2> 2-5 14:50:00 free
<1> 2-5 15:00:00 on class
<2> 2-5 15:50:00 free
<1> 2-5 16:00:00 on class
<2> 2-5 16:50:00 free
<1> 2-5 17:00:00 on class
<3> 2-5 18:00:00 end
<1> 2-5 19:00:00 on class
<2> 2-5 19:50:00 free
<1> 2-5 20:00:00 on class
<2> 2-5 20:50:00 free
<1> 2-5 21:00:00 on class
<2> 2-5 21:50:00 free
<1> 2-5 22:00:00 on class
<3> 2-5 22:40:00 end

<1> 2-6 6:00:00 on class
<2> 2-6 6:50:00 free
<1> 2-6 7:00:00 on class
<2> 2-6 7:50:00 free
<1> 2-6 8:00:00 on class
<2> 2-6 8:50:00 free
<1> 2-6 9:00:00 on class
<2> 2-6 9:50:00 free
<1> 2-6 10:00:00 on class
<2> 2-6 10:50:00 free
<1> 2-6 11:00:00 on class
<3> 2-6 12:00:00 end
<1> 2-6 14:00:00 on class
<2> 2-6 14:50:00 free
<1> 2-6 15:00:00 on class
<2> 2-6 15:50:00 free
<1> 2-6 16:00:00 on class
<2> 2-6 16:50:00 free
<1> 2-6 17:00:00 on class
<3> 2-6 18:00:00 end
<1> 2-6 19:00:00 on class
<2> 2-6 19:50:00 free
<1> 2-6 20:00:00 on class
<2> 2-6 20:50:00 free
<1> 2-6 21:00:00 on class
<2> 2-6 21:50:00 free
<1> 2-6 22:00:00 on class
<3> 2-6 22:40:00 end

<1> 2-7 6:00:00 on class
<2> 2-7 6:50:00 free
<1> 2-7 7:00:00 on class
<2> 2-7 7:50:00 free
<1> 2-7 8:00:00 on class
<2> 2-7 8:50:00 free
<1> 2-7 9:00:00 on class
<2> 2-7 9:50:00 free
<1> 2-7 10:00:00 on class
<2> 2-7 10:50:00 free
<1> 2-7 11:00:00 on class
<3> 2-7 12:00:00 end
<1> 2-7 14:00:00 on class
<2> 2-7 14:50:00 free
<1> 2-7 15:00:00 on class
<2> 2-7 15:50:00 free
<1> 2-7 16:00:00 on class
<2> 2-7 16:50:00 free
<1> 2-7 17:00:00 on class
<3> 2-7 18:00:00 end
<1> 2-7 19:00:00 on class
<2> 2-7 19:50:00 free
<1> 2-7 20:00:00 on class
<2> 2-7 20:50:00 free
<1> 2-7 21:00:00 on class
<2> 2-7 21:50:00 free
<1> 2-7 22:00:00 on class
<3> 2-7 22:40:00 end

<1> 2-8 6:00:00 on class
<2> 2-8 6:50:00 free
<1> 2-8 7:00:00 on class
<2> 2-8 7:50:00 free
<1> 2-8 8:00:00 on class
<2> 2-8 8:50:00 free
<1> 2-8 9:00:00 on class
<2> 2-8 9:50:00 free
<1> 2-8 10:00:00 on class
<2> 2-8 10:50:00 free
<1> 2-8 11:00:00 on class
<3> 2-8 12:00:00 end
<1> 2-8 14:00:00 on class
<2> 2-8 14:50:00 free
<1> 2-8 15:00:00 on class
<2> 2-8 15:50:00 free
<1> 2-8 16:00:00 on class
<2> 2-8 16:50:00 free
<1> 2-8 17:00:00 on class
<3> 2-8 18:00:00 end
<1> 2-8 19:00:00 on class
<2> 2-8 19:50:00 free
<1> 2-8 20:00:00 on class
<2> 2-8 20:50:00 free
<1> 2-8 21:00:00 on class
<2> 2-8 21:50:00 free
<1> 2-8 22:00:00 on class
<3> 2-8 22:40:00 end

<1> 2-9 6:00:00 on class
<2> 2-9 6:50:00 free
<1> 2-9 7:00:00 on class
<2> 2-9 7:50:00 free
<1> 2-9 8:00:00 on class
<2> 2-9 8:50:00 free
<1> 2-9 9:00:00 on class
<2> 2-9 9:50:00 free
<1> 2-9 10:00:00 on class
<2> 2-9 10:50:00 free
<1> 2-9 11:00:00 on class
<3> 2-9 12:00:00 end
<1> 2-9 14:00:00 on class
<2> 2-9 14:50:00 free
<1> 2-9 15:00:00 on class
<2> 2-9 15:50:00 free
<1> 2-9 16:00:00 on class
<2> 2-9 16:50:00 free
<1> 2-9 17:00:00 on class
<3> 2-9 18:00:00 end
<1> 2-9 19:00:00 on class
<2> 2-9 19:50:00 free
<1> 2-9 20:00:00 on class
<2> 2-9 20:50:00 free
<1> 2-9 21:00:00 on class
<2> 2-9 21:50:00 free
<1> 2-9 22:00:00 on class
<3> 2-9 22:40:00 end

<1> 2-9 6:00:00 on class
<2> 2-10 6:50:00 free
<1> 2-10 7:00:00 on class
<2> 2-10 7:50:00 free
<1> 2-10 8:00:00 on class
<2> 2-10 8:50:00 free
<1> 2-10 9:00:00 on class
<2> 2-10 9:50:00 free
<1> 2-10 10:00:00 on class
<2> 2-10 10:50:00 free
<1> 2-10 11:00:00 on class
<3> 2-10 12:00:00 end
<1> 2-10 14:00:00 on class
<2> 2-10 14:50:00 free
<1> 2-10 15:00:00 on class
<2> 2-10 15:50:00 free
<1> 2-10 16:00:00 on class
<2> 2-10 16:50:00 free
<1> 2-10 17:00:00 on class
<3> 2-10 18:00:00 end
<1> 2-10 19:00:00 on class
<2> 2-10 19:50:00 free
<1> 2-10 20:00:00 on class
<2> 2-10 20:50:00 free
<1> 2-10 21:00:00 on class
<2> 2-10 21:50:00 free
<1> 2-10 22:00:00 on class
<3> 2-10 22:40:00 end

<1> 2-11 6:00:00 on class
<2> 2-11 6:50:00 free
<1> 2-11 7:00:00 on class
<2> 2-11 7:50:00 free
<1> 2-11 8:00:00 on class
<2> 2-11 8:50:00 free
<1> 2-11 9:00:00 on class
<2> 2-11 9:50:00 free
<1> 2-11 10:00:00 on class
<2> 2-11 10:50:00 free
<1> 2-11 11:00:00 on class
<3> 2-11 12:00:00 end
<1> 2-11 14:00:00 on class
<2> 2-11 14:50:00 free
<1> 2-11 15:00:00 on class
<2> 2-11 15:50:00 free
<1> 2-11 16:00:00 on class
<2> 2-11 16:50:00 free
<1> 2-11 17:00:00 on class
<3> 2-11 18:00:00 end
<1> 2-11 19:00:00 on class
<2> 2-11 19:50:00 free
<1> 2-11 20:00:00 on class
<2> 2-11 20:50:00 free
<1> 2-11 21:00:00 on class
<2> 2-11 21:50:00 free
<1> 2-11 22:00:00 on class
<3> 2-11 22:40:00 end

<1> 2-12 6:00:00 on class
<2> 2-12 6:50:00 free
<1> 2-12 7:00:00 on class
<2> 2-12 7:50:00 free
<1> 2-12 8:00:00 on class
<2> 2-12 8:50:00 free
<1> 2-12 9:00:00 on class
<2> 2-12 9:50:00 free
<1> 2-12 10:00:00 on class
<2> 2-12 10:50:00 free
<1> 2-12 11:00:00 on class
<3> 2-12 12:00:00 end
<1> 2-12 14:00:00 on class
<2> 2-12 14:50:00 free
<1> 2-12 15:00:00 on class
<2> 2-12 15:50:00 free
<1> 2-12 16:00:00 on class
<2> 2-12 16:50:00 free
<1> 2-12 17:00:00 on class
<3> 2-12 18:00:00 end
<1> 2-12 19:00:00 on class
<2> 2-12 19:50:00 free
<1> 2-12 20:00:00 on class
<2> 2-12 20:50:00 free
<1> 2-12 21:00:00 on class
<2> 2-12 21:50:00 free
<1> 2-12 22:00:00 on class
<3> 2-12 22:40:00 end

<1> 2-13 6:00:00 on class
<2> 2-13 6:50:00 free
<1> 2-13 7:00:00 on class
<2> 2-13 7:50:00 free
<1> 2-13 8:00:00 on class
<2> 2-13 8:50:00 free
<1> 2-13 9:00:00 on class
<2> 2-13 9:50:00 free
<1> 2-13 10:00:00 on class
<2> 2-13 10:50:00 free
<1> 2-13 11:00:00 on class
<3> 2-13 12:00:00 end
<1> 2-13 14:00:00 on class
<2> 2-13 14:50:00 free
<1> 2-13 15:00:00 on class
<2> 2-13 15:50:00 free
<1> 2-13 16:00:00 on class
<2> 2-13 16:50:00 free
<1> 2-13 17:00:00 on class
<3> 2-13 18:00:00 end
<1> 2-13 19:00:00 on class
<2> 2-13 19:50:00 free
<1> 2-13 20:00:00 on class
<2> 2-13 20:50:00 free
<1> 2-13 21:00:00 on class
<2> 2-13 21:50:00 free
<1> 2-13 22:00:00 on class
<3> 2-13 22:40:00 end

<1> 2-14 6:00:00 on class
<2> 2-14 6:50:00 free
<1> 2-14 7:00:00 on class
<2> 2-14 7:50:00 free
<1> 2-14 8:00:00 on class
<2> 2-14 8:50:00 free
<1> 2-14 9:00:00 on class
<2> 2-14 9:50:00 free
<1> 2-14 10:00:00 on class
<2> 2-14 10:50:00 free
<1> 2-14 11:00:00 on class
<3> 2-14 12:00:00 end
<1> 2-14 14:00:00 on class
<2> 2-14 14:50:00 free
<1> 2-14 15:00:00 on class
<2> 2-14 15:50:00 free
<1> 2-14 16:00:00 on class
<2> 2-14 16:50:00 free
<1> 2-14 17:00:00 on class
<3> 2-14 18:00:00 end
<1> 2-14 19:00:00 on class
<2> 2-14 19:50:00 free
<1> 2-14 20:00:00 on class
<2> 2-14 20:50:00 free
<1> 2-14 21:00:00 on class
<2> 2-14 21:50:00 free
<1> 2-14 22:00:00 on class
<3> 2-14 22:40:00 end

<1> 2-15 6:00:00 on class
<2> 2-15 6:50:00 free
<1> 2-15 7:00:00 on class
<2> 2-15 7:50:00 free
<1> 2-15 8:00:00 on class
<2> 2-15 8:50:00 free
<1> 2-15 9:00:00 on class
<2> 2-15 9:50:00 free
<1> 2-15 10:00:00 on class
<2> 2-15 10:50:00 free
<1> 2-15 11:00:00 on class
<3> 2-15 12:00:00 end
<1> 2-15 14:00:00 on class
<2> 2-15 14:50:00 free
<1> 2-15 15:00:00 on class
<2> 2-15 15:50:00 free
<1> 2-15 16:00:00 on class
<2> 2-15 16:50:00 free
<1> 2-15 17:00:00 on class
<3> 2-15 18:00:00 end
<1> 2-15 19:00:00 on class
<2> 2-15 19:50:00 free
<1> 2-15 20:00:00 on class
<2> 2-15 20:50:00 free
<1> 2-15 21:00:00 on class
<2> 2-15 21:50:00 free
<1> 2-15 22:00:00 on class
<3> 2-15 22:40:00 end

<1> 2-16 6:00:00 on class
<2> 2-16 6:50:00 free
<1> 2-16 7:00:00 on class
<2> 2-16 7:50:00 free
<1> 2-16 8:00:00 on class
<2> 2-16 8:50:00 free
<1> 2-16 9:00:00 on class
<2> 2-16 9:50:00 free
<1> 2-16 10:00:00 on class
<2> 2-16 10:50:00 free
<1> 2-16 11:00:00 on class
<3> 2-16 12:00:00 end
<1> 2-16 14:00:00 on class
<2> 2-16 14:50:00 free
<1> 2-16 15:00:00 on class
<2> 2-16 15:50:00 free
<1> 2-16 16:00:00 on class
<2> 2-16 16:50:00 free
<1> 2-16 17:00:00 on class
<3> 2-16 18:00:00 end
<1> 2-16 19:00:00 on class
<2> 2-16 19:50:00 free
<1> 2-16 20:00:00 on class
<2> 2-16 20:50:00 free
<1> 2-16 21:00:00 on class
<2> 2-16 21:50:00 free
<1> 2-16 22:00:00 on class
<3> 2-16 22:40:00 end


标签:00,15,14,时间表,50,free,class
From: https://www.cnblogs.com/hbhz-zcy/p/18006741

相关文章

  • 2024年春节放假调休时间表,提前设置好补班日期提醒
    春节将至,期待已久的春节放假时间表也逐渐浮出水面。根据相关通知,2024年春节放假时间为2月10日(初一)至17日(初八),整整8天的长假,而为了照顾员工,还鼓励各单位为员工安排2月9日(除夕)的带薪休假。值得注意的是,春节调休时间为2月4日和2月18日,这两天将进行调休补班,大家务必准时上岗工作。这......
  • 时间表
    2.2-2.6美赛2.9-2.16过年2.18-2.25旅游 3.3开学4月中旬智能车第二次校内赛4.21大英赛5月智能车省邀请赛6月中旬六级考试(倒数第二次机会)7月中旬智能车省赛;光电设计大赛省赛7月底电赛8月底智能车国赛;光电设计大赛国赛9月......
  • Teamcenter SOA开发报错:您没有最新的时间表。请刷新时间表以获取最新副本。
    1、时间表创建任务的时候报了这个错。按字面意思,只刷新时间表是不行的。 解决方法:你创建的任务,肯定会放在一个父任务的。这是要将父任务,进行刷新。如果刷新不行的,可以尝试释放锁的刷新。如果还是不行,把时间表对象也放进来刷新。......
  • Teamcenter SOA开发创建时间表,已经挂在父任务上,但在时间表管理器中没有显示出来。
    1、我创建时间表任务的,已经指明了要挂在指定的父级任务下。然后我在时间表管理器中并没有看到这个任务。但是我通过查看属性,刚创建的子任务,的确已经是挂到父任务下了。 2、后来通过尝试,把创建任务的开始和结束时间加上去。果然可以了。看来创建任务的时候,要默认把开始和结......
  • Teamcenter开发,时间表或者任务,如何获取子任务
    1、在胖客户端是看到对应子任务,是放在父任务的哪个属性的。2、你在胖客户端看父任务和子任务的关系,也是-1,所以这个就很奇怪了。 是这个属性 child_task_taglist 补充一下:时间表  和汇总任务的关系内码是:fnd0SummaryTask如果要获取时间表下面的子任务,不能通过时间......
  • 作息时间表
    时间点/段需要完成事项        6:00起床        6:00-6:20洗漱        6:20-7:00运动(拉伸以及1000米跑)        7:10-7:30洗漱        7:20-8:00吃东西       ......
  • 2024年软考考试和报名时间表,请接收~
    软考(计算机技术与软件专业技术资格(水平)考试)是纳入全国专业技术人员职业资格证书制度统一规划,实行大纲、试题、标准、证书均统一的考试办法。其目的是科学、公正地对全国计算机与软件专业技术人员进行职业资格、专业技术资格认定和专业技术水平测试。下面给大家介绍一下2024年软考的......
  • 2024年PMP考试时间表来了!考生须知
    项目管理PMP®考试由美国项目管理协会(PMI)发起,是严格评估项目管理人员能力的认证考试。目前许多地区都可以报考PMP®考试,那么2024年项目管理PMP®考试时间是什么时候呢?  2024年PMP®项目管理考试报名(英文)时间:(只有英文报名审核成功才能进行中文报名,审核大概需要5个工作日,需提前做好......
  • 18-时间表示-unix时间点-毫秒和微秒-time模块
        ......
  • AWC启动时间表交付件流程报错
    1、问题:在AWC启动时间表任务交付件流程时。启动流程不成功,报了如下错误:由“test”在节点“plmtestapp”上锁定,该节点位于由“2023-8-0717:21”开始的会话中。实例在使用中。无法加载或刷新对象“xxxxx”。请参考此错误堆栈中之前的错误以获取更多信息2、原因:除了把时间表......