제출 #673383

#제출 시각아이디문제언어결과실행 시간메모리
673383Farhan_HYProgramiranje (COCI17_programiranje)C++14
80 / 80
47 ms13648 KiB
#include<bits/stdc++.h> #define IOS ios::sync_with_stdio(0);cin.tie(0);cout.tie(0); #define T int t;cin >> t;while(t--) #define int long long #define F first #define S second using namespace std; const int mod = 1e9 + 7; const int N = 1e6 + 6; int q, pre[30][N]; string s; main() { IOS cin >> s; int n = s.size(); s = '.' + s; for(int i = 1; i <= n; i++) { pre[s[i] - 'a'][i]++; for(int j = 0; j < 30; j++) pre[j][i] += pre[j][i - 1]; } cin >> q; while(q--) { int a, b, c, d; cin >> a >> b >> c >> d; bool ok = 1; for(int i = 0; i < 30; i++) ok &= (pre[i][b] - pre[i][a - 1]) == (pre[i][d] - pre[i][c - 1]); if(ok) cout << "DA\n"; else cout << "NE\n"; } }

컴파일 시 표준 에러 (stderr) 메시지

programiranje.cpp:13:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
   13 | main() {
      | ^~~~
#Verdict Execution timeMemoryGrader output
Fetching results...