Saratov State University :: Online Contester


::Go
- home
- news
- register
- update personal info
- problemset archive
- submit
- status online
- standing
- contests
- virtual contests
- forum
- statistic
- FAQ
- links
- projects

::Poll
Are you registered on Codeforces?
Yes
No
What is it???

[results]

::webboard

why WA 13
Author: ata
ID: 059912
Problem: 115
Contest: 0
Date: 2014-07-24 13:30:40

#include <iostream>

using namespace std;

int n,m,d[12][31];

inline void input()
{
cin>>n>>m;
}

inline void init()
{
d[0][0]=1;
for(int i=1;i<31;i++)
d[0][i]=(d[0][i-1]%7)+1;

d[1][0]=d[0][30]%7+1;
for(int i=1;i<28;i++)
d[1][i]=(d[1][i-1]%7)+1;


d[2][0]=d[1][27]%7+1;
for(int i=1;i<31;i++)
d[2][i]=(d[2][i-1]%7)+1;


d[3][0]=d[2][30]%7+1;
for(int i=1;i<30;i++)
d[3][i]=(d[3][i-1]%7)+1;


d[4][0]=d[3][29]%7+1;
for(int i=1;i<31;i++)
d[4][i]=(d[4][i-1]%7)+1;


d[5][0]=d[4][30]%7+1;
for(int i=1;i<30;i++)
d[5][i]=(d[5][i-1]%7)+1;


d[6][0]=d[5][29]%7+1;
for(int i=1;i<31;i++)
d[6][i]=(d[6][i-1]%7)+1;


d[7][0]=d[6][30]%7+1;
for(int i=1;i<31;i++)
d[7][i]=(d[7][i-1]%7)+1;


d[8][0]=d[7][30]%7+1;
for(int i=1;i<30;i++)
d[8][i]=(d[8][i-1]%7)+1;


d[9][0]=d[8][29]%7+1;
for(int i=1;i<31;i++)
d[9][i]=(d[9][i-1]%7)+1;

d[10][0]=d[9][30]%7+1;
for(int i=1;i<30;i++)
d[10][i]=(d[10][i-1]%7)+1;


d[11][0]=1;
for(int i=1;i<31;i++)
d[11][i]=(d[11][i-1]%7)+1;




}

int det()
{

if(n==0||m==0||m>12||(((m==1||m==3||m==5||m==7||m==8||m==10||m==12)&&n>31)||((m==4||m==6||m==9||m==11)&&n>30)||(m==2&&n>28)))
return -1;
return d[m-1][n-1];
}

inline void output()
{
if(det()==-1)
cout<<"Impossiblen";
else
cout<<det()<<endl;
}

int main()
{
input();
init();
output();
return 0;
}


see sub-tree reply to that message


::Login
Forgot password?

::News
22.10.12 - The problems from the Southern Subregional Programming Contest 2012 added to the problemset archive (542 - 553).
22.10.12 - After the start of the contest the statements in PDF will be available by the link.
23.10.11 - The problems from the Southern Subregional Programming Contest 2011 added to the problemset archive (530 - 541).

::Counter

Server time: 2017-09-22 21:07:44Online Contester Team © 2002 - 2016. All rights reserved.