Submission #1236438


Source Code Expand

Copy
#include <bits/stdc++.h>
#define INF 0x3f3f3f3f
const int N = 201;
using namespace std;
typedef long long ll;
int mod = 1e9 + 7;
char s1[N], s2[N];
int main()
{
#ifndef ONLINE_JUDGE  
  //  freopen("in.txt","r" ,stdin);
    // freopen("out.txt", "w", stdout);
#endif 
    
    while (~scanf("%s%s", s1, s2))
    {
        const char *f[] = {"LESS", "GREATER", "EQUAL"};
        int a1 = strlen(s1), a2 = strlen(s2);
        if (a1 > a2)
            puts("GREATER");
        else if (a1 < a2)
            puts("LESS");
        else
        {
            int c = 2;
            for (int i = 0; i < a1; i++)
            {
                if (s1[i] > s2[i])
                {
                    c = 1;
                    break;
                }else if (s1[i] < s2[i])
                {
                    c = 0;
                    break;
                }
            }
            puts(f[c]);
        }
    }
    return 0;
}

Submission Info

Submission Time
Task B - Comparison
User smallcattom
Language C++14 (GCC 5.4.1)
Score 200
Code Size 967 Byte
Status
Exec Time 1 ms
Memory 256 KB

Judge Result

Set Name Score / Max Score Test Cases
Sample 0 / 0 00-00.txt, 00-01.txt, 00-02.txt, 00-03.txt
All 200 / 200 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 1 ms 256 KB
00-01.txt 1 ms 256 KB
00-02.txt 1 ms 256 KB
00-03.txt 1 ms 256 KB
01-00.txt 1 ms 256 KB
01-01.txt 1 ms 256 KB
01-02.txt 1 ms 256 KB
01-03.txt 1 ms 256 KB
01-04.txt 1 ms 256 KB
01-05.txt 1 ms 256 KB
01-06.txt 1 ms 256 KB
01-07.txt 1 ms 256 KB
01-08.txt 1 ms 256 KB
01-09.txt 1 ms 256 KB