Submission #50879560
Source Code Expand
// -*- coding:utf-8-unix -*-
use proconio::input;
fn main() {
input! {
a: String,
b: String,
}
if a == b {
println!("EQUAL");
} else if a.len() > b.len() {
println!("GREATER");
} else if a.len() < b.len() {
println!("LESS");
} else {
// 桁数が同じなので、Vecの長さも同じはず
let char_tuple: Vec<(char, char)> = a.chars().zip(b.chars()).collect();
for (a, b) in char_tuple {
if a > b {
println!("GREATER");
break;
} else if a < b {
println!("LESS");
break;
}
}
}
}
Submission Info
| Submission Time | |
|---|---|
| Task | B - Comparison |
| User | homura10059 |
| Language | Rust (rustc 1.70.0) |
| Score | 200 |
| Code Size | 712 Byte |
| Status | AC |
| Exec Time | 1 ms |
| Memory | 2076 KiB |
Judge Result
| Set Name | Sample | All | ||||
|---|---|---|---|---|---|---|
| Score / Max Score | 0 / 0 | 200 / 200 | ||||
| Status |
|
|
| Set Name | Test Cases |
|---|---|
| Sample | 00-00.txt, 00-01.txt, 00-02.txt, 00-03.txt |
| All | 00-00.txt, 00-01.txt, 00-02.txt, 00-03.txt, 01-00.txt, 01-01.txt, 01-02.txt, 01-03.txt, 01-04.txt, 01-05.txt, 01-06.txt, 01-07.txt, 01-08.txt, 01-09.txt |
| Case Name | Status | Exec Time | Memory |
|---|---|---|---|
| 00-00.txt | AC | 1 ms | 1964 KiB |
| 00-01.txt | AC | 1 ms | 1936 KiB |
| 00-02.txt | AC | 1 ms | 1924 KiB |
| 00-03.txt | AC | 1 ms | 1900 KiB |
| 01-00.txt | AC | 1 ms | 1968 KiB |
| 01-01.txt | AC | 1 ms | 1924 KiB |
| 01-02.txt | AC | 1 ms | 2072 KiB |
| 01-03.txt | AC | 1 ms | 1928 KiB |
| 01-04.txt | AC | 1 ms | 1856 KiB |
| 01-05.txt | AC | 1 ms | 1796 KiB |
| 01-06.txt | AC | 1 ms | 2076 KiB |
| 01-07.txt | AC | 1 ms | 1968 KiB |
| 01-08.txt | AC | 1 ms | 1908 KiB |
| 01-09.txt | AC | 1 ms | 1972 KiB |