Created
November 9, 2015 14:28
-
-
Save nbarnold01/4a86e55a7bf87ceb3e22 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// main.m | |
// Angry Professor | |
// | |
// Created by Nathan Arnold on 11/9/15. | |
// Copyright © 2015 Nathan Arnold. All rights reserved. | |
// | |
#import <Foundation/Foundation.h> | |
void processTestCase() { | |
int numberOfStudents = 0; | |
int numberOfRequiredStudents = 0; | |
scanf("%d %d", &numberOfStudents, &numberOfRequiredStudents); | |
int studentsPresent = 0; | |
for (int i =0; i< numberOfStudents; i++) { | |
int arrivalTime = 0; | |
scanf("%d",&arrivalTime); | |
if (arrivalTime <= 0){ | |
//Student enters before class starts | |
studentsPresent ++; | |
} | |
} | |
if (studentsPresent >= numberOfRequiredStudents){ | |
printf("NO\n"); | |
} else { | |
printf("YES\n"); | |
} | |
} | |
int main(int argc, const char * argv[]) { | |
// @autoreleasepool { | |
// insert code here... | |
// NSAutoreleasePool *pool = [[NSAutoreleasePool alloc]init]; | |
int numberOfTestCases = 0; | |
scanf("%d", &numberOfTestCases); | |
for (int i = 0; i < numberOfTestCases; i++){ | |
processTestCase(); | |
} | |
// } | |
// [pool drain]; | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment