记录编号 | 201187 | 评测结果 | PAAAAAAAAPWAAWWWWAWW | ||
---|---|---|---|---|---|
题目名称 | [ZLXOI 2015]殉国 | 最终得分 | 58 | ||
用户昵称 | 是否通过 | 未通过 | |||
代码语言 | C++ | 运行时间 | 23.699 s | ||
提交时间 | 2015-10-30 08:27:53 | 内存使用 | 0.31 MiB | ||
#include <fstream> #include <algorithm> #include <cstdio> #include <iostream> #define MAX 7000001 #define ifs ifstream #define ofs ofstream #define XProgram using namespace std; ifs fin("BlackHawk.in"); ofs fout("BlackHawk.out"); //int a,b,c,ans[MAX]; int main() { ios::sync_with_stdio(false); //int all=0,n=0; #ifdef XProgram int a,b,c,aa,x=0,y=99999999,all=0,flag; fin>>a>>b>>c; aa=c/a; for(int i=1;i<=aa;i++) { if((c-i*a)%b==0) { flag=(c-i*a)/b; all+=1; if(flag+i>x) x=flag+i; if(flag+i<y) y=flag+i; } } if(x==0) x=-1; if(y==99999999) y=-1; fout<<y<<' '<<x<<endl; fout<<all<<endl; #endif return 0; }