【MZ 自测题(套路题)】
来源:互联网 发布:ros 禁止mac上网 编辑:程序博客网 时间:2024/05/17 02:59
#include <map>#include <cstdio>#include <iostream>#define LL long longusing namespace std;const int MOD1 = 1000000007;const int MOD2 = 998244353;typedef pair<int,int> pii;map<pii,int>MAP;int s[110];int cnt = -1,n,m;int read_int () {char c = getchar();int re = 0;for(;c > '9' || c < '0';c = getchar());for(;c >= '0' && c <= '9';c = getchar())re = re * 10 + c - '0';return re;}pii read () {char c = getchar();int re1 = 0,re2 = 0;for(;c > '9' || c < '0';c = getchar());for(;c >= '0' && c <= '9';c = getchar()) {re1 = ((LL)re1 * 10 + c - '0') % MOD1;re2 = ((LL)re2 * 10 + c - '0') % MOD2;s[++cnt] = c - '0';}return make_pair(re1,re2);}int main () {freopen("steam.in","r",stdin);freopen("steam.out","w",stdout);scanf("%d%d",&n,&m);for(int i = 1;i <= m;++i) {pii t = read();if(MAP[t]) {for(int j = 0;j <= cnt;++j)printf("%d",s[j]);printf("\n");}else MAP[t] = 1;cnt = -1;}}
16MB的内存=。= 典型套路题啊。。
1 0
- 【MZ 自测题(套路题)】
- MZ自测——遥远的村庄(并查集)
- 套路题
- MZ Training 2014 #6 A题
- MZ Training 2014 #6 B题
- MZ Training 2014 #6 C题
- MZ Training 2014 #6 D题
- MZ Training 2014 #5 D题
- MZ Training 2014 #5 E题
- MZ Training 2014 #4 B题
- MZ Training 2014 #4 C题
- MZ Training 2014 #3 C题
- MZ Training 2014 #8 F题
- C语言程序设计 自测题(三)
- css自问自测题(一)
- android基础自测题集锦(一)
- android中级自测题(二)
- Java — 面向对象(自测题)
- iOS单元测试GHUnit + OCMock(使用cocoapods版)
- 自定义View学习-绘制一个简单的圆
- servlet上手
- PAT 1048. 数字加密(20)
- 在Swing下画出各种形状
- 【MZ 自测题(套路题)】
- java 窗口
- poj 2342 Anniversary party(树形dp)
- MongoDB -- 3.0用户创建
- go语言特点
- iis7.5 ftp设置
- Linux中zip压缩和unzip解压缩命令详解
- ios面试题收集 (不定期更新)
- Dubbo学习(十三):服务降级