Submission #757664
Source Code Expand
import std.stdio;
import std.conv;
import std.string;
import std.bigint;
BigInt det(BigInt[][] a) {
ulong size = a.length;
int sign = 1;
BigInt pivot = 1;
for(int k = 0;k < size;k++){
BigInt previous_pivot = pivot;
pivot = a[k][k];
if(pivot == 0){
bool flag = true;
int row;
for(row = k+1;row < size;row++)
if(a[row][k] != 0) {
flag = false;
break;
}
if(flag) return to!(BigInt)(0);
BigInt[] temp = a[row];
a[row] = a[k];
a[k] = temp;
pivot = a[k][k];
sign = - sign;
}
for(int i = k+1;i < size;i++) {
BigInt[] ai = a[i];
for(int j = k+1;j < size;j++) {
ai[j] = ( pivot * ai[j] - ai[k] * a[k][j] ) / previous_pivot;
}
}
}
return sign * pivot;
}
void main(){
int n = to!(int)(chomp(readln()));
BigInt[][] a;
a.length = n;
for(int i = 0;i < n;i++){
a[i].length = n;
string s = readln();
for(int j = 0;j < n;j++) a[i][j] = s[j] - 48;
}
BigInt det = det(a);
if(det % 2 == 0) writeln("Even");
else writeln("Odd");
}
Submission Info
| Submission Time | |
|---|---|
| Task | C - 鯛焼き |
| User | StrayShyGuy |
| Language | D (DMD64 v2.070.1) |
| Score | 0 |
| Code Size | 1053 Byte |
| Status | TLE |
| Exec Time | 2114 ms |
| Memory | 51452 KiB |
Judge Result
| Set Name | Sample | All | ||||||
|---|---|---|---|---|---|---|---|---|
| Score / Max Score | 0 / 0 | 0 / 100 | ||||||
| Status |
|
|
| Set Name | Test Cases |
|---|---|
| Sample | sample_01.txt, sample_02.txt, sample_03.txt, sample_04.txt |
| All | 01.txt, 02.txt, 03.txt, 04.txt, 05.txt, 06.txt, 07.txt, 08.txt, 09.txt, 10.txt, 11.txt, 12.txt, 13.txt, 14.txt, 15.txt, 16.txt, 17.txt, 18.txt, 19.txt, 20.txt, 21.txt, 22.txt, 23.txt, 24.txt, 25.txt, 26.txt, 27.txt, 28.txt, 29.txt, 30.txt, 31.txt, 32.txt, 33.txt, 34.txt, 35.txt, 36.txt, 37.txt, 38.txt, 39.txt, 40.txt, 41.txt, 42.txt, 43.txt, 44.txt, 45.txt, 46.txt, 47.txt, 48.txt, 49.txt, 50.txt, 51.txt, 52.txt, 53.txt, 54.txt |
| Case Name | Status | Exec Time | Memory |
|---|---|---|---|
| 01.txt | AC | 4 ms | 256 KiB |
| 02.txt | AC | 4 ms | 256 KiB |
| 03.txt | AC | 4 ms | 256 KiB |
| 04.txt | AC | 4 ms | 256 KiB |
| 05.txt | AC | 4 ms | 256 KiB |
| 06.txt | AC | 4 ms | 256 KiB |
| 07.txt | AC | 4 ms | 256 KiB |
| 08.txt | AC | 4 ms | 256 KiB |
| 09.txt | AC | 4 ms | 256 KiB |
| 10.txt | AC | 4 ms | 256 KiB |
| 11.txt | AC | 61 ms | 2812 KiB |
| 12.txt | AC | 67 ms | 3196 KiB |
| 13.txt | AC | 67 ms | 3196 KiB |
| 14.txt | AC | 61 ms | 2812 KiB |
| 15.txt | AC | 69 ms | 3324 KiB |
| 16.txt | AC | 65 ms | 3068 KiB |
| 17.txt | AC | 60 ms | 2684 KiB |
| 18.txt | AC | 65 ms | 2940 KiB |
| 19.txt | AC | 67 ms | 3196 KiB |
| 20.txt | AC | 59 ms | 2684 KiB |
| 21.txt | TLE | 2112 ms | 40444 KiB |
| 22.txt | TLE | 2112 ms | 39932 KiB |
| 23.txt | TLE | 2112 ms | 40316 KiB |
| 24.txt | TLE | 2113 ms | 43260 KiB |
| 25.txt | TLE | 2114 ms | 51452 KiB |
| 26.txt | TLE | 2113 ms | 43388 KiB |
| 27.txt | TLE | 2112 ms | 41212 KiB |
| 28.txt | TLE | 2112 ms | 42748 KiB |
| 29.txt | TLE | 2112 ms | 41212 KiB |
| 30.txt | TLE | 2112 ms | 41724 KiB |
| 31.txt | TLE | 2114 ms | 51452 KiB |
| 32.txt | TLE | 2112 ms | 39420 KiB |
| 33.txt | TLE | 2113 ms | 43260 KiB |
| 34.txt | TLE | 2112 ms | 41724 KiB |
| 35.txt | AC | 8 ms | 1916 KiB |
| 36.txt | TLE | 2114 ms | 51452 KiB |
| 37.txt | AC | 9 ms | 1916 KiB |
| 38.txt | TLE | 2114 ms | 51452 KiB |
| 39.txt | TLE | 2113 ms | 51452 KiB |
| 40.txt | AC | 64 ms | 4348 KiB |
| 41.txt | TLE | 2102 ms | 51452 KiB |
| 42.txt | TLE | 2112 ms | 34556 KiB |
| 43.txt | TLE | 2111 ms | 34556 KiB |
| 44.txt | TLE | 2112 ms | 34556 KiB |
| 45.txt | TLE | 2114 ms | 51452 KiB |
| 46.txt | AC | 8 ms | 1916 KiB |
| 47.txt | AC | 4 ms | 256 KiB |
| 48.txt | AC | 4 ms | 256 KiB |
| 49.txt | AC | 4 ms | 256 KiB |
| 50.txt | AC | 4 ms | 256 KiB |
| 51.txt | AC | 4 ms | 256 KiB |
| 52.txt | AC | 4 ms | 256 KiB |
| 53.txt | AC | 4 ms | 256 KiB |
| 54.txt | AC | 4 ms | 256 KiB |
| sample_01.txt | AC | 4 ms | 256 KiB |
| sample_02.txt | AC | 4 ms | 256 KiB |
| sample_03.txt | AC | 4 ms | 256 KiB |
| sample_04.txt | AC | 4 ms | 256 KiB |