Submission #591944
Source Code Expand
#include <stdio.h>
void fix(int m[1000][1000],int N)
{
int swc = 0;
int i,j,k;
while(swc){
swc = 0;
for(i=0;i<N;i++){
for(j=0;j<N;j++){
for(k=0;k<N;k++){
if((m[i][j] == m[j][k]) && (m[i][j] == 7)){
m[i][k] = 7;
swc = 1;
}
}
}
}
}
}
int main()
{
int N,M;
scanf("%d %d",&N,&M);
int m[1000][1000];
int i,j,k;
int a,b;
for (i=0;i<M;i++){
scanf("%d %d",&a,&b);
m[a][b] = 7;
m[b][a] = 7;
}
fix(m,N);
int ans = 0;
for(i=0;i<N;i++){
for(j=0;j<N;j++){
if(m[i][j] != 7){
m[i][j] = 7;
m[j][i] = 7;
ans++;
fix(m,N);
}
}
}
return 0;
}
Submission Info
| Submission Time | |
|---|---|
| Task | B - 道路工事 |
| User | syouhei |
| Language | C (GCC 4.6.4) |
| Score | 0 |
| Code Size | 698 Byte |
| Status | WA |
| Exec Time | 55 ms |
| Memory | 916 KiB |
Compile Error
./Main.c: In function ‘main’: ./Main.c:28:7: warning: ignoring return value of ‘scanf’, declared with attribute warn_unused_result [-Wunused-result] ./Main.c:35:8: warning: ignoring return value of ‘scanf’, declared with attribute warn_unused_result [-Wunused-result]
Judge Result
| Set Name | Sample | All | ||||
|---|---|---|---|---|---|---|
| Score / Max Score | 0 / 0 | 0 / 100 | ||||
| Status |
|
|
| Set Name | Test Cases |
|---|---|
| Sample | sample1.txt, sample2.txt |
| All | 0.txt, 1.txt, 10.txt, 11.txt, 12.txt, 13.txt, 14.txt, 15.txt, 16.txt, 17.txt, 18.txt, 19.txt, 2.txt, 3.txt, 4.txt, 5.txt, 6.txt, 7.txt, 8.txt, 9.txt |
| Case Name | Status | Exec Time | Memory |
|---|---|---|---|
| 0.txt | WA | 28 ms | 792 KiB |
| 1.txt | WA | 24 ms | 796 KiB |
| 10.txt | WA | 25 ms | 824 KiB |
| 11.txt | WA | 24 ms | 796 KiB |
| 12.txt | WA | 24 ms | 780 KiB |
| 13.txt | WA | 24 ms | 820 KiB |
| 14.txt | WA | 24 ms | 792 KiB |
| 15.txt | WA | 50 ms | 792 KiB |
| 16.txt | WA | 23 ms | 796 KiB |
| 17.txt | WA | 26 ms | 772 KiB |
| 18.txt | WA | 24 ms | 792 KiB |
| 19.txt | WA | 55 ms | 796 KiB |
| 2.txt | WA | 24 ms | 800 KiB |
| 3.txt | WA | 24 ms | 800 KiB |
| 4.txt | WA | 24 ms | 796 KiB |
| 5.txt | WA | 23 ms | 800 KiB |
| 6.txt | WA | 24 ms | 792 KiB |
| 7.txt | WA | 25 ms | 796 KiB |
| 8.txt | WA | 25 ms | 788 KiB |
| 9.txt | WA | 25 ms | 796 KiB |
| sample1.txt | WA | 23 ms | 812 KiB |
| sample2.txt | WA | 24 ms | 916 KiB |