diff --git a/GESP/GESP20240629/2024062902_1.cpp b/GESP/GESP20240629/2024062902_1.cpp new file mode 100644 index 0000000..400ee37 --- /dev/null +++ b/GESP/GESP20240629/2024062902_1.cpp @@ -0,0 +1,51 @@ +#include +using namespace std; +const int N = 10010; +int T; +int a[N]; +int n; + +/* +2 +3 +1 2 4 + +5 +1 2 3 4 5 +*/ +bool check() { + //±éÀúa[1]~a[n]ÖÐÿ¸öÊý×Ö + // µ±Ç°Ã¶¾Ùµ½µÄÊý×ÖÊÇa[i] + // Åжϵ±Ç°Êý×Öa[i]ÊDz»ÊÇÆäËüÊýµÄ±¶Êý,²»ÐèÒª±Ü¿ª×Ô¼º£¬ÒòΪ×Ô¼º¿Ï¶¨ÊÇ×Ô¼ºµÄ±¶Êý + // ÕÒÍêһȦºó£¬·¢ÏÖa[i]ÊÇÆäËüÊý×ֵı¶Êý£¬·µ»Øtrue + // ÕÒÍêһȦºó£¬·¢ÏÖa[i]²»ÊÇÆäËüÊý×ֵı¶Êý£¬Ôòi++ + //Èç¹ûµ½ÁË×îºóÒ»¸ö£¬»¹Ã»ÓÐÕÒµ½ÊÇÆäËüÊý±¶ÊýµÄÊý×Ö£¬ÄÇô·µ»Øfalse + for (int i = 1; i <= n; i++) { + bool flag = false;//ĬÈÏa[i]ÊǺÃÓÃµÄ + for (int j = 1; j <= n; j++) { + if (a[i] % a[j]) { //a[i]²»ÊÇa[j]µÄ±¶Êý,ôa[i]ÊǸö·ÏÎï,ºóÐøµÄa[j]²»ÓüÌÐøÌÖÂÛÁË + flag = true;//ÓÃÀ´±ê¼ÇÊÇÖм䱻´ò¶ÏµÄ£¬Ò²¾ÍÊDz»ºÏÀíµÄa[i] + break; + } + } + //µ½´ïÁËÕâÀï + if (!flag) + return true; + } + return false; +} + +int main() { + cin >> T; + while (T--) { + cin >> n; + for (int i = 1; i <= n; i++) + cin >> a[i]; + + if (check()) + cout << "YES" << endl; + else + cout << "NO" << endl; + } + return 0; +} diff --git a/GESP/GESP20240629/2024062902_2.cpp b/GESP/GESP20240629/2024062902_2.cpp new file mode 100644 index 0000000..07c8770 --- /dev/null +++ b/GESP/GESP20240629/2024062902_2.cpp @@ -0,0 +1,7 @@ +#include +using namespace std; + +int main() { + + return 0; +} diff --git a/GESP/GESP20240629/GESP 3级 20240629.docx b/GESP/GESP20240629/GESP 3级 20240629.docx new file mode 100644 index 0000000..62a76c3 Binary files /dev/null and b/GESP/GESP20240629/GESP 3级 20240629.docx differ