十进制整数 2 在十进制中是 1 位数,在二进制中对应 10 ,是 2 位数。
十进制整数 22 在十进制中是 2 位数,在二进制中对应 10110 ,是 5 位数。
请问十进制整数 2022 在二进制中是几位数?
这是一道结果填空的题,你只需要算出结果后提交即可。本题的结果为一个整数,在提交答案时只填写这个整数,填写多余的内容将无法得分。
11
代码:
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.math.BigInteger;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.*;
public class Main
{
static PrintWriter pw = new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out)));
static int N = (int)3000 + 10;
public static void main(String[] args ) throws IOException, ParseException
{
int n = 2021;
int cnt = 0;
while(n > 0)
{
n /= 2;
cnt ++;
}
pw.println(cnt);
pw.flush();
}
}
class rd
{
static BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
static StringTokenizer tokenizer = new StringTokenizer("");
static String nextLine() throws IOException { return reader.readLine(); }
static String next() throws IOException
{
while (!tokenizer.hasMoreTokens()) tokenizer = new StringTokenizer(reader.readLine());
return tokenizer.nextToken();
}
static int nextInt() throws IOException { return Integer.parseInt(next()); }
static double nextDouble() throws IOException { return Double.parseDouble(next()); }
static long nextLong() throws IOException { return Long.parseLong(next());}
static BigInteger nextBigInteger() throws IOException { return new BigInteger(rd.nextLine()); }
}
class PII
{
int x,y;
public PII(int x ,int y)
{
this.x = x;
this.y = y;
}
}
小蓝每周六、周日都晨跑,每月的 1、11、21、31日也晨跑。其它时间不晨跑。
已知 2022年1月1日是周六,请问小蓝整个2022年晨跑多少天?
这是一道结果填空的题,你只需要算出结果后提交即可。本题的结果为一个整数,在提交答案时只填写这个整数,填写多余的内容将无法得分。
138
代码:(日期API顶上就完事了)
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.math.BigInteger;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.*;
public class Main
{
static PrintWriter pw = new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out)));
static int N = (int)3000 + 10;
public static void main(String[] args ) throws IOException, ParseException
{
Calendar calendar = Calendar.getInstance();
calendar.set(2022,0,1);
int cnt = 0;
while(true)
{
int year = calendar.get(Calendar.YEAR);
int month = calendar.get(Calendar.MONTH);
int day_of_month = calendar.get(Calendar.DAY_OF_MONTH);
int day_of_week = calendar.get(Calendar.DAY_OF_WEEK);
if(day_of_week == 7 || day_of_week == 1 || day_of_month == 1 || day_of_month == 11 || day_of_month == 21 || day_of_month == 31) cnt ++;
if(year == 2022 && month == 11 && day_of_month == 31)
{
pw.println(cnt);
pw.flush();
return;
}
calendar.add(Calendar.DATE,1);
}
// Calendar calendar = Calendar.getInstance();
//
// calendar.set(2000,0,1);
// int year = calendar.get(Calendar.YEAR);
// int month = calendar.get(Calendar.MONTH);
// int day_of_month = calendar.get(Calendar.DAY_OF_MONTH);
// int day_of_week = calendar.get(Calendar.DAY_OF_WEEK);
//
// pw.println(year);
// pw.println(month);
// pw.println(day_of_month);
// pw.println(day_of_week);
// pw.flush();
}
}
class rd
{
static BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
static StringTokenizer tokenizer = new StringTokenizer("");
static String nextLine() throws IOException { return reader.readLine(); }
static String next() throws IOException
{
while (!tokenizer.hasMoreTokens()) tokenizer = new StringTokenizer(reader.readLine());
return tokenizer.nextToken();
}
static int nextInt() throws IOException { return Integer.parseInt(next()); }
static double nextDouble() throws IOException { return Double.parseDouble(next()); }
static long nextLong() throws IOException { return Long.parseLong(next());}
static BigInteger nextBigInteger() throws IOException { return new BigInteger(rd.nextLine()); }
}
class PII
{
int x,y;
public PII(int x ,int y)
{
this.x = x;
this.y = y;
}
}
小蓝特别喜欢调和级数 S(n)=1/1+1/2+1/3+1/4+…+1/n 。
请问,n 至少为多大时,S(n)>12 ?
这是一道结果填空的题,你只需要算出结果后提交即可。本题的结果为一个整数,在提交答案时只填写这个整数,填写多余的内容将无法得分。
91380
代码:(不多说)
给定一个字母矩阵,如果矩阵中的某个位置不在四条边上,而且该位置上的字母小于其上下左右四个位置的字母,则称为一个山谷。
例如,对于如下矩阵
DDDDD
CADCE
FFFFA
共有两个山谷,位于第二行第二列和第四列。请注意第二行第三列和第三行第五列都不是山谷。
对于如下30行60列的字母矩阵(请用等宽字体查看),请问有多少个山谷?
PHQGHUMEAYLNLFDXFIRCVSCXGGBWKFNQDUXWFNFOZVSRTKJPREPGGXRPNRVY
STMWCYSYYCQPEVIKEFFMZNIMKKASVWSRENZKYCXFXTLSGYPSFADPOOEFXZBC
OEJUVPVABOYGPOEYLFPBNPLJVRVIPYAMYEHWQNQRQPMXUJJLOOVAOWUXWHMS
NCBXCOKSFZKVATXDKNLYJYHFIXJSWNKKUFNUXXZRZBMNMGQOOKETLYHNKOAU
GZQRCDDIUTEIOJWAYYZPVSCMPSAJLFVGUBFAAOVLZYLNTRKDCPWSRTESJWHD
IZCOBZCNFWLQIJTVDWVXHRCBLDVGYLWGBUSBMBORXTLHCSMPXOHGMGNKEUFD
XOTOGBGXPEYANFETCUKEPZSHKLJUGGGEKJDQZJENPEVQGXIEPJSRDZJAZUJL
LCHHBFQMKIMWZOBIWYBXDUUNFSKSRSRTEKMQDCYZJEEUHMSRQCOZIJIPFION
EEDDPSZRNAVYMMTATBDZQSOEMUVNPPPSUACBAZUXMHECTHLEGRPUNKDMBPPW
EQTGJOPARMOWZDQYOXYTJBBHAWDYDCPRJBXPHOOHPKWQYUHRQZHNBNFUVQNQ
QLRZJPXIOGVLIEXDZUZOSRKRUSVOJBRZMWZPOWKJILEFRAAMDIGPNPUUHGXP
QNJWJMWAXXMNSNHHLQQRZUDLTFZOTCJTNZXUGLSDSMZCNOCKVFAJFRMXOTHO
WKBJZWUCWLJFRIMPMYHCHZRIWKBARXBGFCBCEYHJUGIXWTBVTREHBBCPXIFB
XVFBCGKCFQCKCOTZGKUBMJRMBSZTSSHFROEFWSJRXJHGUZYUPZWWEIQURPIX
IQFLDUUVEOOWQCUDHNEFNJHAIMUCZFSKUIDUBURISWTBRECUYKABFCVKDZEZ
TOIDUKUHJZEFCZZZBFKQDPQZIKFOBUCDHTHXDJGKJELRLPAXAMCEROSWITDP
TPCCLIFKELJYTIHRCQAYBNEFXNXVGZEDYYHNGYCDRUDMPHMECKOTRWOSPOFG
HFOZQVLQFXWWKMFXDYYGMDCASZSGOVSODKJGHCWMBMXRMHUYFYQGAJQKCKLZ
NAYXQKQOYZWMYUBZAZCPKHKTKYDZIVCUYPURFMBISGEKYRGZVXDHPOAMVAFY
RARXSVKHTQDIHERSIGBHZJZUJXMMYSPNARAEWKEGJCCVHHRJVBJTSQDJOOTG
PKNFPFYCGFIEOWQRWWWPZSQMETOGEPSPXNVJIUPALYYNMKMNUVKLHSECDWRA
CGFMZKGIPDFODKJMJQWIQPUOQHIMVFVUZWYVIJGFULLKJDUHSJAFBTLKMFQR
MYJFJNHHSSQCTYDTEAMDCJBPRHTNEGYIWXGCJWLGRSMEAEARWTVJSJBAOIOJ
LWHYPNVRUIHOSWKIFYGTYDHACWYHSGEWZMTGONZLTJHGAUHNIHREQGJFWKJS
MTPJHAEFQZAAULDRCHJCCDYRFVVRIVUYEEGFIVDRCYGURQDREDAKUBNFGUPR
OQYLOBCWQXKZMAUSJGMHCMHGDNMPHNQKAMHURKTRFFACLVGRZKKLDACLLTEO
JOMONXRQYJZGINRNNZWACXXAEDRWUDXZRFUSEWJTBOXVYNFHKSTCENAUMNDD
XFDMVZCAUTDCCKXAAYDZSXTTOBBGQNGVVPJGOJOGLMKXGBFCPYPCKQCHBDDZ
WRXBZMQRLXVOBTWHXGINFGFRCCLMZNMJUGWWBSQFCIHUBSJOLLMSQSGHMCPH
ELSOTFLBGSFNPCUZSRUPCHYNVZHCPQUGRIWNIQXDFJPWPXFBLKPNPEELFJMT
这是一道结果填空的题,你只需要算出结果后提交即可。本题的结果为一个整数,在提交答案时只填写这个整数,填写多余的内容将无法得分。
276
代码:
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.text.ParseException;
import java.util.*;
public class Main
{
static PrintWriter pw = new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out)));
static int N = (int)1e5 + 10;
public static void main(String[] args ) throws IOException, ParseException
{
char s[][] = new char[][]{
"PHQGHUMEAYLNLFDXFIRCVSCXGGBWKFNQDUXWFNFOZVSRTKJPREPGGXRPNRVY".toCharArray(),
"STMWCYSYYCQPEVIKEFFMZNIMKKASVWSRENZKYCXFXTLSGYPSFADPOOEFXZBC".toCharArray(),
"OEJUVPVABOYGPOEYLFPBNPLJVRVIPYAMYEHWQNQRQPMXUJJLOOVAOWUXWHMS".toCharArray(),
"NCBXCOKSFZKVATXDKNLYJYHFIXJSWNKKUFNUXXZRZBMNMGQOOKETLYHNKOAU".toCharArray(),
"GZQRCDDIUTEIOJWAYYZPVSCMPSAJLFVGUBFAAOVLZYLNTRKDCPWSRTESJWHD".toCharArray(),
"IZCOBZCNFWLQIJTVDWVXHRCBLDVGYLWGBUSBMBORXTLHCSMPXOHGMGNKEUFD".toCharArray(),
"XOTOGBGXPEYANFETCUKEPZSHKLJUGGGEKJDQZJENPEVQGXIEPJSRDZJAZUJL".toCharArray(),
"LCHHBFQMKIMWZOBIWYBXDUUNFSKSRSRTEKMQDCYZJEEUHMSRQCOZIJIPFION".toCharArray(),
"EEDDPSZRNAVYMMTATBDZQSOEMUVNPPPSUACBAZUXMHECTHLEGRPUNKDMBPPW".toCharArray(),
"EQTGJOPARMOWZDQYOXYTJBBHAWDYDCPRJBXPHOOHPKWQYUHRQZHNBNFUVQNQ".toCharArray(),
"QLRZJPXIOGVLIEXDZUZOSRKRUSVOJBRZMWZPOWKJILEFRAAMDIGPNPUUHGXP".toCharArray(),
"QNJWJMWAXXMNSNHHLQQRZUDLTFZOTCJTNZXUGLSDSMZCNOCKVFAJFRMXOTHO".toCharArray(),
"WKBJZWUCWLJFRIMPMYHCHZRIWKBARXBGFCBCEYHJUGIXWTBVTREHBBCPXIFB".toCharArray(),
"XVFBCGKCFQCKCOTZGKUBMJRMBSZTSSHFROEFWSJRXJHGUZYUPZWWEIQURPIX".toCharArray(),
"IQFLDUUVEOOWQCUDHNEFNJHAIMUCZFSKUIDUBURISWTBRECUYKABFCVKDZEZ".toCharArray(),
"TOIDUKUHJZEFCZZZBFKQDPQZIKFOBUCDHTHXDJGKJELRLPAXAMCEROSWITDP".toCharArray(),
"TPCCLIFKELJYTIHRCQAYBNEFXNXVGZEDYYHNGYCDRUDMPHMECKOTRWOSPOFG".toCharArray(),
"HFOZQVLQFXWWKMFXDYYGMDCASZSGOVSODKJGHCWMBMXRMHUYFYQGAJQKCKLZ".toCharArray(),
"NAYXQKQOYZWMYUBZAZCPKHKTKYDZIVCUYPURFMBISGEKYRGZVXDHPOAMVAFY".toCharArray(),
"RARXSVKHTQDIHERSIGBHZJZUJXMMYSPNARAEWKEGJCCVHHRJVBJTSQDJOOTG".toCharArray(),
"PKNFPFYCGFIEOWQRWWWPZSQMETOGEPSPXNVJIUPALYYNMKMNUVKLHSECDWRA".toCharArray(),
"CGFMZKGIPDFODKJMJQWIQPUOQHIMVFVUZWYVIJGFULLKJDUHSJAFBTLKMFQR".toCharArray(),
"MYJFJNHHSSQCTYDTEAMDCJBPRHTNEGYIWXGCJWLGRSMEAEARWTVJSJBAOIOJ".toCharArray(),
"LWHYPNVRUIHOSWKIFYGTYDHACWYHSGEWZMTGONZLTJHGAUHNIHREQGJFWKJS".toCharArray(),
"MTPJHAEFQZAAULDRCHJCCDYRFVVRIVUYEEGFIVDRCYGURQDREDAKUBNFGUPR".toCharArray(),
"OQYLOBCWQXKZMAUSJGMHCMHGDNMPHNQKAMHURKTRFFACLVGRZKKLDACLLTEO".toCharArray(),
"JOMONXRQYJZGINRNNZWACXXAEDRWUDXZRFUSEWJTBOXVYNFHKSTCENAUMNDD".toCharArray(),
"XFDMVZCAUTDCCKXAAYDZSXTTOBBGQNGVVPJGOJOGLMKXGBFCPYPCKQCHBDDZ".toCharArray(),
"WRXBZMQRLXVOBTWHXGINFGFRCCLMZNMJUGWWBSQFCIHUBSJOLLMSQSGHMCPH".toCharArray(),
"ELSOTFLBGSFNPCUZSRUPCHYNVZHCPQUGRIWNIQXDFJPWPXFBLKPNPEELFJMT".toCharArray()
};
pw.println(s.length);
for(int i = 0 ; i < 30 ; i ++)
{
for(int j = 0 ; j < 60 ; j ++)
{
pw.print(s[i][j]);
}
pw.println();
}
pw.flush();
}
}
class rd
{
static BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
static StringTokenizer tokenizer = new StringTokenizer("");
static String nextLine() throws IOException { return reader.readLine(); }
static String next() throws IOException
{
while (!tokenizer.hasMoreTokens()) tokenizer = new StringTokenizer(reader.readLine());
return tokenizer.nextToken();
}
static int nextInt() throws IOException { return Integer.parseInt(next()); }
static double nextDouble() throws IOException { return Double.parseDouble(next()); }
static long nextLong() throws IOException { return Long.parseLong(next());}
static BigInteger nextBigInteger() throws IOException { return new BigInteger(rd.nextLine()); }
}
class PII
{
int x,y;
public PII(int x, int y)
{
this.x = x;
this.y = y;
}
}
class Line
{
double k;
double b;
public Line(double k, double b)
{
this.k = k;
this.b = b;
}
}
class Mycomparator implements Comparator
{
@Override
public int compare(Line o1, Line o2)
{
if(o1.k < o2.k) return 1;
if(o1.k == o2.k)
{
if(o1.b < o2.b) return 1;
return -1;
}
return -1;
}
}
小蓝有一个 100 行 100 列的矩阵,矩阵的左上角为 1。其它每个位置正好比其左边的数大 2,比其上边的数大 1 。
例如,第 1 行第 2 列为 3,第 2 行第 2 列 为 4,第 10 行第 20 列为 48。
小蓝想在矩阵中找到一个由连续的若干行、连续的若干列组成的子矩阵,使得其和为 2022,请问这个子矩阵中至少包含多少个元素(即子矩阵的行数和列数的乘积)。
这是一道结果填空的题,你只需要算出结果后提交即可。本题的结果为一个整数,在提交答案时只填写这个整数,填写多余的内容将无法得分。
12
代码:(前缀和优化一下)
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.text.ParseException;
import java.util.*;
public class Main
{
static PrintWriter pw = new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out)));
static int N = (int)100 + 10;
static int a[][] = new int[N][N];
static int s[][] = new int[N][N];
public static void main(String[] args ) throws IOException, ParseException
{
a[1][1] = 1;
// 预处理每行的第一列
for(int i = 2 ; i <= 100 ; i ++) a[i][1] = a[i - 1][1] + 1;
// 利用预处理的条件去轻松初始化整个矩阵
for(int i = 1 ; i <= 100 ; i ++)
{
for(int j = 2 ; j <= 100 ; j ++)
{
a[i][j] = a[i][j - 1] + 2;
}
}
for(int i = 1 ; i <= 100 ; i ++)
{
for(int j = 1 ; j <= 100 ; j ++)
{
s[i][j] = s[i - 1][j] + s[i][j -1] - s[i - 1][j - 1] + a[i][j];
}
}
int res = Integer.MAX_VALUE;
for(int x1 = 1 ; x1 <= 100 ; x1 ++)
{
for(int y1 = 1 ; y1 <= 100 ; y1 ++)
{
for(int x2 = x1 ; x2 <= 100 ; x2 ++)
{
for(int y2 = y1 ; y2 <= 100 ; y2 ++)
{
if(s[x2][y2] - s[x2][y1 - 1] - s[x1 - 1][y2] + s[x1 - 1][y1 - 1] == 2022)
{
res = Math.min(res,(x2 - x1 + 1)*(y2 - y1 + 1));
}
}
}
}
}
pw.println(res);
pw.flush();
}
}
class rd
{
static BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
static StringTokenizer tokenizer = new StringTokenizer("");
static String nextLine() throws IOException { return reader.readLine(); }
static String next() throws IOException
{
while (!tokenizer.hasMoreTokens()) tokenizer = new StringTokenizer(reader.readLine());
return tokenizer.nextToken();
}
static int nextInt() throws IOException { return Integer.parseInt(next()); }
static double nextDouble() throws IOException { return Double.parseDouble(next()); }
static long nextLong() throws IOException { return Long.parseLong(next());}
static BigInteger nextBigInteger() throws IOException { return new BigInteger(rd.nextLine()); }
}
class PII
{
int x,y;
public PII(int x, int y)
{
this.x = x;
this.y = y;
}
}
class Line
{
double k;
double b;
public Line(double k, double b)
{
this.k = k;
this.b = b;
}
}
class Mycomparator implements Comparator
{
@Override
public int compare(Line o1, Line o2)
{
if(o1.k < o2.k) return 1;
if(o1.k == o2.k)
{
if(o1.b < o2.b) return 1;
return -1;
}
return -1;
}
}
如果周一做核酸,周二显示核酸天数为 1 天,周三显示 2 天,以此类推,周六显示 5 天,周日显示 6 天。
小蓝在某一天做了一次核酸,请问他的核酸显示为几天。已知做核酸和查看核酸不是在同一天,而且相差不超过 6 天(显示的数为 1 到 6 之间的数)。
输入第一行包含一个整数 s ,表示小蓝做核酸是周几。 s 为 1 到 6 依次表示周一到周六,s 为 7 表示周日。
第二行包含一个整数 t ,表示查看核酸是周几。 t 为 1 到 6 依次表示周一到周六,t 为 7 表示周日。
输出一行包含一个整数,表示答案。
5
2
4
对于所有评测用例, 1 < = s , t < = 7 1 <= s, t <= 7 1<=s,t<=7。
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.text.ParseException;
import java.util.*;
public class Main
{
static PrintWriter pw = new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out)));
static int N = (int)100 + 10;
static int a[][] = new int[N][N];
static int s[][] = new int[N][N];
public static void main(String[] args ) throws IOException, ParseException
{
int n = rd.nextInt(),target = rd.nextInt();
int res = 0;
while(true)
{
for(int i = n ; i <= 7 ; i ++)
{
if(i != target) res ++;
if(i == target)
{
pw.println(res);
pw.flush();
return;
}
}
for(int i = 1 ; i <= 7 ; i ++)
{
if(i != target) res ++;
if(i == target)
{
pw.println(res);
pw.flush();
return;
}
}
}
}
}
class rd
{
static BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
static StringTokenizer tokenizer = new StringTokenizer("");
static String nextLine() throws IOException { return reader.readLine(); }
static String next() throws IOException
{
while (!tokenizer.hasMoreTokens()) tokenizer = new StringTokenizer(reader.readLine());
return tokenizer.nextToken();
}
static int nextInt() throws IOException { return Integer.parseInt(next()); }
static double nextDouble() throws IOException { return Double.parseDouble(next()); }
static long nextLong() throws IOException { return Long.parseLong(next());}
static BigInteger nextBigInteger() throws IOException { return new BigInteger(rd.nextLine()); }
}
class PII
{
int x,y;
public PII(int x, int y)
{
this.x = x;
this.y = y;
}
}
class Line
{
double k;
double b;
public Line(double k, double b)
{
this.k = k;
this.b = b;
}
}
class Mycomparator implements Comparator
{
@Override
public int compare(Line o1, Line o2)
{
if(o1.k < o2.k) return 1;
if(o1.k == o2.k)
{
if(o1.b < o2.b) return 1;
return -1;
}
return -1;
}
}
输入一个由小写英文字母组成的字符串,请将其中的元音字母(a, e, i, o, u)转换成大写,其它字母仍然保持小写。
输入一行包含一个字符串。
输出转换后的字符串。
lanqiao
lAnqIAO
对于所有评测用例,字符串的长度不超过100。
代码:(String、StringBuilder、char s[])
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.text.ParseException;
import java.util.*;
public class Main
{
static PrintWriter pw = new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out)));
static int N = (int)100 + 10;
static int a[][] = new int[N][N];
static int s[][] = new int[N][N];
public static void main(String[] args ) throws IOException, ParseException
{
String str = rd.next();
char s[] = str.toCharArray();
StringBuilder sb = new StringBuilder(str);
for(int i = 0 ; i < sb.length() ; i ++ )
{
// 利用char数组判断,然后StringBuilder修改,真完美
if(s[i] == 'a' || s[i] == 'e' || s[i] == 'i' || s[i] == 'o' || s[i] == 'u') sb.setCharAt(i, (char) (s[i] - 32));
}
pw.println(sb);
pw.flush();
}
}
class rd
{
static BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
static StringTokenizer tokenizer = new StringTokenizer("");
static String nextLine() throws IOException { return reader.readLine(); }
static String next() throws IOException
{
while (!tokenizer.hasMoreTokens()) tokenizer = new StringTokenizer(reader.readLine());
return tokenizer.nextToken();
}
static int nextInt() throws IOException { return Integer.parseInt(next()); }
static double nextDouble() throws IOException { return Double.parseDouble(next()); }
static long nextLong() throws IOException { return Long.parseLong(next());}
static BigInteger nextBigInteger() throws IOException { return new BigInteger(rd.nextLine()); }
}
class PII
{
int x,y;
public PII(int x, int y)
{
this.x = x;
this.y = y;
}
}
class Line
{
double k;
double b;
public Line(double k, double b)
{
this.k = k;
this.b = b;
}
}
class Mycomparator implements Comparator
{
@Override
public int compare(Line o1, Line o2)
{
if(o1.k < o2.k) return 1;
if(o1.k == o2.k)
{
if(o1.b < o2.b) return 1;
return -1;
}
return -1;
}
}
小蓝有一个充电器,可以使用不同的电压和电流充电。
给定充电器工作的记录,请计算在这个记录期间总共通过充电传输了多少电能。
输入第一行包含一个整数 n , 表示记录的条数。
接下来 n 行,每行包含一个时刻 T 和两个非负整数 U, I,表示在时刻 T 充电电压变为 U(单位伏),电流变为 I(单位A)。最后一行满足 U 和 I 均为 0,在前面的行中也可能出现 U、I 为 0 的情况。其中时间表示为 HH:MM:SS 的格式,时分秒分别用两位十进制数表示(补前导零)。
输入保证时刻依次递增且在 00:00:00 至 23:59:59 的区间内,不用考虑跨过零点充电的情况。
输出一个整数,表示总共通电的电能为多少焦耳,其中 1 焦耳等于 1 伏乘以1 安乘以 1 秒。
3
12:00:00 12 1
12:01:02 5 2
12:01:10 0 0
824
对于所有评测用例, 1 < = n < = 100 , 0 < = U , I < = 100 1 <= n <= 100, 0 <= U, I <= 100 1<=n<=100,0<=U,I<=100。