#include <iostream>
using namespace std;
bool getColor(int sec)
{
if (sec%150 < 120)
return false;
return true;
}
int getSec(int Y, int m, int d, int H, int i, int s)
{
Y = Y-2000;
m = m-1;
d = d-1;
return ((((Y * 12 + m) * 30 + d) * 24 + H) * 60 + i) * 60 + s;
}
void main(){
int year, month, day, hour, min, sec;
cin >> year >> month >> day >> hour >> min >> sec;
sec = getSec(year, month, day, hour, min, sec);
cout << sec << "초" << endl << ((getColor(sec))? "green" : "red") << endl ;
}
#include <iostream>
using namespace std;
bool getColor(int sec)
{
if (sec%150 < 120)
return false;
return true;
}
int getSec(int Y, int m, int d, int H, int i, int s)
{
Y = Y-2000;
m = m-1;
d = d-1;
return ((((Y * 12 + m) * 30 + d) * 24 + H) * 60 + i) * 60 + s;
}
void main(){
int num, year, month, day, hour, min, sec, cnt = 0;
cin >> num;
for(int i=0; i<num; i++)
{
cin >> year >> month >> day >> hour >> min >> sec;
sec = getSec(year, month, day, hour, min, sec);
cnt += (getColor(sec) ? 0 : 1);
}
cout << cnt << "명이 신호위반" << endl ;
}
#include <iostream>
using namespace std;
int getColor(int sec)
{
if (sec%155 < 120)
return 0;
else if (sec%155 < 125)
return -1;
return 1;
}
int getSec(int Y, int m, int d, int H, int i, int s)
{
Y = Y-2000;
m = m-1;
d = d-1;
return ((((Y * 12 + m) * 30 + d) * 24 + H) * 60 + i) * 60 + s;
}
void main(){
int num, year, month, day, hour, min, sec, cnt = 0;
cin >> num;
for(int i=0; i<num; i++)
{
cin >> year >> month >> day >> hour >> min >> sec;
sec = getSec(year, month, day, hour, min, sec);
cnt += (getColor(sec) ? 0 : 1);
}
cout << cnt << "명이 신호위반" << endl ;
}