Submission #4062260
Source Code Expand
#include<cstdlib> #include<cstring> #include<cstdio> #include<string> #include<algorithm> #include<queue> #include<cmath> #include<iomanip> #include<iostream> #include<stack> #include<set> #include<map> #include<vector> #define pi 3.1415926536 const int maxn = 1e5 + 5; using namespace std; int n,y; int a,b,c; bool flag; int main() { scanf("%d %d", &n, &y); y = y / 1000; if(y > 10 * n || y < n); else{ a = y % 5;//1000 b = (y % 10 - a) / 5;//5000 c = y / 10;//10000 n = n - a - b - c; printf("%d %d %d %d\n",c,b,a,n); if(n < 0); else if(n == 0) flag = 1; else if(n <= c){c -= n; b += 2 * n; flag = 1;} else{ if(n % 9 == 0 && c >= n / 9){flag = 1; c -= n / 9; a += 10 * (n / 9);} else if(n % 9 < 4 && !flag){ c -= n % 9; b += (n % 9) * 2; n -= n % 9; if(c > n / 9){flag = 1; c -= n / 9; a += 10 * (n / 9);} } if(n % 9 == 4 && b > 0 && !flag){b--; a += 5; n -= 4;if(c > n / 9) flag = 1;} if(n % 9 > 4){c -= (n % 9 - 4); b += (n % 9 - 4) * 2 - 1; a += 5;n -= n % 9; if(c > n / 9){flag = 1; c -= n / 9; a += 10 * (n / 9);} } } } if(flag) printf("%d %d %d\n",c, b, a); else printf("-1 -1 -1\n"); return 0; }
Submission Info
Submission Time | |
---|---|
Task | C - Otoshidama |
User | vjudge4 |
Language | C++14 (GCC 5.4.1) |
Score | 0 |
Code Size | 1182 Byte |
Status | WA |
Exec Time | 1 ms |
Memory | 256 KB |
Compile Error
./Main.cpp: In function ‘int main()’: ./Main.cpp:23:24: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result] scanf("%d %d", &n, &y); ^
Judge Result
Set Name | Sample | All | ||||||
---|---|---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 0 / 300 | ||||||
Status |
|
|
Set Name | Test Cases |
---|---|
Sample | a01, a02, a03, a04 |
All | a01, a02, a03, a04, b05, b06, b07, b08, b09, b10, b11, b12, b13, b14, b15, b16, b17, b18, b19, b20, b21, b22, b23, b24 |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
a01 | WA | 1 ms | 256 KB |
a02 | WA | 1 ms | 256 KB |
a03 | WA | 1 ms | 256 KB |
a04 | WA | 1 ms | 256 KB |
b05 | WA | 1 ms | 256 KB |
b06 | WA | 1 ms | 256 KB |
b07 | WA | 1 ms | 256 KB |
b08 | WA | 1 ms | 256 KB |
b09 | WA | 1 ms | 256 KB |
b10 | AC | 1 ms | 256 KB |
b11 | AC | 1 ms | 256 KB |
b12 | WA | 1 ms | 256 KB |
b13 | WA | 1 ms | 256 KB |
b14 | WA | 1 ms | 256 KB |
b15 | WA | 1 ms | 256 KB |
b16 | WA | 1 ms | 256 KB |
b17 | WA | 1 ms | 256 KB |
b18 | WA | 1 ms | 256 KB |
b19 | WA | 1 ms | 256 KB |
b20 | WA | 1 ms | 256 KB |
b21 | WA | 1 ms | 256 KB |
b22 | WA | 1 ms | 256 KB |
b23 | WA | 1 ms | 256 KB |
b24 | WA | 1 ms | 256 KB |