Submission #3423128


Source Code Expand

#include <cstdio>
#include <algorithm>
#include <vector>
#include <cstring>

char a[105], b[105];

int main()
{
	const int Y = 2016;

	int Test=1; while (Test--){
    scanf("%s%s", a, b);
    int n = strlen(a);
    bool ans = false;
    for(int i = 0; i < n; i++) {
      bool good = true;
      for(int j = 0; j < n; j++) good &= (a[j] == b[(i+j)%n]);
      if(good) {
        ans = true;
        break;
      }
    }
    puts(ans ? "Yes" : "No");
	}

	return 0;
}

Submission Info

Submission Time
Task A - Task Scheduling Problem
User tncks0121
Language C++14 (GCC 5.4.1)
Score 0
Code Size 492 Byte
Status WA
Exec Time 1 ms
Memory 128 KB

Compile Error

./Main.cpp: In function ‘int main()’:
./Main.cpp:13:24: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
     scanf("%s%s", a, b);
                        ^

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 0 / 100
Status
WA × 3
WA × 13
Set Name Test Cases
Sample sample_01, sample_02, sample_03
All 0_small_rand_0, 0_small_rand_1, 0_small_rand_2, 0_small_rand_3, 1_rand_0, 1_rand_1, 1_rand_2, 1_rand_3, 2_hand_0, 2_hand_1, sample_01, sample_02, sample_03
Case Name Status Exec Time Memory
0_small_rand_0 WA 0 ms 128 KB
0_small_rand_1 WA 0 ms 128 KB
0_small_rand_2 WA 0 ms 128 KB
0_small_rand_3 WA 0 ms 128 KB
1_rand_0 WA 1 ms 128 KB
1_rand_1 WA 1 ms 128 KB
1_rand_2 WA 1 ms 128 KB
1_rand_3 WA 0 ms 128 KB
2_hand_0 WA 0 ms 128 KB
2_hand_1 WA 0 ms 128 KB
sample_01 WA 0 ms 128 KB
sample_02 WA 0 ms 128 KB
sample_03 WA 0 ms 128 KB