Submission #371321
Source Code Expand
#include <cstdio> #include <cstdlib> #include <cstring> #include <iostream> #include <vector> #include <string> #include <algorithm> #include <stack> #include <queue> #include <set> #include <map> using namespace std; #define MOD @ #define ADD(X,Y) ((X) = ((X) + (Y)%MOD) % MOD) typedef long long i64; typedef vector<int> ivec; typedef vector<string> svec; int T; char in[20]; int chkdigit() { int ret = 0; for (int i = 0; i < 10; ++i) { for (int j = 0; j < i; ++j) if (in[j] > in[i]) ret ^= 1; } return ret; } int main() { scanf("%d", &T); for (; T--;){ scanf("%s", in); printf("%d\n", chkdigit()); } return 0; }
Submission Info
Submission Time | |
---|---|
Task | F - チェックディジット |
User | semiexp |
Language | C++11 (GCC 4.9.2) |
Score | 200 |
Code Size | 670 Byte |
Status | AC |
Exec Time | 66 ms |
Memory | 924 KB |
Compile Error
./Main.cpp: In function ‘int main()’: ./Main.cpp:31:17: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result] scanf("%d", &T); ^ ./Main.cpp:33:18: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result] scanf("%s", in); ^
Judge Result
Set Name | Subtask00 | Subtask01 | Subtask02 | Subtask03 | Subtask04 | Subtask05 | Subtask06 | Subtask07 | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Score / Max Score | 25 / 25 | 25 / 25 | 25 / 25 | 25 / 25 | 25 / 25 | 25 / 25 | 25 / 25 | 25 / 25 | ||||||||||||||||
Status |
|
|
|
|
|
|
|
|
Set Name | Test Cases |
---|---|
Subtask00 | 00_n_3e1 |
Subtask01 | 01_n_1e2 |
Subtask02 | 02_n_3e2 |
Subtask03 | 03_n_1e3 |
Subtask04 | 04_n_3e3 |
Subtask05 | 05_n_1e4 |
Subtask06 | 06_n_3e4 |
Subtask07 | 07_n_1e5 |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
00_n_3e1 | AC | 23 ms | 800 KB |
01_n_1e2 | AC | 23 ms | 924 KB |
02_n_3e2 | AC | 22 ms | 672 KB |
03_n_1e3 | AC | 23 ms | 796 KB |
04_n_3e3 | AC | 25 ms | 804 KB |
05_n_1e4 | AC | 29 ms | 924 KB |
06_n_3e4 | AC | 37 ms | 804 KB |
07_n_1e5 | AC | 66 ms | 800 KB |
sample | AC | 24 ms | 924 KB |