之前被软院校赛卡了一波T,很亏啊。以下抄袭自Codeforces的神仙Petr。

可能得系统研究Java怎么写了?缺点是不能使用hasNext(),可能需要在main()中解决。

import java.io.*;
import java.util.*; public class Main {
public static void main(String[] args) {
InputStream inputStream = System.in;
OutputStream outputStream = System.out;
InputReader in = new InputReader(inputStream);
PrintWriter out = new PrintWriter(outputStream);
Solver solver = new Solver();
solver.solve(in, out);
out.close();
} static class Solver {
public void solve(InputReader in, PrintWriter out) { } } static class InputReader {
public BufferedReader reader;
public StringTokenizer tokenizer; public InputReader(InputStream stream) {
reader = new BufferedReader(new InputStreamReader(stream), 32768);
tokenizer = null;
} public String next() {
while (tokenizer == null || !tokenizer.hasMoreTokens()) {
try {
tokenizer = new StringTokenizer(reader.readLine());
} catch (IOException e) {
throw new RuntimeException(e);
}
}
return tokenizer.nextToken();
} public int nextInt() {
return Integer.parseInt(next());
} public long nextLong() {
return Long.parseLong(next());
} } }

最新文章

  1. thinkphp3.2与phpexcel带图片生成 完美案例
  2. Thinkstation center M8600t装RHEL7不能联网,网卡驱动没装问题
  3. Delphi XE5 常见问题解答
  4. myeclipse搭建SSH框架
  5. MFC ADO连接Oracle12c数据库 服务端配置
  6. NSMutable sort排序
  7. android文章学习 侧滑菜单实现
  8. Javascript里,想把一个整数转换成字符串,字符串长度为2
  9. Hive 的简单使用及调优参考文档
  10. Leetcode题解(四)
  11. KEIL MDK 查看代码量、RAM使用情况--RO-data、RW-data、ZI-data
  12. matplotlib 无法显示中文和负号的解决办法
  13. 微服务与Spring Cloud资料
  14. windows集群简单介绍
  15. coon's patch
  16. 函数式语言(Functional language)简单介绍
  17. SVN提交,提示“remains in conflict”错误
  18. centos7.x docker安装及配置,持续更新
  19. What are the differences between Flyweight and Object Pool patterns?
  20. 【Vue实战之路】一、Vue-cli入门及Vue工程目录全解。

热门文章

  1. HDFS 原理、架构与特性介绍
  2. gcc參数总结
  3. angular cannot get /
  4. CSS的两种盒模型
  5. 九度OJ 1102:最小面积子矩阵 (DP、缓存、剪枝)
  6. Markov and Chebyshev Inequalities and the Weak Law of Large Numbers
  7. 使用Swift开发iOS项目、UI创建、方法调用
  8. some base knowledge
  9. Oracle rac 配置Weblogic数据源时 实例名及URL的选择
  10. hdu1078 FatMouse and Cheese —— 记忆化搜索