Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
//
// 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
You can’t perform that action at this time.