Submission #974061

#TimeUsernameProblemLanguageResultExecution timeMemory
974061VinhLuuKaučuk (COCI21_kaucuk)C++17
50 / 50
1 ms460 KiB
//#pragma GCC optimize("O3,unroll-loops") //#pragma GCC target("avx2,bmi,bmi2,lzcnt,popcnt") #include <bits/stdc++.h> #define int long long #define ll long long #define fi first #define se second #define pb push_back #define all(lmao) lmao.begin(), lmao.end() using namespace std; typedef pair<int,int> pii; typedef tuple<int,int,int> tp; const int N = 1e5 + 5; const int oo = 1e9 + 1; const int mod = 1e9 + 7; //const ll oo = 5e18; int n; signed main(){ ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); #define task "v" if(fopen(task ".inp","r")){ freopen(task ".inp","r",stdin); freopen(task ".out","w",stdout); } cin >> n; int a, b, c; a = b = c = 0; for(int i = 1; i <= n; i ++){ string s, t; cin >> s >> t; if(s == "section") { a++, b = 0, c = 0; cout << a << " " << t << "\n"; }else if(s == "subsection") { b++, c = 0; cout << a << "." << b << " " << t << "\n"; }else if(s == "subsubsection") { ++c; cout << a << "." << b << "." << c << " " << t << "\n"; } } }

Compilation message (stderr)

Main.cpp: In function 'int main()':
Main.cpp:27:16: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
   27 |         freopen(task ".inp","r",stdin);
      |         ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~
Main.cpp:28:16: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
   28 |         freopen(task ".out","w",stdout);
      |         ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...