Submission #18627186


Source Code Expand

Copy
#import <Foundation/Foundation.h>

int main(int argc, const char * argv[]) {
    NSData *stdinData = [[NSFileHandle fileHandleWithStandardInput] availableData];
    NSString *stdinString = [[NSString alloc] initWithData:stdinData encoding:NSUTF8StringEncoding];
    NSMutableArray<NSMutableArray<NSString *> *> *canonicalInput = [NSMutableArray new];
    for (NSString *str in [stdinString componentsSeparatedByString:@"\n"]) {
        [canonicalInput addObject:[[str componentsSeparatedByString:@" "] mutableCopy]];
    }

    NSString *a = [[canonicalInput objectAtIndex:0] objectAtIndex:0];
    NSString *b = [[canonicalInput objectAtIndex:1] objectAtIndex:0];
    NSString *c = [[canonicalInput objectAtIndex:1] objectAtIndex:1];
    NSString *s = [[canonicalInput objectAtIndex:2] objectAtIndex:0];
    int sumOfABC = a.intValue + b.intValue + c.intValue;
    NSString *answer = [NSString stringWithFormat:@"%i %@", sumOfABC, s];

    NSFileHandle *fileHandle = [NSFileHandle fileHandleWithStandardOutput];
    [fileHandle writeData:[answer dataUsingEncoding:NSUTF8StringEncoding]];
    [fileHandle writeData:[@"\n" dataUsingEncoding:NSUTF8StringEncoding]];
    [fileHandle closeFile];
    return 0;
}

Submission Info

Submission Time
Task PracticeA - Welcome to AtCoder
User log5
Language Objective-C (Clang 10.0.0)
Score 100
Code Size 1230 Byte
Status AC
Exec Time 224 ms
Memory 16736 KB

Judge Result

Set Name All
Score / Max Score 100 / 100
Status
AC × 7
Set Name Test Cases
All 00_rnd_01.txt, 00_rnd_02.txt, 00_rnd_03.txt, 00_rnd_04.txt, 00_rnd_05.txt, 00_sample_1.txt, 00_sample_2.txt
Case Name Status Exec Time Memory
00_rnd_01.txt AC 224 ms 16364 KB
00_rnd_02.txt AC 139 ms 16728 KB
00_rnd_03.txt AC 136 ms 16708 KB
00_rnd_04.txt AC 139 ms 16404 KB
00_rnd_05.txt AC 140 ms 16736 KB
00_sample_1.txt AC 135 ms 16596 KB
00_sample_2.txt AC 139 ms 16564 KB