Submission #00171
ソースコード
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 | #include<stdio.h> #include<string.h> int main(){ char s[5001], judge[100]; int i = 0, j, k, tmp, len; gets (s); len = strlen (s); s[len] = ' ' ; int loop = 0; while ( i < len ){ loop++; printf ( "%d回目\n" , loop); // "not not "の羅列は8文字→次の8文字分まで判定 // judge[]に8文字分を格納 //printf("i = %d\n", i); //judge[]にs[i]から8文字分を格納 for ( k = 0 ; k < 8 ; i++, k++ ){ printf ( "i = %d, s[%d] = %c\n" , i, i, s[i]); judge[k] = s[i]; } judge[8] = '\0' ; //printf("%s\n", judge); //printf("%d\n", strlen(judge)); printf ( "i = %d, tmp = %d\n" , i, tmp); char judge2[100]; for ( j = 0 ; j < 7 ; j++){ judge2[j] = judge[j]; } judge2[7] = '\0' ; // 8文字分が"not not "だったら if (( strcmp ( judge, "not not " ) == 0) || ( strcmp (judge2, "not not" )==0)){ printf ( "8文字分は\"not not \"\n" ); // "not not not "の判定 tmp = i + 4; for ( k = 0 ; k < 4 ; k++, i++){ judge[k] = s[i]; printf ( "i = %d, tmp = %d, s[%d] = %c\n" , i, tmp, i, s[i]); } judge[4] = '\0' ; //printf("%s\n", judge); //printf("%d\n", strlen(judge)); // "not not not "だったら //printf("%d\n", strcmp( judge, "not ")); if ( strcmp ( judge, "not " ) == 0){ //printf("not not じゃなかったよ\n"); i -= 4; //何もしない() } else { i -= 4; //puts("OK2"); //printf("%d\n", i); for ( j = i ; j < len ; j++){ printf ( "j = %d, s[%d] = %c, s[%d] = %c\n" , j, j-8, s[i-8], j, s[j]); s[j-8] = s[j]; } len -= 7; i = i - 8; } } else { i -= 7; } } s[len] = '\0' ; printf ( "%s\n" , s); return (0); } |
ステータス
項目 | データ |
---|---|
問題 | 0005 - 二重否定除去法則 |
ユーザー名 | DB☆Appear! |
投稿日時 | 2015-08-28 11:48:36 |
言語 | C |
状態 | Wrong Answer |
得点 | 0 |
ソースコード長 | 1784 Byte |
最大実行時間 | 32 ms |
最大メモリ使用量 | 14788 KB |
セット
セット | 得点 | Cases | |
---|---|---|---|
1 | ALL | 0 / 20 | * |
テストケース
ファイル名 | 状態 | 実行時間 | メモリ使用量 | # |
---|---|---|---|---|
scrambled_00.txt | WA | 18 ms | 380 KB |
1
|
scrambled_01.txt | WA | 22 ms | 528 KB |
1
|
scrambled_02.txt | WA | 15 ms | 584 KB |
1
|
scrambled_03.txt | WA | 24 ms | 548 KB |
1
|
scrambled_04.txt | WA | 17 ms | 480 KB |
1
|
scrambled_05.txt | WA | 16 ms | 752 KB |
1
|
scrambled_06.txt | WA | 18 ms | 936 KB |
1
|
scrambled_07.txt | WA | 14 ms | 1252 KB |
1
|
scrambled_08.txt | WA | 21 ms | 1440 KB |
1
|
scrambled_09.txt | WA | 20 ms | 2140 KB |
1
|
scrambled_10.txt | WA | 23 ms | 2964 KB |
1
|
scrambled_11.txt | WA | 24 ms | 3912 KB |
1
|
scrambled_12.txt | WA | 28 ms | 5244 KB |
1
|
scrambled_13.txt | WA | 19 ms | 6320 KB |
1
|
scrambled_14.txt | WA | 32 ms | 8292 KB |
1
|
scrambled_15.txt | WA | 27 ms | 10140 KB |
1
|
scrambled_16.txt | WA | 30 ms | 11604 KB |
1
|
scrambled_17.txt | WA | 25 ms | 13072 KB |
1
|
scrambled_18.txt | WA | 20 ms | 14788 KB |
1
|