Submission #574508

#TimeUsernameProblemLanguageResultExecution timeMemory
574508LoboPictionary (COCI18_pictionary)C++17
0 / 140
1 ms512 KiB
#include<bits/stdc++.h> using namespace std; int main(){ int t; cin >> t; while(t--){ int a, b, k; cin >> a >> b >> k; int g = gcd(a, b); int l, i; while(!g%l){ if(i&1) l = g/k; if(!(i&1)) l = (g+k-1)/k; i++; } int lol = g/l; int ans = k-lol+1; cout << ans << '\n'; } }

Compilation message (stderr)

pictionary.cpp: In function 'int main()':
pictionary.cpp:13:17: warning: 'i' may be used uninitialized in this function [-Wmaybe-uninitialized]
   13 |             if(i&1) l = g/k;
      |                ~^~
pictionary.cpp:12:17: warning: 'l' may be used uninitialized in this function [-Wmaybe-uninitialized]
   12 |         while(!g%l){
      |               ~~^~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...