CROC-MBTU 2012, Elimination Round / 245F Log Stream Analysis (日期处理&二分)

Stream-Log-Analysis:统计日志分析 流日志分析 使用:节点app.js 此Node.js应用程序用于将日志条目映射到层次结构树结构。 树中的每个节点都将具有子节点及其统计信息,这些子节点将及时进行计算和存储。 立即下载

http://codeforces.com/problemset/problem/245/F


/*60ms,16600KB*/

#include<bits/stdc++.h>
using namespace std;
const int mx = 5000005;
const int month[] = {0, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
const int day2s = 24 * 3600;
char str[mx];
int t[3000005], mm, mo, d, h, m, s, cnt;

inline int cnt_s()
{
	int ans = 0;
	for (int i = 1; i < mo; ++i) ans += month[i];
	ans += d - 1;
	ans *= day2s;
	ans += h * 3600 + m * 60 + s;
	return ans;
}

inline bool judge(int now)
{
	return t + cnt - lower_bound(t, t + cnt, now) >= mm;
}

int main()
{
	int len;
	scanf("%d%d", &len, &mm);
	getchar();
	bool ok = false;
	while (gets(str))
	{
		sscanf(str, "%*d%*c%d%*c%d %d%*c%d%*c%d", &mo, &d, &h, &m, &s);
		t[cnt++] = cnt_s();
		if (judge(t[cnt - 1] - len + 1))
		{
			printf("2012-%02d-%02d %02d:%02d:%02d\n", mo, d, h, m, s);
			ok = true;
			break;
		}
	}
	if (!ok) puts("-1");
	return 0;
}

使用DevExpress22.X(Patch)控件库在VisualStudio2022使用C#进行Winform、WPF应用的开发,看这一篇就够了! 写在开头,Dev Express是个十分强大的控件库(下文简称Dev),但碍于其高昂的使用费用,“出于学习目的”,我们一般使用的都是Patch版本(在版权意识日趋加强的当下,不要提那两个字,现在加上那些字,百度都搜不出内容)。 阅读详情

相关推荐

接入 deepseek 实现AI智能问诊

必须包含user角色,用于传递用户输入。system角色可选,用于设置对话背景。多轮对话需要将历史记录添加到messages中。

weixin_51326478的博客 6541

5.1比赛总结加解题报告

比赛成绩很差很差。。8道题竟然只水出来三道,还有好几道题目也是水题,但是由于英语的原因。没看懂题目意思,然后坑了。英语是硬伤啊,要抓紧时间提升英语水平啊,以后的题目都是全英文的,无奈之。 这次比赛用的题目是codeforces上的第245号比赛题,不过题目的顺序给挪动了。写写解题报告把。。我还是按照codeforces上的顺序来把。 A.System Administrator 题

SparkRat的家 610

[Github]GitHub 2FA快速安全配置全攻略

GitHub强制要求用户启用双重身份验证(2FA)以提升代码安全。本文详细介绍了2FA的三种实现方式:TOTP应用验证(推荐)、SMS短信验证(备用)和硬件安全密钥(最安全),并提供了配置指南。特别推荐使用在线工具2FA.run快速测试TOTP功能。文章还涵盖恢复代码管理、企业级2FA策略制定以及常见问题解决方案,如时间同步问题、多设备同步等。通过强制2FA、定期审计和建立安全事件响应流程,开发者可构建更安全的代码管理体系。

冰茶的博客 2621

CROC-MBTU 2012, Elimination Round (ACM-ICPC) 总结

A. System Administrator 模拟:直接计算同类第一项相加是否大于等于总和的一半 B. Internet Address 字符串:关键在于找"ru" C. Game with Coins 贪心:保证堆数为奇数,且最后的两堆一定要先取 D. Restoring Table 位运算:按32位分别做,生成1的两者都为1 E. Mishap in Club 模拟:能利用...

weixin_30900589的博客 205

密码学:一文看懂Base64算法

Base64常常在我们开发中出现,我们可能只知道它是一串乱码(看不懂的符号),知道有时候知道我们需要把一些数据进行base64编码,有时候需要进行Base64解码。但是却不知道它的作用是什么?它存在的意义是什么?还有它是如何生成的?如何编码和解码?上述的疑问相信在你读完本篇文章之后烟消云散。下面开始正文。Base64是什么?它和加密解密操作有什么关系吗?没错,这就是经过Base64编码后的字符串。对它解码后,我们获得以下内容点个关注,是对我持续创作的最大的鼓励!

Shujie 1万+

多模态对齐方案

本文中我们介绍了 13 中常见的大型多模态模型(Large Multimodal Models, LMM),包括 BLIP-2,LLaVA、MiniGPT、Qwen-VL 以及 Ferret 等。最全 LMM 模型结构(13种)综述。单层linear投影、两层mlp。

liguandong 2082

Codeforces Round #527 (Div. 3) D2. Great Vova Wall (Version 2)好题

D2. Great Vova Wall (Version 2) time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Vova's family is building the Great Vova Wall (na...

pxlsdz的博客 540

100天精通Python(基础篇)——第2天:基础语法详解(标识符、保留字、注释与代码结构)

100天精通Python(基础篇)——第2天:基础语法详解(标识符、保留字、注释与代码结构)

努力让自己发光,对的人才能迎着光而来 34万+

Codeforces702E Analysis of Pathes in Functional Graph(倍增)

题目链接:点这里!!! 题意:给你一个图,包含n个点n条边(n 题解:我们可以利用类似于树上倍增的方法求出答案,因为每个点只有唯一的后继所以可以这样做,然后搞一搞就可以了(k 代码: #include #include #include #include #include #include #include #include #include #include #i

Zsss的博客 621

五种音频器件综合对比——《器件手册--音频器件》

音频器件当在蜂鸣片的两片电极之间接通交流音频信号时,蜂鸣片会根据信号的大小和频率发生振动,从而产生相应的声音。结构简单、造价低廉。广泛应用于玩具、电子表、电子仪器、电子钟表、定时器等电子电器方面。蜂鸣器是一种一体化结构的电子讯响器,采用直流电源供电,广泛应用于各种电子产品中作发声器件有源蜂鸣器:内部带震荡源,通电即发声,程序控制方便。无源蜂鸣器:内部不带震荡源,需用方波驱动,声音频率可控,价格相对便宜。计算机、打印机、复印机、报警器、电子玩具、汽车电子设备、电话机、定时器等电子产品。

XU157303764的博客 1535

三菱FX系列PLC模拟量输入AD模块的使用方法和相关编程设置详解

三菱FX系列PLC模拟量输入AD模块的使用方法和相关编程设置详解

Robot_PLC_HMI_Automation 1万+

使用<fstream>库

转自于:http://www.vckbase.com/document/viewdoc/?id=1355 文件I/O库很多,如传统的unix中的read(),open();ANSI C的&amp;lt;stdio.h&amp;gt;,fopen,fread()等;MFC有自己的文件处理类。但是很多I/O库很难跨平台使用。 C++中提供了&amp;lt;fstream&amp;gt;,该库提供了高级的自动控制机制。其具体使...

点滴记录 不断进步 272

爬虫瑞数5案例:联通

瑞数动态安全 Botgate(机器人防火墙)以“动态安全”技术为核心,通过动态封装、动态验证、动态混淆、动态令牌等技术对服务器网页底层代码持续动态变换,增加服务器行为的“不可预测性”,实现了从用户端到服务器端的全方位“主动防护”,为各类 Web、HTML5 提供强大的安全保护。

老衲爱洗头的博客 4470

【CF245H】Queries for Number of Palindromes(回文树)

题面洛谷题解回文树,很类似原来一道后缀自动机的题目 后缀自动机那道题 看到nn的范围很小,但是QueryQuery很多 所以提前预处理出每一段l,rl,r的答案 时间复杂度O(n2+Q)O(n^2+Q)#include<iostream> #include<cstdio> #include<cstdlib> #include<cstring> #include<cmath> #includ

小蒟蒻yyb的博客 455

IDEA的使用指南

IDEA基于java的使用手册,可以最快速的上手,在使用中不断的丰富自己的使用技巧.

Devexpress16.2.6破解工具

Devexpress16.2.6破解工具Devexpress16.2.6破解工具Devexpress16.2.6破解工具Devexpress16.2.6破解工具

muduo LogStream解析

数字转字符串 template&lt;typename T&gt; size_t convert(char buf[], T value) { T i = value; char* p = buf; // 201 分别取数字 1 0 2 do { int lsd = static_cast&lt;int&gt;(i % 10); i /= 10; *p++...

weixin_40021744的博客 386

ET2012新版免狗免安装绿色软件

ET2012新版免狗免安祖昂绿色软件。,新界面,新视觉,

Manacher 算法详解:O(n) 复杂度求最长回文子串

先预处理下:在每个字符的两边都插入一个特殊的符号,比如abba变成#a#b#b#a#,aba变成#a#b#a#(因为Manacher算法只能处理奇数长度的字符串)。同时,为了避免数组越界,在字符串开头添加另一特殊符号,比如$#a#b#a#。 以字符串3212343219为例,处理后变成S[] = "$#3#2#1#2#3#4#3#2#1#9#"。 然后用一个数组Len[i]来记录以字符S[i

AC,∑ndless 4609

jre9下载 jdk9

(Java SE Runtime Environment 9.0) 9.0u175 官方最新版 【x86|x64】

Codeforces Round #119 (Div. 2) / 189A Cut Ribbon (完全背包)

A. Cut Ribbon http://codeforces.com/problemset/problem/189/A time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output

AC,∑ndless 2675

Codeforces Round #105 (Div. 2) / 148A Insomnia cure (枚举 || 数论)

A. Insomnia cure http://codeforces.com/problemset/problem/148/A time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output

AC,∑ndless 2453

Codeforces Beta Round #74 (Div. 2) / 90B African Crossword (模拟)

B. African Crossword http://codeforces.com/problemset/problem/90%2FB time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard o

AC,∑ndless 2416

Codeforces Round #173 (Div. 2) / 282A Bit++(模拟)

A. Bit++ http://codeforces.com/problemset/problem/282/A time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output

AC,∑ndless 2227

Codeforces Round #235 (Div. 2) / 410D Roman and Numbers (带有整除性质的数位DP)

http://codeforces.com/problemset/problem/401/D 解释全部在代码的注释中: /*78ms,205464KB*/ #include using namespace std; const int mx = 1 << 18; long long dp[mx][100]; ///dp[mask][j]表示余数为j时的mask对应的x的个数 ///

AC,∑ndless 2198

Codeforces Round #194 (Div. 1) / 333A Secrets(贪心)

A. Secrets http://codeforces.com/contest/333/problem/A time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Ge

AC,∑ndless 2041

Codeforces Beta Round #98 (Div. 2) / 137A Postcards and photos (模拟)

A. Postcards and photos http://codeforces.com/problemset/problem/137/A time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard

AC,∑ndless 2022

Codeforces Round #177 (Div. 1) / 288A Polo the Penguin and Strings(贪心)

A. Polo the Penguin and Strings http://codeforces.com/problemset/problem/288/A time limit per test 2 seconds memory limit per test 256 megabytes input standard input output

AC,∑ndless 1932

Codeforces Beta Round #75 (Div. 2) / 92B Binary Number(贪心)

B. Binary Number http://codeforces.com/problemset/problem/92/B time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output

AC,∑ndless 1931

Codeforces Round #183 (Div. 1) / 303A Lucky Permutation Triple (强大的数学&想法题)

http://codeforces.com/problemset/problem/303/A when n is odd, A[i] = B[i] = i when n is even, there is no solution. why? If , then  or just , where S = 0 + 1 + ... + n - 1 = n(n - 1) / 

AC,∑ndless 1915
上一篇: Codeforces Beta Round #87 (Div. 2) / 116D Lawnmower (讨论情况)
下一篇: CROC-MBTU 2012, Elimination Round / 245D Restoring Table (位运算)
synapse7
博客等级 码龄14年 432粉丝 701原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值