Submission #18627168


Source Code Expand

Copy
#import <Foundation/Foundation.h>

int main(int argc, const char * argv[]) {
    @autoreleasepool {

        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 1311 Byte
Status AC
Exec Time 124 ms
Memory 16748 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 124 ms 16680 KB
00_rnd_02.txt AC 29 ms 16572 KB
00_rnd_03.txt AC 38 ms 16176 KB
00_rnd_04.txt AC 38 ms 16492 KB
00_rnd_05.txt AC 34 ms 16748 KB
00_sample_1.txt AC 33 ms 16172 KB
00_sample_2.txt AC 33 ms 16440 KB