Submission #74105663
Source Code Expand
#include<stdio.h>
int main(){
int N;
int L;
int R;
char holder;
int count=0;
char s[100006];
scanf("%d" , &N);
scanf("%d" , &L);
scanf("%d" , &R);
for (int abc=0 ; abc<N+1 ; abc++){
scanf("%c" , &holder);
s[abc]=holder;
}
for (int i=0 ; i<N ; i++){
for (int j=i ; j<N+1 ; j++){
if (s[i] == s[j] && j>i && (j-i)>=L && (j-i)<=R){
count = count +1;
}
}
}
printf("%d" , count);
return 0;
}
Submission Info
| Submission Time | |
|---|---|
| Task | C - Comfortable Distance |
| User | Priyadarshi100 |
| Language | C23 (GCC 14.2.0) |
| Score | 0 |
| Code Size | 543 Byte |
| Status | RE |
| Exec Time | > 2000 ms |
| Memory | 1796 KiB |
Compile Error
Main.c: In function ‘main’:
Main.c:9:5: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
9 | scanf("%d" , &N);
| ^~~~~~~~~~~~~~~~
Main.c:10:5: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
10 | scanf("%d" , &L);
| ^~~~~~~~~~~~~~~~
Main.c:11:5: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
11 | scanf("%d" , &R);
| ^~~~~~~~~~~~~~~~
Main.c:13:9: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
13 | scanf("%c" , &holder);
| ^~~~~~~~~~~~~~~~~~~~~
Judge Result
| Set Name | Sample | All | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
| Score / Max Score | 0 / 0 | 0 / 300 | ||||||||
| Status |
|
|
| Set Name | Test Cases |
|---|---|
| Sample | sample00.txt, sample01.txt, sample02.txt |
| All | sample00.txt, sample01.txt, sample02.txt, testcase00.txt, testcase01.txt, testcase02.txt, testcase03.txt, testcase04.txt, testcase05.txt, testcase06.txt, testcase07.txt, testcase08.txt, testcase09.txt, testcase10.txt, testcase11.txt, testcase12.txt, testcase13.txt, testcase14.txt, testcase15.txt, testcase16.txt, testcase17.txt, testcase18.txt, testcase19.txt |
| Case Name | Status | Exec Time | Memory |
|---|---|---|---|
| sample00.txt | AC | 0 ms | 1624 KiB |
| sample01.txt | AC | 0 ms | 1788 KiB |
| sample02.txt | AC | 0 ms | 1744 KiB |
| testcase00.txt | AC | 0 ms | 1796 KiB |
| testcase01.txt | AC | 0 ms | 1660 KiB |
| testcase02.txt | TLE | > 2000 ms | 1744 KiB |
| testcase03.txt | RE | 143 ms | 1660 KiB |
| testcase04.txt | RE | 88 ms | 1628 KiB |
| testcase05.txt | RE | 91 ms | 1680 KiB |
| testcase06.txt | RE | 88 ms | 1540 KiB |
| testcase07.txt | RE | 88 ms | 1612 KiB |
| testcase08.txt | RE | 89 ms | 1616 KiB |
| testcase09.txt | RE | 88 ms | 1680 KiB |
| testcase10.txt | RE | 88 ms | 1576 KiB |
| testcase11.txt | RE | 88 ms | 1596 KiB |
| testcase12.txt | RE | 88 ms | 1632 KiB |
| testcase13.txt | RE | 89 ms | 1628 KiB |
| testcase14.txt | RE | 89 ms | 1540 KiB |
| testcase15.txt | RE | 88 ms | 1628 KiB |
| testcase16.txt | RE | 88 ms | 1608 KiB |
| testcase17.txt | RE | 88 ms | 1540 KiB |
| testcase18.txt | RE | 88 ms | 1672 KiB |
| testcase19.txt | RE | 88 ms | 1672 KiB |