Submission #1339397
Source Code Expand
#include <stdio.h> #include <stdlib.h> #include <string.h> #define MOD 1000000007 typedef unsigned long long ull; typedef signed long long sll; #define N_MAX 100000 #define M_MAX 100 ull n; ull h[N_MAX]; ull a, b; void swap_adj(ull *a, ull *b){ ull tmp = *b; *b = *a; *a = tmp; return; } int comp(const void *a, const void *b){ if (*(ull*)a > *(ull*)b) { return -1; } else if (*(ull*)a < *(ull*)b) { return +1; } else { return 0; } } int ispossible(int x){ int i; int f = 0; for (i = 0; i < n; i++) { if (h[i] <= x * b) break; f += (h[i] - x * b - 1) / a + 1; } if (f > x) { return 0; } else { return 1; } } int solve(){ if ((a * 2 + b) & 3) { puts("NO"); } else { puts("YES"); } return 0; } int main(void){ int i; scanf("%llu%llu%llu", &n, &a, &b); solve(); return 0; }
Submission Info
Submission Time | |
---|---|
Task | A - RGB Cards |
User | sheyasutaka |
Language | C (GCC 5.4.1) |
Score | 100 |
Code Size | 896 Byte |
Status | AC |
Exec Time | 1 ms |
Memory | 128 KB |
Compile Error
./Main.c: In function ‘main’: ./Main.c:62:2: warning: ignoring return value of ‘scanf’, declared with attribute warn_unused_result [-Wunused-result] scanf("%llu%llu%llu", &n, &a, &b); ^
Judge Result
Set Name | Sample | All | ||||
---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 100 / 100 | ||||
Status |
|
|
Set Name | Test Cases |
---|---|
Sample | s1.txt, s2.txt |
All | in1.txt, in2.txt, in3.txt, in4.txt, in5.txt, s1.txt, s2.txt |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
in1.txt | AC | 0 ms | 128 KB |
in2.txt | AC | 1 ms | 128 KB |
in3.txt | AC | 0 ms | 128 KB |
in4.txt | AC | 1 ms | 128 KB |
in5.txt | AC | 1 ms | 128 KB |
s1.txt | AC | 1 ms | 128 KB |
s2.txt | AC | 1 ms | 128 KB |